Exemplo n.º 1
0
        public ProjectToolStripMenuItem(TimeTracker.TimeTrackerDataSet.ProjectsRow projectRow)
        {
            this.Name = $"MenuItem:Project{projectRow.ProjectID}";
            this.Text = projectRow.ProjectName;

            ProjectRow   = projectRow;
            this.Visible = projectRow.Active;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds a new project menu item given a ProjectsRow object.
        /// </summary>
        /// <param name="newProjectRow"></param>
        private ToolStripMenuItem AddProjectMenuItem(TimeTracker.TimeTrackerDataSet.ProjectsRow newProjectRow)
        {
            ProjectToolStripMenuItem newMenuItem = new ProjectToolStripMenuItem(newProjectRow);

            newMenuItem.Click += projectSelectEventHandler;

            this.changeProjectToolStripMenuItem.DropDownItems.AddRange(
                new System.Windows.Forms.ToolStripItem[] {
                newMenuItem
            });

            projectMenuItems.Add(newMenuItem);

            return(newMenuItem);
        }