This Windows Forms application implements a process time tracking interface that displays application usage statistics. Users can view time spent in various applications, filter by categories, and see historical usage data through graphs.
┌───────────────────────┐ ┌─────────────────────┐
│ MainForm │ │ ProcessData │
├───────────────────────┤ ├─────────────────────┤
│ - processListView │ │ - Name: string │
│ - usageGraph │ │ - PID: int │
│ - categorySelector │ │ - Department: string│
│ - statsPanel │ │ - TimeToday: TimeSpan│
├───────────────────────┤ ├─────────────────────┤
│ + InitializeComponent()│ │ + GetTotalTime() │
│ + LoadProcessData() │◄────────┐ │ + GetActiveTime() │
│ + UpdateGraph() │ │ │ + GetIdleTime() │
│ + FilterByCategory() │ │ └─────────────────────┘
└───────────────────────┘ │
│ ┌─────────────────────┐
└─│ UsageGraph │
├─────────────────────┤
│ - timeData: List │
│ - timeRange: string │
├─────────────────────┤
│ + DrawGraph() │
│ + UpdateTimeRange() │
└─────────────────────┘
The primary interface that contains all UI elements and manages user interactions.
Properties:
processListView
: ListView displaying process informationusageGraph
: Custom control for rendering the usage graphcategorySelector
: Panel with category filter buttonsstatsPanel
: Panel displaying usage statistics
Methods:
InitializeComponent()
: Sets up the UI componentsLoadProcessData()
: Loads process data from the systemUpdateGraph()
: Updates the graph based on selected processFilterByCategory()
: Filters the process list by selected category
Represents a single process with its usage data.
Properties:
Name
: Process namePID
: Process IDDepartment
: Category of the process (Games, Learning, etc.)TimeToday
: Time spent on the process today
Methods:
GetTotalTime()
: Returns the total time spent on the processGetActiveTime()
: Returns the active time spent on the processGetIdleTime()
: Returns the idle time spent on the process
Custom control for rendering the usage graph.
Properties:
timeData
: Collection of time data pointstimeRange
: Selected time range (day, week, month)
Methods:
DrawGraph()
: Renders the graph based on current dataUpdateTimeRange()
: Changes the time range of displayed data
The main interface is divided into three main sections:
- Top Section: Contains the usage graph showing hours per day over the selected time period
- Bottom Left Section: Contains the process list with columns for Name, PID, Department, and Today's usage
- Bottom Right Section: Contains usage statistics and category filters
The process list is implemented as a ListView control with columns for:
- Name: The name of the process
- PID: Process ID
- Dept: Category/department of the process
- Today: Time spent on the process today
The usage graph is implemented as a custom control that:
- Displays time usage over a specified period (day, week, month)
- Updates when a process is selected from the list
- Shows hours per day as a line graph
The category filter allows users to filter processes by categories:
- Games
- Learning
- Coding
- Entertainment
The statistics panel shows:
- Total time spent today
- Idle time
- Active time
- User opens the application
- The application loads and displays all processes with their usage data
- User can filter processes by category using the category buttons
- User can select a process from the list to view its detailed usage graph
- The graph updates to show the selected process's usage over time
- Statistics panel updates to show the selected process's usage statistics