Inheritance: System.Windows.Forms.Control, IDisposable
Exemplo n.º 1
0
 public void Remove(CommandBar commandBar)
 {
     this.bands.Remove(commandBar);
     this.commandBarManager.RemoveCommandBar();
 }
Exemplo n.º 2
0
 public bool Contains(CommandBar commandBar)
 {
     return(this.bands.Contains(commandBar));
 }
Exemplo n.º 3
0
 public int IndexOf(CommandBar commandBar)
 {
     return(this.bands.IndexOf(commandBar));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.menuItem1                  = new System.Windows.Forms.MenuItem();
     this._menuMain                  = new Crownwood.Magic.Menus.MenuControl();
     this._menuFile                  = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileNew                = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileOpen               = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileClose              = new Crownwood.Magic.Menus.MenuCommand();
     this._sep1                      = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileSave               = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileSaveAs             = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileSaveAll            = new Crownwood.Magic.Menus.MenuCommand();
     this._sep2                      = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileRecentProjects     = new Crownwood.Magic.Menus.MenuCommand();
     this._sep3                      = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileExit               = new Crownwood.Magic.Menus.MenuCommand();
     this._menuEdit                  = new Crownwood.Magic.Menus.MenuCommand();
     this._menuProject               = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdProjectRun             = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdProjectStop            = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdProjectOptions         = new Crownwood.Magic.Menus.MenuCommand();
     this._sep4                      = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdProjectRunViewMessages = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdProjectRunCopy         = new Crownwood.Magic.Menus.MenuCommand();
     this._menuView                  = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdViewProjectView        = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdViewNavBack            = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdViewNavForward         = new Crownwood.Magic.Menus.MenuCommand();
     this._menuHelp                  = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdHelpAbout              = new Crownwood.Magic.Menus.MenuCommand();
     this._tcProfilers               = new Crownwood.Magic.Controls.TabControl();
     this._sbStatusBar               = new System.Windows.Forms.StatusBar();
     this._sbpMessage                = new System.Windows.Forms.StatusBarPanel();
     this.commandBarManager1         = new Reflector.UserInterface.CommandBarManager();
     this.commandBar1                = new Reflector.UserInterface.CommandBar();
     ((System.ComponentModel.ISupportInitialize)(this._sbpMessage)).BeginInit();
     this.SuspendLayout();
     //
     // menuItem1
     //
     this.menuItem1.Index = -1;
     this.menuItem1.Text  = "Close Tab";
     //
     // _menuMain
     //
     this._menuMain.AnimateStyle       = Crownwood.Magic.Menus.Animation.System;
     this._menuMain.AnimateTime        = 100;
     this._menuMain.Cursor             = System.Windows.Forms.Cursors.Arrow;
     this._menuMain.Direction          = Crownwood.Magic.Common.Direction.Horizontal;
     this._menuMain.Dock               = System.Windows.Forms.DockStyle.Top;
     this._menuMain.Font               = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((System.Byte)(0)));
     this._menuMain.HighlightTextColor = System.Drawing.SystemColors.MenuText;
     this._menuMain.Location           = new System.Drawing.Point(0, 0);
     this._menuMain.MenuCommands.AddRange(new Crownwood.Magic.Menus.MenuCommand[] {
         this._menuFile,
         this._menuEdit,
         this._menuProject,
         this._menuView,
         this._menuHelp
     });
     this._menuMain.Name     = "_menuMain";
     this._menuMain.Size     = new System.Drawing.Size(920, 25);
     this._menuMain.Style    = Crownwood.Magic.Common.VisualStyle.IDE;
     this._menuMain.TabIndex = 0;
     this._menuMain.TabStop  = false;
     this._menuMain.Text     = "menuControl1";
     //
     // _menuFile
     //
     this._menuFile.Description = "File";
     this._menuFile.MenuCommands.AddRange(new Crownwood.Magic.Menus.MenuCommand[] {
         this._cmdFileNew,
         this._cmdFileOpen,
         this._cmdFileClose,
         this._sep1,
         this._cmdFileSave,
         this._cmdFileSaveAs,
         this._cmdFileSaveAll,
         this._sep2,
         this._cmdFileRecentProjects,
         this._sep3,
         this._cmdFileExit
     });
     this._menuFile.Text = "&File";
     //
     // _cmdFileNew
     //
     this._cmdFileNew.Description = "New Profiler Project";
     this._cmdFileNew.Shortcut    = System.Windows.Forms.Shortcut.CtrlN;
     this._cmdFileNew.Text        = "&New...";
     this._cmdFileNew.Click      += new System.EventHandler(this._cmdFileNew_Click);
     this._cmdFileNew.Update     += new System.EventHandler(this.UpdateMenuItems);
     //
     // _cmdFileOpen
     //
     this._cmdFileOpen.Description = "Open a profile project";
     this._cmdFileOpen.Text        = "&Open...";
     this._cmdFileOpen.Click      += new System.EventHandler(this._cmdFileOpen_Click);
     //
     // _cmdFileClose
     //
     this._cmdFileClose.Description = "Close the project";
     this._cmdFileClose.Text        = "&Close";
     this._cmdFileClose.Click      += new System.EventHandler(this._cmdFileClose_Click);
     //
     // _sep1
     //
     this._sep1.Description = "MenuItem";
     this._sep1.Text        = "-";
     //
     // _cmdFileSave
     //
     this._cmdFileSave.Description = "Save the active profiler project";
     this._cmdFileSave.Shortcut    = System.Windows.Forms.Shortcut.CtrlS;
     this._cmdFileSave.Text        = "&Save";
     this._cmdFileSave.Click      += new System.EventHandler(this._cmdFileSave_Click);
     //
     // _cmdFileSaveAs
     //
     this._cmdFileSaveAs.Description = "Save the active profiler project as a specified file name";
     this._cmdFileSaveAs.Text        = "Save &As...";
     this._cmdFileSaveAs.Click      += new System.EventHandler(this._cmdFileSaveAs_Click);
     //
     // _cmdFileSaveAll
     //
     this._cmdFileSaveAll.Description = "Save all open profiler projects";
     this._cmdFileSaveAll.Shortcut    = System.Windows.Forms.Shortcut.CtrlShiftS;
     this._cmdFileSaveAll.Text        = "Save A&ll";
     this._cmdFileSaveAll.Click      += new System.EventHandler(this._cmdFileSaveAll_Click);
     //
     // _sep2
     //
     this._sep2.Description = "MenuItem";
     this._sep2.Text        = "-";
     //
     // _cmdFileRecentProjects
     //
     this._cmdFileRecentProjects.Description = "Provides a list of the 10 most recently opened projects for easy access";
     this._cmdFileRecentProjects.Text        = "Recent Projects";
     //
     // _sep3
     //
     this._sep3.Description = "-";
     this._sep3.Text        = "-";
     //
     // _cmdFileExit
     //
     this._cmdFileExit.Description = "Exit the application";
     this._cmdFileExit.Shortcut    = System.Windows.Forms.Shortcut.AltF4;
     this._cmdFileExit.Text        = "E&xit";
     this._cmdFileExit.Click      += new System.EventHandler(this._cmdFileExit_Click);
     //
     // _menuEdit
     //
     this._menuEdit.Description = "Edit";
     this._menuEdit.Enabled     = false;
     this._menuEdit.Text        = "&Edit";
     //
     // _menuProject
     //
     this._menuProject.Description = "Project commands";
     this._menuProject.MenuCommands.AddRange(new Crownwood.Magic.Menus.MenuCommand[] {
         this._cmdProjectRun,
         this._cmdProjectStop,
         this._cmdProjectOptions,
         this._sep4,
         this._cmdProjectRunViewMessages,
         this._cmdProjectRunCopy
     });
     this._menuProject.Text = "&Project";
     //
     // _cmdProjectRun
     //
     this._cmdProjectRun.Description = "Run the current project";
     this._cmdProjectRun.Shortcut    = System.Windows.Forms.Shortcut.F5;
     this._cmdProjectRun.Text        = "Start project run";
     this._cmdProjectRun.Click      += new System.EventHandler(this._cmdProjectRun_Click);
     this._cmdProjectRun.Update     += new System.EventHandler(this.UpdateMenuItems);
     //
     // _cmdProjectStop
     //
     this._cmdProjectStop.Description = "Stop the running project";
     this._cmdProjectStop.Text        = "Stop project run";
     //
     // _cmdProjectOptions
     //
     this._cmdProjectOptions.Description = "Modify the options for this project";
     this._cmdProjectOptions.Shortcut    = System.Windows.Forms.Shortcut.F2;
     this._cmdProjectOptions.Text        = "Options...";
     this._cmdProjectOptions.Click      += new System.EventHandler(this._cmdProjectOptions_Click);
     this._cmdProjectOptions.Update     += new System.EventHandler(this.UpdateMenuItems);
     //
     // _sep4
     //
     this._sep4.Description = "-";
     this._sep4.Text        = "-";
     //
     // _cmdProjectRunViewMessages
     //
     this._cmdProjectRunViewMessages.Description = "View the Messages from the current profiler run...";
     this._cmdProjectRunViewMessages.Text        = "View Run Messages...";
     this._cmdProjectRunViewMessages.Click      += new System.EventHandler(this._cmdProjectRunViewMessages_Click);
     //
     // _cmdProjectRunCopy
     //
     this._cmdProjectRunCopy.Description = "Copy the project run data to the clipboard";
     this._cmdProjectRunCopy.Text        = "Copy Project Run Data";
     //
     // _menuView
     //
     this._menuView.Description = "View";
     this._menuView.MenuCommands.AddRange(new Crownwood.Magic.Menus.MenuCommand[] {
         this._cmdViewProjectView,
         this._cmdViewNavBack,
         this._cmdViewNavForward
     });
     this._menuView.Text = "&View";
     //
     // _cmdViewProjectView
     //
     this._cmdViewProjectView.Description = "Show/hide the project tab";
     this._cmdViewProjectView.Text        = "Project tab";
     this._cmdViewProjectView.Click      += new System.EventHandler(this._cmdViewProjectView_Click);
     this._cmdViewProjectView.Update     += new System.EventHandler(this._cmdViewProjectView_Update);
     //
     // _cmdViewNavBack
     //
     this._cmdViewNavBack.Description = "Navigate Back";
     this._cmdViewNavBack.Text        = "Back";
     this._cmdViewNavBack.Click      += new System.EventHandler(this._cmdViewNavBack_Click);
     //
     // _cmdViewNavForward
     //
     this._cmdViewNavForward.Description = "Navigate Forward";
     this._cmdViewNavForward.Text        = "Forward";
     this._cmdViewNavForward.Click      += new System.EventHandler(this._cmdViewNavForward_Click);
     //
     // _menuHelp
     //
     this._menuHelp.Description = "Help";
     this._menuHelp.MenuCommands.AddRange(new Crownwood.Magic.Menus.MenuCommand[] {
         this._cmdHelpAbout
     });
     this._menuHelp.Text = "&Help";
     //
     // _cmdHelpAbout
     //
     this._cmdHelpAbout.Description = "About nprof";
     this._cmdHelpAbout.Text        = "About nprof...";
     this._cmdHelpAbout.Click      += new System.EventHandler(this._cmdHelpAbout_Click);
     //
     // _tcProfilers
     //
     this._tcProfilers.Dock          = System.Windows.Forms.DockStyle.Fill;
     this._tcProfilers.IDEPixelArea  = true;
     this._tcProfilers.Location      = new System.Drawing.Point(0, 26);
     this._tcProfilers.Name          = "_tcProfilers";
     this._tcProfilers.Size          = new System.Drawing.Size(920, 629);
     this._tcProfilers.TabIndex      = 2;
     this._tcProfilers.ClosePressed += new System.EventHandler(this._tcProfilers_ClosePressed);
     //
     // _sbStatusBar
     //
     this._sbStatusBar.Location = new System.Drawing.Point(0, 655);
     this._sbStatusBar.Name     = "_sbStatusBar";
     this._sbStatusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
         this._sbpMessage
     });
     this._sbStatusBar.ShowPanels = true;
     this._sbStatusBar.Size       = new System.Drawing.Size(920, 22);
     this._sbStatusBar.TabIndex   = 3;
     //
     // _sbpMessage
     //
     this._sbpMessage.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
     this._sbpMessage.Text     = "Ready.";
     this._sbpMessage.Width    = 904;
     //
     // commandBarManager1
     //
     this.commandBarManager1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.commandBarManager1.Location = new System.Drawing.Point(0, 25);
     this.commandBarManager1.Name     = "commandBarManager1";
     this.commandBarManager1.Size     = new System.Drawing.Size(920, 1);
     this.commandBarManager1.TabIndex = 3;
     this.commandBarManager1.TabStop  = false;
     this.commandBarManager1.Text     = "commandBarManager1";
     //
     // commandBar1
     //
     this.commandBar1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.commandBar1.Font     = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((System.Byte)(0)));
     this.commandBar1.Location = new System.Drawing.Point(0, 64);
     this.commandBar1.Name     = "commandBar1";
     this.commandBar1.Size     = new System.Drawing.Size(920, 64);
     this.commandBar1.Style    = Reflector.UserInterface.CommandBarStyle.ToolBar;
     this.commandBar1.TabIndex = 4;
     this.commandBar1.TabStop  = false;
     this.commandBar1.Text     = "commandBar1";
     //
     // ProfilerForm
     //
     this.AllowDrop         = true;
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(920, 677);
     this.Controls.Add(this._tcProfilers);
     this.Controls.Add(this.commandBarManager1);
     this.Controls.Add(this._menuMain);
     this.Controls.Add(this._sbStatusBar);
     this.Name     = "ProfilerForm";
     this.Text     = "nprof Profiling Application - Alpha v0.6";
     this.Closing += new System.ComponentModel.CancelEventHandler(this.ProfilerForm_Closing);
     this.Load    += new System.EventHandler(this.ProfilerForm_Load);
     this.Layout  += new System.Windows.Forms.LayoutEventHandler(this.ProfilerForm_Layout);
     ((System.ComponentModel.ISupportInitialize)(this._sbpMessage)).EndInit();
     this.ResumeLayout(false);
 }
