コード例 #1
0
        void dt_ProjectDeleted(object sender, TimeTrackerEvent e)
        {
            TimeTrackerDataSet.ProjectsRow row = e.ProjectEntry;
            ToolStripMenuItem menuItem         = null;

            // Modify the project menu list accordingly
            foreach (ToolStripMenuItem mi in projectMenuItems)
            {
                if (mi.Tag == row)
                {
                    menuItem = mi;
                    break;
                }
            }

            if (menuItem != null)
            {
                menuItem.Visible = false;
                projectMenuItems.Remove(menuItem);

                // If the deleted project is the current project
                if (currentProjectMenuItem == menuItem)
                {
                    // Now there is no current project
                    currentProjectMenuItem = null;
                }
            }
        }
コード例 #2
0
        void dt_ProjectAdded(object sender, TimeTrackerEvent e)
        {
            ToolStripMenuItem newMenuItem = AddProjectMenuItem(e.ProjectEntry);

            // Check new project right away if user not punched in
            if (!dt.UserCheckedIn)
            {
                projectSelectMenuItem_Click(newMenuItem, null);
            }
        }
コード例 #3
0
        void dt_ProjectModified(object sender, TimeTrackerEvent e)
        {
            TimeTrackerDataSet.ProjectsRow row = e.ProjectEntry;

            // Modify the project menu list accordingly
            foreach (ToolStripMenuItem menuItem in projectMenuItems)
            {
                if (menuItem.Tag == row)
                {
                    // Update project menu item accordingly
                    menuItem.Text    = row.ProjectName;
                    menuItem.Visible = row.Active;
                    break;
                }
            }
        }
コード例 #4
0
 void dt_UserPunchedOut(object sender, TimeTrackerEvent e)
 {
     UpdatePunchInOutOptions();
 }