private void ProfilerForm_Load(object sender, System.EventArgs e) { this.Icon = new Icon(this.GetType().Assembly.GetManifestResourceStream("NProf.GUI.Resources.app-icon.ico")); _pic = new ProjectInfoCollection(); _pt = new ProjectTree(); _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 = _menuMain; _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; if (_piInitialProject != null) { _pic.Add(_piInitialProject); _pt.SelectProject(_piInitialProject); _cmdProjectRun_Click(null, null); } }
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); } }
private void ProfilerForm_Load(object sender, System.EventArgs e) { this.Icon = new Icon( this.GetType().Assembly.GetManifestResourceStream( "NProf.GUI.Resources.app-icon.ico" ) ); _pic = new ProjectInfoCollection(); _pt = new ProjectTree(); _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 = _menuMain; _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; if ( _piInitialProject != null ) { _pic.Add( _piInitialProject ); _pt.SelectProject( _piInitialProject ); _cmdProjectRun_Click( null, null ); } }
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 ); } }