Exemplo n.º 5
0
        private void ProfilerForm_Load(object sender, System.EventArgs e)
        {
            this.Icon = new Icon(this.GetType().Assembly.GetManifestResourceStream("NProf.GUI.Resources.app-icon.ico"));

            CommandBarItem item;

            commandBar2       = new CommandBar();
            commandBar2.Style = CommandBarStyle.ToolBar;

            item = new CommandBarButton(Images.New, "New", new EventHandler(_cmdFileNew_Click));
            _cmdFileNew.Image = Images.New;
            commandBar2.Items.Add(item);

            item = new CommandBarButton(Images.Open, "Open", new EventHandler(_cmdFileOpen_Click));
            _cmdFileOpen.Image = Images.Open;
            commandBar2.Items.Add(item);

            item = new CommandBarButton(Images.Save, "Save", new EventHandler(_cmdFileSave_Click));
            _cmdFileSave.Image = Images.Save;
            commandBar2.Items.Add(item);

            commandBar2.Items.AddSeparator();

            item           = new CommandBarButton(Images.Cut, "Cut", new EventHandler(_cmdFileNew_Click));
            item.IsEnabled = false;
            commandBar2.Items.Add(item);

            item           = new CommandBarButton(Images.Copy, "Copy", new EventHandler(_cmdFileNew_Click));
            item.IsEnabled = false;
            commandBar2.Items.Add(item);

            item           = new CommandBarButton(Images.Paste, "Paste", new EventHandler(_cmdFileNew_Click));
            item.IsEnabled = false;
            commandBar2.Items.Add(item);

            commandBar2.Items.AddSeparator();

            item = new CommandBarButton(Images.Back, "Back", new EventHandler(_cmdViewNavBack_Click));
            _cmdViewNavBack.Image = Images.Back;
            commandBar2.Items.Add(item);

            item = new CommandBarButton(Images.Forward, "Forward", new EventHandler(_cmdViewNavForward_Click));
            _cmdViewNavForward.Image = Images.Forward;
            commandBar2.Items.Add(item);

            commandBarManager1.CommandBars.Add(commandBar2);

            _pic = new ProjectInfoCollection();
            _pt  = new ProjectTree();

            _pic.ProjectRemoved += new NProf.Glue.Profiler.Project.ProjectInfoCollection.ProjectEventHandler(_pic_ProjectRemoved);

            _pt.Projects              = _pic;
            _pt.ProjectDoubleClicked += new ProjectTree.ProjectDoubleClickedHandler(_pt_ProjectDoubleClicked);
            _pt.RunDoubleClicked     += new ProjectTree.RunDoubleClickedHandler(_pt_RunDoubleClicked);
            _pt.ExecutablesDropped   += new ProjectTree.ExecutablesDroppedHandler(_pt_ExecutableDropped);

            _dock = new Crownwood.Magic.Docking.DockingManager(this, Crownwood.Magic.Common.VisualStyle.IDE);
            _dock.OuterControl = commandBarManager1;
            _dock.InnerControl = _tcProfilers;
            Crownwood.Magic.Docking.Content       c  = _dock.Contents.Add(_pt, "Projects");
            Crownwood.Magic.Docking.WindowContent wc = _dock.AddContentWithState(c, Crownwood.Magic.Docking.State.DockLeft);

            this.Text = "nprof Profiling Application - v" + Profiler.Version;
            _tcProfilers.Appearance = Crownwood.Magic.Controls.TabControl.VisualAppearance.MultiDocument;

            SerializationHandler.DataStoreDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\NProf\\" + Profiler.Version;

            _cmdFileRecentProjects.MenuCommands.Clear();

            int count = 1;

            foreach (UsedFile usedFile in SerializationHandler.ProjectsHistory)
            {
                if (count > 10)
                {
                    break;
                }

                string label = (count == 10 ? "1&0" : "&" + count.ToString()) + " " + usedFile.ProjectName;

                Crownwood.Magic.Menus.MenuCommand pInfo = new Crownwood.Magic.Menus.MenuCommand(label);
                pInfo.Tag      = usedFile.FileName;
                pInfo.Click   += new EventHandler(_cmdFileRecentlyUsed_Click);
                pInfo.Shortcut = Shortcut.CtrlShift1 + (count == 10 ? -1 : count - 1);
                _cmdFileRecentProjects.MenuCommands.Add(pInfo);

                ++count;
            }

            if (count == 1)
            {
                _cmdFileRecentProjects.Enabled = false;
            }

            if (_piInitialProject != null)
            {
                _pic.Add(_piInitialProject);
                _pt.SelectProject(_piInitialProject);
                _cmdProjectRun_Click(null, null);
            }
        }
 internal CommandBarItemCollection(CommandBar commandBar)
 {
     this.commandBar = commandBar;
     this.items      = new ArrayList();
 }
 internal CommandBarItemCollection()
 {
     this.commandBar = null;
     this.items      = new ArrayList();
 }
        private void CommandBar_TextChanged(object sender, EventArgs e)
        {
            CommandBar commandBar = (CommandBar)sender;

            this.UpdateBand(this.commandBars.IndexOf(commandBar));
        }
Exemplo n.º 9
0
        private void ProfilerForm_Load(object sender, System.EventArgs e)
        {
            this.Icon = new Icon( this.GetType().Assembly.GetManifestResourceStream( "NProf.GUI.Resources.app-icon.ico" ) );

            CommandBarItem item;
            commandBar2 = new CommandBar();
            commandBar2.Style = CommandBarStyle.ToolBar;

            item = new CommandBarButton( Images.New, "New", new EventHandler( _cmdFileNew_Click ) );
            _cmdFileNew.Image = Images.New;
            commandBar2.Items.Add( item );

            item = new CommandBarButton( Images.Open, "Open", new EventHandler( _cmdFileOpen_Click ) );
            _cmdFileOpen.Image = Images.Open;
            commandBar2.Items.Add( item );

            item = new CommandBarButton( Images.Save, "Save", new EventHandler( _cmdFileSave_Click ) );
            _cmdFileSave.Image = Images.Save;
            commandBar2.Items.Add( item );

            commandBar2.Items.AddSeparator();

            item = new CommandBarButton( Images.Cut, "Cut", new EventHandler( _cmdFileNew_Click ) );
            item.IsEnabled = false;
            commandBar2.Items.Add( item );

            item = new CommandBarButton( Images.Copy, "Copy", new EventHandler( _cmdFileNew_Click ) );
            item.IsEnabled = false;
            commandBar2.Items.Add( item );

            item = new CommandBarButton( Images.Paste, "Paste", new EventHandler( _cmdFileNew_Click ) );
            item.IsEnabled = false;
            commandBar2.Items.Add( item );

            commandBar2.Items.AddSeparator();

            item = new CommandBarButton( Images.Back, "Back", new EventHandler( _cmdViewNavBack_Click ) );
            _cmdViewNavBack.Image = Images.Back;
            commandBar2.Items.Add( item );

            item = new CommandBarButton( Images.Forward, "Forward", new EventHandler( _cmdViewNavForward_Click ) );
            _cmdViewNavForward.Image = Images.Forward;
            commandBar2.Items.Add( item );

            commandBarManager1.CommandBars.Add( commandBar2 );

            _pic = new ProjectInfoCollection();
            _pt = new ProjectTree();

            _pic.ProjectRemoved +=new NProf.Glue.Profiler.Project.ProjectInfoCollection.ProjectEventHandler(_pic_ProjectRemoved);

            _pt.Projects = _pic;
            _pt.ProjectDoubleClicked += new ProjectTree.ProjectDoubleClickedHandler( _pt_ProjectDoubleClicked );
            _pt.RunDoubleClicked += new ProjectTree.RunDoubleClickedHandler( _pt_RunDoubleClicked );
            _pt.ExecutablesDropped +=new ProjectTree.ExecutablesDroppedHandler( _pt_ExecutableDropped );

            _dock = new Crownwood.Magic.Docking.DockingManager( this, Crownwood.Magic.Common.VisualStyle.IDE );
            _dock.OuterControl = commandBarManager1;
            _dock.InnerControl = _tcProfilers;
            Crownwood.Magic.Docking.Content c = _dock.Contents.Add( _pt, "Projects" );
            Crownwood.Magic.Docking.WindowContent wc = _dock.AddContentWithState( c, Crownwood.Magic.Docking.State.DockLeft );

            this.Text = "nprof Profiling Application - v" + Profiler.Version;
            _tcProfilers.Appearance = Crownwood.Magic.Controls.TabControl.VisualAppearance.MultiDocument;

            SerializationHandler.DataStoreDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\NProf\\" + Profiler.Version;

            _cmdFileRecentProjects.MenuCommands.Clear();

            int count = 1;
            foreach(UsedFile usedFile in SerializationHandler.ProjectsHistory)
            {
                if(count > 10)
                    break;

                string label = (count == 10 ? "1&0" : "&" + count.ToString()) + " " + usedFile.ProjectName;

                Crownwood.Magic.Menus.MenuCommand pInfo = new Crownwood.Magic.Menus.MenuCommand(label);
                pInfo.Tag = usedFile.FileName;
                pInfo.Click += new EventHandler(_cmdFileRecentlyUsed_Click);
                pInfo.Shortcut = Shortcut.CtrlShift1 + (count == 10 ? -1 : count - 1);
                _cmdFileRecentProjects.MenuCommands.Add(pInfo);

                ++count;
            }

            if( count == 1 )
                _cmdFileRecentProjects.Enabled = false;

            if ( _piInitialProject != null )
            {
                _pic.Add( _piInitialProject );
                _pt.SelectProject( _piInitialProject );
                _cmdProjectRun_Click( null, null );
            }
        }
Exemplo n.º 10
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.menuItem1 = new System.Windows.Forms.MenuItem();
     this._menuMain = new Crownwood.Magic.Menus.MenuControl();
     this._menuFile = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileNew = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileOpen = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileClose = new Crownwood.Magic.Menus.MenuCommand();
     this._sep1 = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileSave = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileSaveAs = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileSaveAll = new Crownwood.Magic.Menus.MenuCommand();
     this._sep2 = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileRecentProjects = new Crownwood.Magic.Menus.MenuCommand();
     this._sep3 = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdFileExit = new Crownwood.Magic.Menus.MenuCommand();
     this._menuEdit = new Crownwood.Magic.Menus.MenuCommand();
     this._menuProject = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdProjectRun = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdProjectStop = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdProjectOptions = new Crownwood.Magic.Menus.MenuCommand();
     this._sep4 = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdProjectRunViewMessages = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdProjectRunCopy = new Crownwood.Magic.Menus.MenuCommand();
     this._menuView = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdViewProjectView = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdViewNavBack = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdViewNavForward = new Crownwood.Magic.Menus.MenuCommand();
     this._menuHelp = new Crownwood.Magic.Menus.MenuCommand();
     this._cmdHelpAbout = new Crownwood.Magic.Menus.MenuCommand();
     this._tcProfilers = new Crownwood.Magic.Controls.TabControl();
     this._sbStatusBar = new System.Windows.Forms.StatusBar();
     this._sbpMessage = new System.Windows.Forms.StatusBarPanel();
     this.commandBarManager1 = new Reflector.UserInterface.CommandBarManager();
     this.commandBar1 = new Reflector.UserInterface.CommandBar();
     ((System.ComponentModel.ISupportInitialize)(this._sbpMessage)).BeginInit();
     this.SuspendLayout();
     //
     // menuItem1
     //
     this.menuItem1.Index = -1;
     this.menuItem1.Text = "Close Tab";
     //
     // _menuMain
     //
     this._menuMain.AnimateStyle = Crownwood.Magic.Menus.Animation.System;
     this._menuMain.AnimateTime = 100;
     this._menuMain.Cursor = System.Windows.Forms.Cursors.Arrow;
     this._menuMain.Direction = Crownwood.Magic.Common.Direction.Horizontal;
     this._menuMain.Dock = System.Windows.Forms.DockStyle.Top;
     this._menuMain.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((System.Byte)(0)));
     this._menuMain.HighlightTextColor = System.Drawing.SystemColors.MenuText;
     this._menuMain.Location = new System.Drawing.Point(0, 0);
     this._menuMain.MenuCommands.AddRange(new Crownwood.Magic.Menus.MenuCommand[] {
                                                                                      this._menuFile,
                                                                                      this._menuEdit,
                                                                                      this._menuProject,
                                                                                      this._menuView,
                                                                                      this._menuHelp});
     this._menuMain.Name = "_menuMain";
     this._menuMain.Size = new System.Drawing.Size(920, 25);
     this._menuMain.Style = Crownwood.Magic.Common.VisualStyle.IDE;
     this._menuMain.TabIndex = 0;
     this._menuMain.TabStop = false;
     this._menuMain.Text = "menuControl1";
     //
     // _menuFile
     //
     this._menuFile.Description = "File";
     this._menuFile.MenuCommands.AddRange(new Crownwood.Magic.Menus.MenuCommand[] {
                                                                                      this._cmdFileNew,
                                                                                      this._cmdFileOpen,
                                                                                      this._cmdFileClose,
                                                                                      this._sep1,
                                                                                      this._cmdFileSave,
                                                                                      this._cmdFileSaveAs,
                                                                                      this._cmdFileSaveAll,
                                                                                      this._sep2,
                                                                                      this._cmdFileRecentProjects,
                                                                                      this._sep3,
                                                                                      this._cmdFileExit});
     this._menuFile.Text = "&File";
     //
     // _cmdFileNew
     //
     this._cmdFileNew.Description = "New Profiler Project";
     this._cmdFileNew.Shortcut = System.Windows.Forms.Shortcut.CtrlN;
     this._cmdFileNew.Text = "&New...";
     this._cmdFileNew.Click += new System.EventHandler(this._cmdFileNew_Click);
     this._cmdFileNew.Update += new System.EventHandler(this.UpdateMenuItems);
     //
     // _cmdFileOpen
     //
     this._cmdFileOpen.Description = "Open a profile project";
     this._cmdFileOpen.Text = "&Open...";
     this._cmdFileOpen.Click += new System.EventHandler(this._cmdFileOpen_Click);
     //
     // _cmdFileClose
     //
     this._cmdFileClose.Description = "Close the project";
     this._cmdFileClose.Text = "&Close";
     this._cmdFileClose.Click += new System.EventHandler(this._cmdFileClose_Click);
     //
     // _sep1
     //
     this._sep1.Description = "MenuItem";
     this._sep1.Text = "-";
     //
     // _cmdFileSave
     //
     this._cmdFileSave.Description = "Save the active profiler project";
     this._cmdFileSave.Shortcut = System.Windows.Forms.Shortcut.CtrlS;
     this._cmdFileSave.Text = "&Save";
     this._cmdFileSave.Click += new System.EventHandler(this._cmdFileSave_Click);
     //
     // _cmdFileSaveAs
     //
     this._cmdFileSaveAs.Description = "Save the active profiler project as a specified file name";
     this._cmdFileSaveAs.Text = "Save &As...";
     this._cmdFileSaveAs.Click += new System.EventHandler(this._cmdFileSaveAs_Click);
     //
     // _cmdFileSaveAll
     //
     this._cmdFileSaveAll.Description = "Save all open profiler projects";
     this._cmdFileSaveAll.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftS;
     this._cmdFileSaveAll.Text = "Save A&ll";
     this._cmdFileSaveAll.Click += new System.EventHandler(this._cmdFileSaveAll_Click);
     //
     // _sep2
     //
     this._sep2.Description = "MenuItem";
     this._sep2.Text = "-";
     //
     // _cmdFileRecentProjects
     //
     this._cmdFileRecentProjects.Description = "Provides a list of the 10 most recently opened projects for easy access";
     this._cmdFileRecentProjects.Text = "Recent Projects";
     //
     // _sep3
     //
     this._sep3.Description = "-";
     this._sep3.Text = "-";
     //
     // _cmdFileExit
     //
     this._cmdFileExit.Description = "Exit the application";
     this._cmdFileExit.Shortcut = System.Windows.Forms.Shortcut.AltF4;
     this._cmdFileExit.Text = "E&xit";
     this._cmdFileExit.Click += new System.EventHandler(this._cmdFileExit_Click);
     //
     // _menuEdit
     //
     this._menuEdit.Description = "Edit";
     this._menuEdit.Enabled = false;
     this._menuEdit.Text = "&Edit";
     //
     // _menuProject
     //
     this._menuProject.Description = "Project commands";
     this._menuProject.MenuCommands.AddRange(new Crownwood.Magic.Menus.MenuCommand[] {
                                                                                         this._cmdProjectRun,
                                                                                         this._cmdProjectStop,
                                                                                         this._cmdProjectOptions,
                                                                                         this._sep4,
                                                                                         this._cmdProjectRunViewMessages,
                                                                                         this._cmdProjectRunCopy});
     this._menuProject.Text = "&Project";
     //
     // _cmdProjectRun
     //
     this._cmdProjectRun.Description = "Run the current project";
     this._cmdProjectRun.Shortcut = System.Windows.Forms.Shortcut.F5;
     this._cmdProjectRun.Text = "Start project run";
     this._cmdProjectRun.Click += new System.EventHandler(this._cmdProjectRun_Click);
     this._cmdProjectRun.Update += new System.EventHandler(this.UpdateMenuItems);
     //
     // _cmdProjectStop
     //
     this._cmdProjectStop.Description = "Stop the running project";
     this._cmdProjectStop.Text = "Stop project run";
     //
     // _cmdProjectOptions
     //
     this._cmdProjectOptions.Description = "Modify the options for this project";
     this._cmdProjectOptions.Shortcut = System.Windows.Forms.Shortcut.F2;
     this._cmdProjectOptions.Text = "Options...";
     this._cmdProjectOptions.Click += new System.EventHandler(this._cmdProjectOptions_Click);
     this._cmdProjectOptions.Update += new System.EventHandler(this.UpdateMenuItems);
     //
     // _sep4
     //
     this._sep4.Description = "-";
     this._sep4.Text = "-";
     //
     // _cmdProjectRunViewMessages
     //
     this._cmdProjectRunViewMessages.Description = "View the Messages from the current profiler run...";
     this._cmdProjectRunViewMessages.Text = "View Run Messages...";
     this._cmdProjectRunViewMessages.Click += new System.EventHandler(this._cmdProjectRunViewMessages_Click);
     //
     // _cmdProjectRunCopy
     //
     this._cmdProjectRunCopy.Description = "Copy the project run data to the clipboard";
     this._cmdProjectRunCopy.Text = "Copy Project Run Data";
     //
     // _menuView
     //
     this._menuView.Description = "View";
     this._menuView.MenuCommands.AddRange(new Crownwood.Magic.Menus.MenuCommand[] {
                                                                                      this._cmdViewProjectView,
                                                                                      this._cmdViewNavBack,
                                                                                      this._cmdViewNavForward});
     this._menuView.Text = "&View";
     //
     // _cmdViewProjectView
     //
     this._cmdViewProjectView.Description = "Show/hide the project tab";
     this._cmdViewProjectView.Text = "Project tab";
     this._cmdViewProjectView.Click += new System.EventHandler(this._cmdViewProjectView_Click);
     this._cmdViewProjectView.Update += new System.EventHandler(this._cmdViewProjectView_Update);
     //
     // _cmdViewNavBack
     //
     this._cmdViewNavBack.Description = "Navigate Back";
     this._cmdViewNavBack.Text = "Back";
     this._cmdViewNavBack.Click += new System.EventHandler(this._cmdViewNavBack_Click);
     //
     // _cmdViewNavForward
     //
     this._cmdViewNavForward.Description = "Navigate Forward";
     this._cmdViewNavForward.Text = "Forward";
     this._cmdViewNavForward.Click += new System.EventHandler(this._cmdViewNavForward_Click);
     //
     // _menuHelp
     //
     this._menuHelp.Description = "Help";
     this._menuHelp.MenuCommands.AddRange(new Crownwood.Magic.Menus.MenuCommand[] {
                                                                                      this._cmdHelpAbout});
     this._menuHelp.Text = "&Help";
     //
     // _cmdHelpAbout
     //
     this._cmdHelpAbout.Description = "About nprof";
     this._cmdHelpAbout.Text = "About nprof...";
     this._cmdHelpAbout.Click += new System.EventHandler(this._cmdHelpAbout_Click);
     //
     // _tcProfilers
     //
     this._tcProfilers.Dock = System.Windows.Forms.DockStyle.Fill;
     this._tcProfilers.IDEPixelArea = true;
     this._tcProfilers.Location = new System.Drawing.Point(0, 26);
     this._tcProfilers.Name = "_tcProfilers";
     this._tcProfilers.Size = new System.Drawing.Size(920, 629);
     this._tcProfilers.TabIndex = 2;
     this._tcProfilers.ClosePressed += new System.EventHandler(this._tcProfilers_ClosePressed);
     //
     // _sbStatusBar
     //
     this._sbStatusBar.Location = new System.Drawing.Point(0, 655);
     this._sbStatusBar.Name = "_sbStatusBar";
     this._sbStatusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
                                                                                     this._sbpMessage});
     this._sbStatusBar.ShowPanels = true;
     this._sbStatusBar.Size = new System.Drawing.Size(920, 22);
     this._sbStatusBar.TabIndex = 3;
     //
     // _sbpMessage
     //
     this._sbpMessage.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
     this._sbpMessage.Text = "Ready.";
     this._sbpMessage.Width = 904;
     //
     // commandBarManager1
     //
     this.commandBarManager1.Dock = System.Windows.Forms.DockStyle.Top;
     this.commandBarManager1.Location = new System.Drawing.Point(0, 25);
     this.commandBarManager1.Name = "commandBarManager1";
     this.commandBarManager1.Size = new System.Drawing.Size(920, 1);
     this.commandBarManager1.TabIndex = 3;
     this.commandBarManager1.TabStop = false;
     this.commandBarManager1.Text = "commandBarManager1";
     //
     // commandBar1
     //
     this.commandBar1.Dock = System.Windows.Forms.DockStyle.Top;
     this.commandBar1.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((System.Byte)(0)));
     this.commandBar1.Location = new System.Drawing.Point(0, 64);
     this.commandBar1.Name = "commandBar1";
     this.commandBar1.Size = new System.Drawing.Size(920, 64);
     this.commandBar1.Style = Reflector.UserInterface.CommandBarStyle.ToolBar;
     this.commandBar1.TabIndex = 4;
     this.commandBar1.TabStop = false;
     this.commandBar1.Text = "commandBar1";
     //
     // ProfilerForm
     //
     this.AllowDrop = true;
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(920, 677);
     this.Controls.Add(this._tcProfilers);
     this.Controls.Add(this.commandBarManager1);
     this.Controls.Add(this._menuMain);
     this.Controls.Add(this._sbStatusBar);
     this.Name = "ProfilerForm";
     this.Text = "nprof Profiling Application - Alpha v0.6";
     this.Closing += new System.ComponentModel.CancelEventHandler(this.ProfilerForm_Closing);
     this.Load += new System.EventHandler(this.ProfilerForm_Load);
     this.Layout += new System.Windows.Forms.LayoutEventHandler(this.ProfilerForm_Layout);
     ((System.ComponentModel.ISupportInitialize)(this._sbpMessage)).EndInit();
     this.ResumeLayout(false);
 }