public ImageMenu() { this.Text = "메뉴 선택 표시와 이미지 넣기"; // 이미지 개체 준비 Bitmap bmp1 = new Bitmap(GetType(), "ImageMenu.image_1.bmp"); Bitmap bmp2 = new Bitmap(GetType(), "ImageMenu.image_2.bmp"); MenuStrip menu = new MenuStrip(); menu.Parent = this; // File 항목 ToolStripMenuItem file_item = new ToolStripMenuItem(); file_item.Text = "&File"; file_item.Image = bmp1; // 메뉴에 출력할 이미지 지정 menu.Items.Add(file_item); select_item = new ToolStripMenuItem(); select_item.Text = "&Select"; select_item.Click += EventProc; file_item.DropDownItems.Add(select_item); // 메뉴 구분선 넣기 ToolStripSeparator file_item_sep = new ToolStripSeparator(); file_item.DropDownItems.Add(file_item_sep); ToolStripMenuItem close_item = new ToolStripMenuItem(); close_item.Text = "&Close"; close_item.Image = bmp2; close_item.ShortcutKeys = Keys.Alt | Keys.F4; close_item.Click += EventProc; file_item.DropDownItems.Add(close_item); }
public ContextMenuStripExam() { this.Text = "ContextMenuStrip 예제"; Bitmap bmp1 = new Bitmap(GetType(), "ContextMenuStripExam.image_1.bmp"); Bitmap bmp2 = new Bitmap(GetType(), "ContextMenuStripExam.image_2.bmp"); // 2) 마우스 이벤트 추가 this.MouseClick += new MouseEventHandler(ImageMenu_MouseClick); // 1) 개체 생성 contextmenu = new ContextMenuStrip(); // File 항목 ToolStripMenuItem file_item = new ToolStripMenuItem(); file_item.Text = "&File"; file_item.Image = bmp1; contextmenu.Items.Add(file_item);// 컨텍스트 메뉴에 아이템 추가 select_item = new ToolStripMenuItem(); select_item.Text = "&Select"; select_item.Click += EventProc; file_item.DropDownItems.Add(select_item); // 메뉴 구분선 넣기 ToolStripSeparator file_item_sep = new ToolStripSeparator(); file_item.DropDownItems.Add(file_item_sep); ToolStripMenuItem close_item = new ToolStripMenuItem(); close_item.Text = "&Close"; close_item.Image = bmp2; close_item.ShortcutKeys = Keys.Alt | Keys.F4; close_item.Click += EventProc; file_item.DropDownItems.Add(close_item); }
public MainForm () { // // _menuStrip // _menuStrip = new MenuStrip (); Controls.Add (_menuStrip); // // _fileMenu // _fileMenu = new ToolStripMenuItem (); _fileMenu.Text = "File"; _menuStrip.Items.Add (_fileMenu); // // _closeItem // _closeItem = new ToolStripMenuItem (); _closeItem.Text = "Close"; _fileMenu.DropDownItems.Add (_closeItem); // // MainForm // MainMenuStrip = _menuStrip; Load += new EventHandler (MainForm_Load); }
public ShapeDrawingForm() { MenuStrip menuStrip; menuStrip = new MenuStrip(); ToolStripDropDownItem menu; menu = new ToolStripMenuItem("File"); menu.DropDownItems.Add("Open...", null, this.openFileHandler); menu.DropDownItems.Add("Export...", null, this.exportHandler); menu.DropDownItems.Add("Exit", null, this.closeHandler); menuStrip.Items.Add(menu); this.Controls.Add(menuStrip); // Some basic settings Text = "Shape Drawing and Converter"; Size = new Size(400, 400); CenterToScreen(); SetStyle(ControlStyles.ResizeRedraw, true); // Initialize shapes shapes = new List<Shape>(); // Listen to Paint event to draw shapes this.Paint += new PaintEventHandler(this.OnPaint); }
public MainForm () { _menuStrip = new MenuStrip (); _fileToolStripMenuItem = new ToolStripMenuItem (); _openToolStripMenuItem = new ToolStripMenuItem (); _userToolStripMenuItem = new ToolStripMenuItem (); _loginToolStripMenuItem = new ToolStripMenuItem (); _menuStrip.Items.AddRange (new ToolStripItem [] { _fileToolStripMenuItem, _userToolStripMenuItem}); _menuStrip.TabIndex = 0; _fileToolStripMenuItem.DropDownItems.AddRange (new ToolStripItem [] { _openToolStripMenuItem}); _fileToolStripMenuItem.Text = "File"; _openToolStripMenuItem.Text = "Open"; _userToolStripMenuItem.DropDownItems.AddRange (new ToolStripItem [] { _loginToolStripMenuItem }); _userToolStripMenuItem.Text = "&User"; _loginToolStripMenuItem.Text = "Login"; Controls.Add (_menuStrip); MainMenuStrip = _menuStrip; _menuStrip.PerformLayout (); // // MainForm // Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #343972"; Load += new EventHandler (MainForm_Load); PerformLayout (); }
public MForm3() { Text = "MenuStrip"; Size = new Size(250, 200); MenuStrip menuStrip = new MenuStrip(); ToolStripMenuItem titem1 = new ToolStripMenuItem("File"); menuStrip.Items.Add(titem1); ToolStripMenuItem titem2 = new ToolStripMenuItem("Tools"); menuStrip.Items.Add(titem2); ToolStripMenuItem subm1 = new ToolStripMenuItem("New"); subm1.Image = Image.FromFile("new.png"); titem1.DropDownItems.Add(subm1); ToolStripMenuItem subm2 = new ToolStripMenuItem("Open"); subm2.Image = Image.FromFile("open.png"); titem1.DropDownItems.Add(subm2); titem1.DropDownItems.Add(new ToolStripSeparator()); ToolStripMenuItem subm3 = new ToolStripMenuItem("Exit"); subm3.Image = Image.FromFile("exit.png"); titem1.DropDownItems.Add(subm3); subm3.Click += OnExit; Controls.Add(menuStrip); MainMenuStrip = menuStrip; CenterToScreen(); }
public MenuClickExam() { this.Text = "MenuStrip 예제"; MenuStrip menu = new MenuStrip(); menu.Parent = this; // File 항목 ToolStripMenuItem file_item = new ToolStripMenuItem(); file_item.Text = "&File"; menu.Items.Add(file_item); ToolStripMenuItem file_open_item = new ToolStripMenuItem(); file_open_item.Text = "&Open..."; file_open_item.ShortcutKeys = Keys.Control | Keys.O; file_open_item.Click += FileOpenDlg; file_item.DropDownItems.Add(file_open_item); // 메뉴 구분선 넣기 ToolStripSeparator file_item_sep = new ToolStripSeparator(); file_item.DropDownItems.Add(file_item_sep); ToolStripMenuItem file_close_item = new ToolStripMenuItem(); file_close_item.Text = "&Close"; file_close_item.ShortcutKeys = Keys.Alt | Keys.F4; file_close_item.Click += CloseProgram; file_item.DropDownItems.Add(file_close_item); }
public override bool Loaded() { /* Register with Device Change event */ Host.DeviceChanged += deviceChanged; /* Add to Flight Planner Map Menu */ ToolStripMenuItem trkrHome = new ToolStripMenuItem("Tracker Home"); trkrHome.Name = "trkrHomeMenuItem"; ToolStripMenuItem obtainFrmMod = new ToolStripMenuItem("Obtain From Module"); obtainFrmMod.Click += setTrackerHomeFromModule; ToolStripMenuItem setAtLoc = new ToolStripMenuItem("Set Here"); setAtLoc.Click += setFromPlannerLocation; trkrHome.DropDownItems.AddRange( new ToolStripItem[] { obtainFrmMod, setAtLoc } ); ToolStripItemCollection col = Host.FPMenuMap.Items; int index = col.Count; foreach (ToolStripItem item in col) { if (item.Text.Equals("Tracker Home")) { index = col.IndexOf(item); col.Remove(item); break; } } if (index != col.Count) col.Insert(index, trkrHome); else col.Add(trkrHome); if (getDevice() != null) _Available = true; return true; }
// Initialisation: protected internal override void Initialise() { OurMenuItem = new ToolStripMenuItem("Albums Plugin"); InitialiseBase(); // must set menu item object first OurTab.UseVisualStyleBackColor = true; OurTab.Controls.Add(OurSettingsControl); }
public ToolStripMenuItem CreateMenuItem(string label, string imageName) { ToolStripMenuItem item = new ToolStripMenuItem(); item.Image = Image.FromFile(pathImages + "\\" + imageName); item.Name = imageName; item.Text = label; item.Click += OnMenuItemClick; return item; }
public MainForm () { // // _eventsText // _eventsText = new TextBox (); _eventsText.Dock = DockStyle.Top; _eventsText.Height = 150; _eventsText.Multiline = true; _eventsText.ScrollBars = ScrollBars.Vertical; Controls.Add (_eventsText); // // _toolStrip // _toolStrip = new ToolStrip (); _toolStrip.Dock = DockStyle.Top; _toolStrip.Click += new EventHandler (ToolStrip_Click); _toolStrip.ItemClicked += ToolStrip_ItemClicked; Controls.Add (_toolStrip); // // _fileMenuItem // _fileMenuItem = new ToolStripMenuItem (); _fileMenuItem.Text = "&File"; _fileMenuItem.Click += FileMenuItem_Click; _toolStrip.Items.Add (_fileMenuItem); // // _newFileMenuItem // _newFileMenuItem = new ToolStripMenuItem (); _newFileMenuItem.Text = "&New"; _newFileMenuItem.Click += NewFileMenuItem_Click; _fileMenuItem.DropDownItems.Add (_newFileMenuItem); // // _editMenuItem // _editMenuItem = new ToolStripMenuItem (); _editMenuItem.Text = "&Edit"; _editMenuItem.Click += EditMenuItem_Click; _toolStrip.Items.Add (_editMenuItem); // // _clearButton // _clearButton = new Button (); _clearButton.Location = new Point (110, 185); _clearButton.Text = "Clear"; _clearButton.Click += ClearButton_Click; Controls.Add (_clearButton); // // MainForm // ClientSize = new Size (300, 220); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #82775"; Load += new EventHandler (MainForm_Load); }
public MainWindow() : base() { Size = new System.Drawing.Size(300, 300); //размер формы FormBorderStyle = FormBorderStyle.FixedSingle; MaximizeBox = false; smMain = new MenuStrip(); //новая менюшка smiFile = new ToolStripMenuItem(); //элементы менюшки smiEdit = new ToolStripMenuItem(); smiHelp = new ToolStripMenuItem(); smiAbout = new ToolStripMenuItem(); smiCopy = new ToolStripMenuItem(); smiPaste = new ToolStripMenuItem(); smiOpen = new ToolStripMenuItem(); smiExit = new ToolStripMenuItem(); smMain.SuspendLayout(); //заморозить раскладку формы SuspendLayout(); //заморозить раскладку меню smMain.Location = new Point(0, 0); smMain.Name = "smMain"; smMain.Text = "Главное меню"; smiFile.Name = "smiFile"; smiFile.Text = "Файл"; smiEdit.Name = "smiEdit"; smiEdit.Text = "Правка"; smiHelp.Name = "smiHelp"; smiHelp.Text = "Справка"; smiAbout.Name = "smiAbout"; smiAbout.Text = "О программе"; smiCopy.Name = "smiCopy"; smiCopy.Text = "Копировать"; smiPaste.Name = "smiPaste"; smiPaste.Text = "Вставить"; smiOpen.Name = "smiOpen"; smiOpen.Text = "Открыть"; smiExit.Name = "smiExit"; smiExit.Text = "Выход"; smMain.Items.AddRange( new ToolStripItem[] { smiFile, smiEdit, smiHelp } ); smiFile.DropDownItems.AddRange( new ToolStripItem[] { smiOpen, smiExit } ); smiEdit.DropDownItems.AddRange( new ToolStripItem[] { smiCopy, smiPaste } ); smiHelp.DropDownItems.AddRange( new ToolStripItem[] { smiAbout } ); smiAbout.Click += new EventHandler(smMain_Click); //добавляем обработчики событий smiCopy.Click += new EventHandler(smMain_Click); smiPaste.Click += new EventHandler(smMain_Click); smiOpen.Click += new EventHandler(smMain_Click); smiExit.Click += new EventHandler(smMain_Click); Controls.Add(this.smMain); //добавить контрол на форму MainMenuStrip = this.smMain; //задействовать менюшку как основную ResumeLayout(false); //разморозить раскладку формы smMain.ResumeLayout(false); //разморозить раскладку меню smMain.PerformLayout(); //произвести раскладку меню PerformLayout(); //произвести раскладку формы }
public ResultForm(object datasource) { MenuStrip ms = new MenuStrip(); ToolStripMenuItem file = new ToolStripMenuItem("&File"); ToolStripMenuItem exit = new ToolStripMenuItem( "E&xit", null, new EventHandler(OnExit)); DataGridView dgv = new DataGridView(); file.DropDownItems.Add(exit); ms.Parent = this; ms.Items.Add(file); MainMenuStrip = ms; dgv.Parent = this; dgv.Dock = DockStyle.Fill; dgv.DataSource = datasource; }
public static void AttachPlugins() { HabProperties hps; if (Current.plugins.TryGetValue("Extra", out hps)) { foreach (KeyValuePair<string, object> kvp in hps) { if (!(kvp.Value is IDotaHITPlugin1)) continue; ToolStripMenuItem tsmi = new ToolStripMenuItem(); tsmi.Name = kvp.Key; tsmi.Text = kvp.Key; tsmi.Tag = kvp.Value; tsmi.Click += (kvp.Value as IDotaHITPlugin1).Click; Current.mainForm.extrasToolStripMenuItem.DropDownItems.Add(tsmi); } } }
public MainForm () { // // _showImageMarginCheckBox // _showImageMarginCheckBox = new CheckBox (); _showImageMarginCheckBox.Checked = true; _showImageMarginCheckBox.Location = new Point (8, 80); _showImageMarginCheckBox.Size = new Size (130, 20); _showImageMarginCheckBox.Text = "ShowImageMargin"; _showImageMarginCheckBox.CheckedChanged += new EventHandler (ShowImageMarginCheckBox_CheckedChanged); Controls.Add (_showImageMarginCheckBox); // // _menu // _menu = new ContextMenuStrip (); _menu.Dock = DockStyle.Top; _menu.Size = new Size (170, 70); // // _label // _label = new ToolStripLabel (); _label.Text = "Mono"; _menu.Items.Add (_label); // // _menuItem // _menuItem = new ToolStripMenuItem (); _menuItem.Size = new Size (169, 22); _menuItem.Text = "Insert date..."; _menu.Items.Add (_menuItem); // // MainForm // ClientSize = new Size (285, 105); ContextMenuStrip = _menu; Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #81903"; Load += new EventHandler (MainForm_Load); }
public MultiMenuSelect() { this.Text = "메뉴 이벤트 처리하기"; MenuStrip menu = new MenuStrip(); menu.Parent = this; // Color 항목 ToolStripMenuItem color_item = new ToolStripMenuItem(); color_item.Text = "&Color"; menu.Items.Add(color_item); for (int i = 0; i < color.Length; i++) { color[i] = new ToolStripMenuItem(); color[i].Text = "&" + color_txt[i]; color[i].ForeColor = color_data[i]; color[i].Click += new EventHandler(MultiMenuSelect_Click); color_item.DropDownItems.Add(color[i]); } }
public MainForm () { // // _components // _components = new System.ComponentModel.Container (); // // _menu // _menu = new ContextMenuStrip (_components); _menu.Dock = DockStyle.Top; _menu.Size = new Size (170, 70); // // _menuItem // _menuItem = new ToolStripMenuItem (); _menuItem.Size = new Size (169, 22); _menuItem.Text = "Insert date..."; _menu.Items.Add (_menuItem); // // _dateTimePicker // _dateTimePicker = new DateTimePicker (); _dateTimePicker.Value = DateTime.Now; _dateTimePicker.Format = DateTimePickerFormat.Custom; _dateTimePicker.CustomFormat = "yyyy-MM-dd"; _menuItem.DropDownItems.Add (new ToolStripControlHost (_dateTimePicker)); // // MainForm // ClientSize = new Size (285, 105); ContextMenuStrip = _menu; Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #81508"; Load += new EventHandler (MainForm_Load); }
public MForm() { Text = "Submenu"; MenuStrip ms = new MenuStrip(); ms.Parent = this; ToolStripMenuItem file = new ToolStripMenuItem("&File"); ToolStripMenuItem exit = new ToolStripMenuItem("&Exit", null, new EventHandler(OnExit)); ToolStripMenuItem import = new ToolStripMenuItem(); import.Text = "Import"; file.DropDownItems.Add(import); ToolStripMenuItem temp = new ToolStripMenuItem(); temp.Text = "Import newsfeed list..."; import.DropDownItems.Add(temp); temp = new ToolStripMenuItem(); temp.Text = "Import bookmarks..."; import.DropDownItems.Add(temp); temp = new ToolStripMenuItem(); temp.Text = "Import mail..."; import.DropDownItems.Add(temp); file.DropDownItems.Add(exit); ms.Items.Add(file); MainMenuStrip = ms; Size = new Size(380, 200); CenterToScreen(); }
public MenuExam() { this.Text = "MenuStrip 예제"; MenuStrip menu = new MenuStrip(); menu.Parent = this; // Form에 MenuStrip을 지정 // File 항목 생성 및 화면 출력 ToolStripMenuItem file_item = new ToolStripMenuItem(); file_item.Text = "&File"; menu.Items.Add(file_item); ToolStripMenuItem file_open_item = new ToolStripMenuItem(); file_open_item.Text = "&Open"; file_item.DropDownItems.Add(file_open_item); // 메뉴 구분선 넣기 ToolStripSeparator file_item_sep = new ToolStripSeparator(); file_item.DropDownItems.Add(file_item_sep); ToolStripMenuItem file_close_item = new ToolStripMenuItem(); file_close_item.Text = "&Close"; file_item.DropDownItems.Add(file_close_item); // Edit 항목 ToolStripMenuItem edit_item = new ToolStripMenuItem(); edit_item.Text = "&Edit"; menu.Items.Add(edit_item); ToolStripMenuItem edit_1_item = new ToolStripMenuItem(); edit_1_item.Text = "&&Copy"; // & 를 화면에 출력 edit_item.DropDownItems.Add(edit_1_item); ToolStripMenuItem edit_2_item = new ToolStripMenuItem(); edit_2_item.Text = "Pa&st"; // s 에 밑줄 넣기 edit_1_item.DropDownItems.Add(edit_2_item); }
/// <summary> /// 当前激活窗口的快捷键执行方式 /// </summary> private void initShortKey() { ///一个隐藏的右键菜单 ContextMenuStrip menu = new ContextMenuStrip(); this.ContextMenuStrip = menu; ///添加Ctrl+C ToolStripMenuItem copyItem = new ToolStripMenuItem(); copyItem.ShortcutKeys = Keys.Control | Keys.C; copyItem.Visible = false; menu.Items.Add(copyItem); ///添加Ctrl+X ToolStripMenuItem cutItem = new ToolStripMenuItem(); cutItem.ShortcutKeys = Keys.Control | Keys.X; cutItem.Visible = false; menu.Items.Add(cutItem); ///添加Ctrl+V ToolStripMenuItem pasteItem = new ToolStripMenuItem(); pasteItem.ShortcutKeys = Keys.Control | Keys.V; pasteItem.Visible = false; menu.Items.Add(pasteItem); ///添加Ctrl+A ToolStripMenuItem allItem = new ToolStripMenuItem(); allItem.ShortcutKeys = Keys.Control | Keys.A; allItem.Visible = false; menu.Items.Add(allItem); ///添加Delete ToolStripMenuItem delItem = new ToolStripMenuItem(); delItem.ShortcutKeys = Keys.Delete; delItem.Visible = false; menu.Items.Add(delItem); ///撤销 ToolStripMenuItem undoItem = new ToolStripMenuItem(); undoItem.ShortcutKeys = Keys.Control | Keys.Z; undoItem.Visible = false; menu.Items.Add(undoItem); ///恢复 ToolStripMenuItem redoItem = new ToolStripMenuItem(); redoItem.ShortcutKeys = Keys.Control | Keys.Y; redoItem.Visible = false; menu.Items.Add(redoItem); ///添加所有事件 delItem.Click += new System.EventHandler(delItem_Click); copyItem.Click += new System.EventHandler(copyItem_Click); cutItem.Click += new System.EventHandler(cutItem_Click); pasteItem.Click += new System.EventHandler(pasteItem_Click); allItem.Click += new System.EventHandler(allItem_Click); undoItem.Click += new System.EventHandler(undoItem_Click); redoItem.Click += new System.EventHandler(redoItem_Click); }
private void OnContextMenu(object sender, MouseEventArgs e) { if ((_ribbonGroup?.Ribbon != null) && _ribbonGroup.RibbonTab.Groups.Contains(_ribbonGroup)) { // Create the menu strip the first time around if (_cms == null) { _cms = new ContextMenuStrip(); _toggleHelpersMenu = new ToolStripMenuItem("Design Helpers", null, OnToggleHelpers); _visibleMenu = new ToolStripMenuItem("Visible", null, OnVisible); _collapsableMenu = new ToolStripMenuItem("Allow Collapsed", null, OnCollapsable); _dialogLauncherMenu = new ToolStripMenuItem("Dialog Launcher", null, OnDialogLauncher); _moveFirstMenu = new ToolStripMenuItem("Move Group First", Properties.Resources.MoveFirst, OnMoveFirst); _movePreviousMenu = new ToolStripMenuItem("Move Group Previous", Properties.Resources.MovePrevious, OnMovePrevious); _moveNextMenu = new ToolStripMenuItem("Move Group Next", Properties.Resources.MoveNext, OnMoveNext); _moveLastMenu = new ToolStripMenuItem("Move Group Last", Properties.Resources.MoveLast, OnMoveLast); _moveToTabMenu = new ToolStripMenuItem("Move Group To Tab"); _addTripleMenu = new ToolStripMenuItem("Add Triple", Properties.Resources.KryptonRibbonGroupTriple, OnAddTriple); _addLinesMenu = new ToolStripMenuItem("Add Lines", Properties.Resources.KryptonRibbonGroupLines, OnAddLines); _addSeparatorMenu = new ToolStripMenuItem("Add Separator", Properties.Resources.KryptonRibbonGroupSeparator, OnAddSep); _addGalleryMenu = new ToolStripMenuItem("Add Gallery", Properties.Resources.KryptonGallery, OnAddGallery); _clearItemsMenu = new ToolStripMenuItem("Clear Items", null, OnClearItems); _deleteGroupMenu = new ToolStripMenuItem("Delete Group", Properties.Resources.delete2, OnDeleteGroup); _cms.Items.AddRange(new ToolStripItem[] { _toggleHelpersMenu, new ToolStripSeparator(), _visibleMenu, _collapsableMenu, _dialogLauncherMenu, new ToolStripSeparator(), _moveFirstMenu, _movePreviousMenu, _moveNextMenu, _moveLastMenu, new ToolStripSeparator(), _moveToTabMenu, new ToolStripSeparator(), _addTripleMenu, _addLinesMenu, _addSeparatorMenu, _addGalleryMenu, new ToolStripSeparator(), _clearItemsMenu, new ToolStripSeparator(), _deleteGroupMenu }); _addTripleMenu.ImageTransparentColor = Color.Magenta; _addLinesMenu.ImageTransparentColor = Color.Magenta; _addSeparatorMenu.ImageTransparentColor = Color.Magenta; _addGalleryMenu.ImageTransparentColor = Color.Magenta; } // Update verbs to work out correct enable states UpdateVerbStatus(); // Update sub menu options available for the 'Move To Tab' UpdateMoveToTab(); // Update menu items state from versb _toggleHelpersMenu.Checked = _ribbonGroup.Ribbon.InDesignHelperMode; _visibleMenu.Checked = _ribbonGroup.Visible; _collapsableMenu.Checked = _ribbonGroup.AllowCollapsed; _dialogLauncherMenu.Checked = _ribbonGroup.DialogBoxLauncher; _moveFirstMenu.Enabled = _moveFirstVerb.Enabled; _movePreviousMenu.Enabled = _movePrevVerb.Enabled; _moveNextMenu.Enabled = _moveNextVerb.Enabled; _moveLastMenu.Enabled = _moveLastVerb.Enabled; _moveToTabMenu.Enabled = (_moveToTabMenu.DropDownItems.Count > 0); _clearItemsMenu.Enabled = _clearItemsVerb.Enabled; // Show the context menu if (CommonHelper.ValidContextMenuStrip(_cms)) { Point screenPt = _ribbonGroup.Ribbon.ViewRectangleToPoint(_ribbonGroup.GroupView); VisualPopupManager.Singleton.ShowContextMenuStrip(_cms, screenPt); } } }
private void setupMenu() { MenuStrip ms = new MenuStrip(); ms.Dock = DockStyle.Top; // File menu ToolStripMenuItem fileMenu = new ToolStripMenuItem("&File"); ms.Items.Add(fileMenu); ToolStripMenuItem openItem = new ToolStripMenuItem("&Open...", null, new EventHandler(Menu_Open), Keys.Control | Keys.O); ToolStripMenuItem exitItem = new ToolStripMenuItem("E&xit", null, new EventHandler(Menu_Exit)); fileMenu.DropDownItems.Add(openItem); fileMenu.DropDownItems.Add(exitItem); // Convert menu ToolStripMenuItem convertMenu = new ToolStripMenuItem("&Convert"); ms.Items.Add(convertMenu); goItem = new ToolStripMenuItem("&Go", null, new EventHandler(Menu_Go)); goItem.Enabled = false; convertMenu.DropDownItems.Add(goItem); // Add menu to form this.Controls.Add(ms); }
private void InitializeComponent() { this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openDirectoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.label1 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.textBox2 = new System.Windows.Forms.TextBox(); this.button1 = new System.Windows.Forms.Button(); this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(284, 24); this.menuStrip1.TabIndex = 0; this.menuStrip1.Text = "menuStrip1"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.openDirectoryToolStripMenuItem, this.closeToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "File"; // // openDirectoryToolStripMenuItem // this.openDirectoryToolStripMenuItem.Name = "openDirectoryToolStripMenuItem"; this.openDirectoryToolStripMenuItem.Size = new System.Drawing.Size(216, 22); this.openDirectoryToolStripMenuItem.Text = "Open Downloads Directory"; this.openDirectoryToolStripMenuItem.Click += new System.EventHandler(this.openDirectoryToolStripMenuItem_Click); // // closeToolStripMenuItem // this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; this.closeToolStripMenuItem.Size = new System.Drawing.Size(216, 22); this.closeToolStripMenuItem.Text = "Close"; this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Comic Sans MS", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(21, 70); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(80, 23); this.label1.TabIndex = 1; this.label1.Text = "Username"; // // textBox1 // this.textBox1.Location = new System.Drawing.Point(137, 71); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(100, 20); this.textBox1.TabIndex = 2; // // label2 // this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Comic Sans MS", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label2.Location = new System.Drawing.Point(21, 112); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(76, 23); this.label2.TabIndex = 3; this.label2.Text = "Password"; // // textBox2 // this.textBox2.Location = new System.Drawing.Point(137, 112); this.textBox2.Name = "textBox2"; this.textBox2.PasswordChar = '*'; this.textBox2.Size = new System.Drawing.Size(100, 20); this.textBox2.TabIndex = 4; this.textBox2.UseSystemPasswordChar = true; // // button1 // this.button1.Location = new System.Drawing.Point(95, 167); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(84, 27); this.button1.TabIndex = 5; this.button1.Text = "Download"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // backgroundWorker1 // this.backgroundWorker1.WorkerReportsProgress = true; this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork); this.backgroundWorker1.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged); this.backgroundWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted); // // progressBar1 // this.progressBar1.Location = new System.Drawing.Point(0, 245); this.progressBar1.Name = "progressBar1"; this.progressBar1.Size = new System.Drawing.Size(284, 17); this.progressBar1.TabIndex = 6; // // MainForm // this.ClientSize = new System.Drawing.Size(284, 262); this.Controls.Add(this.progressBar1); this.Controls.Add(this.button1); this.Controls.Add(this.textBox2); this.Controls.Add(this.label2); this.Controls.Add(this.textBox1); this.Controls.Add(this.label1); this.Controls.Add(this.menuStrip1); this.MainMenuStrip = this.menuStrip1; this.Name = "MainForm"; this.Text = "Mapled "; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MainForm_KeyDown); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
/// <summary> /// Populates 'add to' playlist menu. /// </summary> private void PopulatePlaylistMenu() { librarycontextaddtoplaylist.DropDownItems.Clear(); foreach (var playlist in _playlistManager.GetPlaylists()) { var menuItem = new ToolStripMenuItem(playlist.Name) {Tag = playlist}; menuItem.Click += (s, e) => { var playlistItem = ((ToolStripMenuItem) s).Tag as TablaturePlaylist; if (playlistItem != null) { var libraryItem = GetSelectedLibraryItem(); playlistItem.Add(new TablaturePlaylistItem(libraryItem.File, libraryItem.FileInfo)); _playlistManager.Update(playlistItem); } }; librarycontextaddtoplaylist.DropDownItems.Add(menuItem); } if (librarycontextaddtoplaylist.DropDownItems.Count > 0) librarycontextaddtoplaylist.DropDownItems.Add(new ToolStripSeparator()); librarycontextaddtoplaylist.DropDownItems.Add(newPlaylistToolStripMenuItem); }
private void InitializeComponent() { this.icontainer_0 = new Container(); this.textEditorControl1 = new TextEditorControl(); this.contextMenuStrip1 = new ContextMenuStrip(this.icontainer_0); this.menuUndo = new ToolStripMenuItem(); this.menuRedo = new ToolStripMenuItem(); this.toolStripMenuItem1 = new ToolStripSeparator(); this.menuCut = new ToolStripMenuItem(); this.menuCopy = new ToolStripMenuItem(); this.menuPaste = new ToolStripMenuItem(); this.menuDelete = new ToolStripMenuItem(); this.toolStripMenuItem2 = new ToolStripSeparator(); this.menuSelectAll = new ToolStripMenuItem(); this.toolStripMenuItem3 = new ToolStripSeparator(); this.menuFind = new ToolStripMenuItem(); this.menuCopyAll = new ToolStripMenuItem(); this.contextMenuStrip1.SuspendLayout(); base.SuspendLayout(); this.textEditorControl1.BorderStyle = BorderStyle.Fixed3D; this.textEditorControl1.ContextMenuStrip = this.contextMenuStrip1; this.textEditorControl1.Dock = DockStyle.Fill; this.textEditorControl1.IsReadOnly = false; this.textEditorControl1.Location = new Point(0, 0); this.textEditorControl1.Name = "textEditorControl1"; this.textEditorControl1.ShowLineNumbers = false; this.textEditorControl1.ShowVRuler = false; this.textEditorControl1.Size = new Size(0x199, 0xd9); this.textEditorControl1.TabIndex = 0; this.contextMenuStrip1.Items.AddRange(new ToolStripItem[] { this.menuUndo, this.menuRedo, this.toolStripMenuItem1, this.menuCut, this.menuCopy, this.menuPaste, this.menuDelete, this.toolStripMenuItem2, this.menuSelectAll, this.menuCopyAll, this.toolStripMenuItem3, this.menuFind }); this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Size = new Size(0xc3, 0xf2); this.contextMenuStrip1.Opening += new CancelEventHandler(this.contextMenuStrip1_Opening); this.menuUndo.Name = "menuUndo"; this.menuUndo.Size = new Size(0xc2, 0x16); this.menuUndo.Text = "撤消"; this.menuUndo.Click += new EventHandler(this.menuUndo_Click); this.menuRedo.Name = "menuRedo"; this.menuRedo.Size = new Size(0xc2, 0x16); this.menuRedo.Text = "重做"; this.menuRedo.Click += new EventHandler(this.menuRedo_Click); this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Size = new Size(0xbf, 6); this.menuCut.Name = "menuCut"; this.menuCut.Size = new Size(0xc2, 0x16); this.menuCut.Text = "剪切"; this.menuCut.Click += new EventHandler(this.menuCut_Click); this.menuCopy.Name = "menuCopy"; this.menuCopy.Size = new Size(0xc2, 0x16); this.menuCopy.Text = "复制"; this.menuCopy.Click += new EventHandler(this.menuCopy_Click); this.menuPaste.Name = "menuPaste"; this.menuPaste.Size = new Size(0xc2, 0x16); this.menuPaste.Text = "粘贴"; this.menuPaste.Click += new EventHandler(this.menuPaste_Click); this.menuDelete.Name = "menuDelete"; this.menuDelete.Size = new Size(0xc2, 0x16); this.menuDelete.Text = "删除"; this.menuDelete.Click += new EventHandler(this.menuDelete_Click); this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Size = new Size(0xbf, 6); this.menuSelectAll.Name = "menuSelectAll"; this.menuSelectAll.Size = new Size(0xc2, 0x16); this.menuSelectAll.Text = "全选"; this.menuSelectAll.Click += new EventHandler(this.menuSelectAll_Click); this.toolStripMenuItem3.Name = "toolStripMenuItem3"; this.toolStripMenuItem3.Size = new Size(0xbf, 6); this.menuFind.Name = "menuFind"; this.menuFind.Size = new Size(0xc2, 0x16); this.menuFind.Text = "查找 ..."; this.menuFind.Click += new EventHandler(this.menuFind_Click); this.menuCopyAll.Name = "menuCopyAll"; this.menuCopyAll.Size = new Size(0xc2, 0x16); this.menuCopyAll.Text = "复制全部文本到剪切板"; this.menuCopyAll.Click += new EventHandler(this.menuCopyAll_Click); base.AutoScaleDimensions = new SizeF(6f, 12f); base.AutoScaleMode = AutoScaleMode.Font; base.Controls.Add(this.textEditorControl1); base.Name = "SyntaxHighlighterControl"; base.Size = new Size(0x199, 0xd9); this.contextMenuStrip1.ResumeLayout(false); base.ResumeLayout(false); }
public PluginToolStripMenuItem(ToolStripMenuItem i) { item = i; }
void elementTreeView_MouseUp(object sender, MouseEventArgs e) { if (e.Clicks == 1 && e.Button == MouseButtons.Right) { // Select the clicked node var newNode = elementTreeView.GetNodeAt(e.X, e.Y); if (newNode != elementTreeView.SelectedNode) elementTreeView.SelectedNode = newNode; ContextMenuStrip menu = new ContextMenuStrip(); if (elementTreeView.SelectedNode != null && elementTreeView.SelectedNode.Tag is MetaColumn) { MetaColumn column = elementTreeView.SelectedNode.Tag as MetaColumn; ToolStripMenuItem item = new ToolStripMenuItem("Select"); item.Click += new EventHandler(delegate (object sender2, EventArgs e2) { addElement(false); }); if (!Model.IsSubModel) menu.Items.Add(item); item = new ToolStripMenuItem("Prompt at run-time"); item.Click += new EventHandler(delegate (object sender2, EventArgs e2) { if (column.IsAggregate == true) aggregateRestrictionsPanel.AddRestriction(column, true); else restrictionsPanel.AddRestriction(column, true); }); menu.Items.Add(item); if (SelectedButton != null && SelectedButton.Tag is ReportElement) { item = new ToolStripMenuItem("Replace the selected element"); item.Click += new EventHandler(delegate (object sender2, EventArgs e2) { addElement(true); }); if (!Model.IsSubModel) menu.Items.Add(item); } } else if (elementTreeView.SelectedNode != null && elementTreeView.SelectedNode.Nodes.Count > 0) { ToolStripMenuItem item = new ToolStripMenuItem("Select all"); item.Click += new EventHandler(delegate (object sender2, EventArgs e2) { foreach (TreeNode node in elementTreeView.SelectedNode.Nodes) { if (node.Tag is MetaColumn) { AddElement(RowPanel, (MetaColumn)node.Tag, true); MainForm.IsModified = true; MainForm.CannotRenderAnymore(); PanelsToElements(); RowPanel.RedrawPanel(); } } UpdateLINQModel(); }); if (!Model.IsSubModel) menu.Items.Add(item); item = new ToolStripMenuItem("Sort by Name"); item.Click += new EventHandler(delegate (object sender2, EventArgs e2) { elementTreeView.TreeViewNodeSorter = null; elementTreeView.Sort(); }); if (!Model.IsSubModel) menu.Items.Add(new ToolStripSeparator()); menu.Items.Add(item); item = new ToolStripMenuItem("Sort by Position"); item.Click += new EventHandler(delegate (object sender2, EventArgs e2) { elementTreeView.TreeViewNodeSorter = new NodeSorter(); elementTreeView.Sort(); }); menu.Items.Add(item); } if (menu.Items.Count > 0) menu.Show(elementTreeView, e.Location); } }
public ShowNetworkUnlocatedItemMenu(ToolStripMenuItem i) { item = i; }
private void AddMqo(MeshModel mqo) { this.models.Add(mqo); //追加したMQOを削除するためのメニューを作成・追加する。 ToolStripMenuItem menu = new ToolStripMenuItem(); menu.Text = mqo.Name; menu.Tag = mqo; //メニューがクリックされると、 //MQOとこのメニュー自身が削除されるように仕込んでおく。 menu.Click += delegate(object sender, EventArgs e) { ToolStripMenuItem menuItem = (ToolStripMenuItem)sender; MeshModel m = (MeshModel)menuItem.Tag; this.models.Remove(m); m.Dispose(); //this.menuRemove.DropDownItems.Remove(menu); menu.Dispose(); if (this.pickedModel == m) this.pickedModel = null; }; //this.menuRemove.DropDownItems.Add(menu); }
/// <summary> /// protected method to handle the popup context menu in the <see c_ref="ZedGraphControl"/>. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) { // disable context menu by default e.Cancel = true; ContextMenuStrip menuStrip = sender as ContextMenuStrip; //Revision: JCarpenter 10/06 ContextMenuObjectState objState = GetObjectState(); if (_masterPane != null && menuStrip != null) { menuStrip.Items.Clear(); _isZooming = false; _isPanning = false; Cursor.Current = Cursors.Default; _menuClickPt = PointToClient(MousePosition); GraphPane pane = _masterPane.FindPane(_menuClickPt); if (_isShowContextMenu) { string menuStr = string.Empty; ToolStripMenuItem item = new ToolStripMenuItem(); item.Name = "copy"; item.Tag = "copy"; item.Text = _resourceManager.GetString("copy"); item.Click += MenuClick_Copy; menuStrip.Items.Add(item); item = new ToolStripMenuItem(); item.Name = "save_as"; item.Tag = "save_as"; item.Text = _resourceManager.GetString("save_as"); item.Click += MenuClick_SaveAs; menuStrip.Items.Add(item); item = new ToolStripMenuItem(); item.Name = "page_setup"; item.Tag = "page_setup"; item.Text = _resourceManager.GetString("page_setup"); item.Click += MenuClick_PageSetup; menuStrip.Items.Add(item); item = new ToolStripMenuItem(); item.Name = "print"; item.Tag = "print"; item.Text = _resourceManager.GetString("print"); item.Click += MenuClick_Print; menuStrip.Items.Add(item); item = new ToolStripMenuItem(); item.Name = "show_val"; item.Tag = "show_val"; item.Text = _resourceManager.GetString("show_val"); item.Click += MenuClick_ShowValues; item.Checked = IsShowPointValues; menuStrip.Items.Add(item); item = new ToolStripMenuItem(); item.Name = "unzoom"; item.Tag = "unzoom"; if (pane == null || pane.ZoomStack.IsEmpty) { menuStr = _resourceManager.GetString("unzoom"); } else { switch (pane.ZoomStack.Top.Type) { case ZoomState.StateType.Zoom: case ZoomState.StateType.WheelZoom: menuStr = _resourceManager.GetString("unzoom"); break; case ZoomState.StateType.Pan: menuStr = _resourceManager.GetString("unpan"); break; case ZoomState.StateType.Scroll: menuStr = _resourceManager.GetString("unscroll"); break; } } //menuItem.Text = "Un-" + ( ( pane == null || pane.zoomStack.IsEmpty ) ? // "Zoom" : pane.zoomStack.Top.TypeString ); item.Text = menuStr; item.Click += MenuClick_ZoomOut; if (pane == null || pane.ZoomStack.IsEmpty) { item.Enabled = false; } menuStrip.Items.Add(item); item = new ToolStripMenuItem(); item.Name = "undo_all"; item.Tag = "undo_all"; menuStr = _resourceManager.GetString("undo_all"); item.Text = menuStr; item.Click += MenuClick_ZoomOutAll; if (pane == null || pane.ZoomStack.IsEmpty) { item.Enabled = false; } menuStrip.Items.Add(item); item = new ToolStripMenuItem(); item.Name = "set_default"; item.Tag = "set_default"; menuStr = _resourceManager.GetString("set_default"); item.Text = menuStr; item.Click += MenuClick_RestoreScale; if (pane == null) { item.Enabled = false; } menuStrip.Items.Add(item); // if e.Cancel is set to false, the context menu does not display // it is initially set to false because the context menu has no items e.Cancel = false; // Provide Callback for User to edit the context menu //Revision: JCarpenter 10/06 - add ContextMenuObjectState objState if (ContextMenuBuilder != null) { ContextMenuBuilder(this, menuStrip, _menuClickPt, objState); } } } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.muxButton = new System.Windows.Forms.Button(); this.videoGroupbox = new System.Windows.Forms.GroupBox(); this.videoName = new System.Windows.Forms.TextBox(); this.videoNameLabel = new System.Windows.Forms.Label(); this.MuxFPSLabel = new System.Windows.Forms.Label(); this.videoInputLabel = new System.Windows.Forms.Label(); this.chaptersGroupbox = new System.Windows.Forms.GroupBox(); this.chaptersInputLabel = new System.Windows.Forms.Label(); this.outputGroupbox = new System.Windows.Forms.GroupBox(); this.splittingLabel = new System.Windows.Forms.Label(); this.muxedOutputLabel = new System.Windows.Forms.Label(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); this.cancelButton = new System.Windows.Forms.Button(); this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); this.audioPanel = new System.Windows.Forms.Panel(); this.audioMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.audioAddTrack = new System.Windows.Forms.ToolStripMenuItem(); this.audioRemoveTrack = new System.Windows.Forms.ToolStripMenuItem(); this.audio = new System.Windows.Forms.TabControl(); this.audioPage1 = new System.Windows.Forms.TabPage(); this.subtitleMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.subtitleAddTrack = new System.Windows.Forms.ToolStripMenuItem(); this.subtitleRemoveTrack = new System.Windows.Forms.ToolStripMenuItem(); this.subtitlePanel = new System.Windows.Forms.Panel(); this.subtitles = new System.Windows.Forms.TabControl(); this.subPage1 = new System.Windows.Forms.TabPage(); this.muxStreamControl1 = new MeGUI.core.details.mux.MuxStreamControl(); this.muxStreamControl2 = new MeGUI.core.details.mux.MuxStreamControl(); this.splitting = new MeGUI.core.gui.TargetSizeSCBox(); this.output = new MeGUI.FileBar(); this.fps = new MeGUI.core.gui.FPSChooser(); this.vInput = new MeGUI.FileBar(); this.chapters = new MeGUI.FileBar(); this.videoGroupbox.SuspendLayout(); this.chaptersGroupbox.SuspendLayout(); this.outputGroupbox.SuspendLayout(); this.audioPanel.SuspendLayout(); this.audioMenu.SuspendLayout(); this.audio.SuspendLayout(); this.audioPage1.SuspendLayout(); this.subtitleMenu.SuspendLayout(); this.subtitlePanel.SuspendLayout(); this.subtitles.SuspendLayout(); this.subPage1.SuspendLayout(); this.SuspendLayout(); // // muxButton // this.muxButton.Location = new System.Drawing.Point(291, 458); this.muxButton.Name = "muxButton"; this.muxButton.Size = new System.Drawing.Size(56, 23); this.muxButton.TabIndex = 26; this.muxButton.Text = "Queue"; this.muxButton.Click += new System.EventHandler(this.muxButton_Click); // // videoGroupbox // this.videoGroupbox.Controls.Add(this.fps); this.videoGroupbox.Controls.Add(this.vInput); this.videoGroupbox.Controls.Add(this.videoName); this.videoGroupbox.Controls.Add(this.videoNameLabel); this.videoGroupbox.Controls.Add(this.MuxFPSLabel); this.videoGroupbox.Controls.Add(this.videoInputLabel); this.videoGroupbox.Location = new System.Drawing.Point(8, 7); this.videoGroupbox.Name = "videoGroupbox"; this.videoGroupbox.Size = new System.Drawing.Size(424, 80); this.videoGroupbox.TabIndex = 22; this.videoGroupbox.TabStop = false; this.videoGroupbox.Text = "Video"; // // videoName // this.videoName.Location = new System.Drawing.Point(283, 49); this.videoName.MaxLength = 100; this.videoName.Name = "videoName"; this.videoName.Size = new System.Drawing.Size(95, 21); this.videoName.TabIndex = 34; // // videoNameLabel // this.videoNameLabel.AutoSize = true; this.videoNameLabel.Location = new System.Drawing.Point(243, 53); this.videoNameLabel.Name = "videoNameLabel"; this.videoNameLabel.Size = new System.Drawing.Size(34, 13); this.videoNameLabel.TabIndex = 33; this.videoNameLabel.Text = "Name"; // // MuxFPSLabel // this.MuxFPSLabel.Location = new System.Drawing.Point(16, 51); this.MuxFPSLabel.Name = "MuxFPSLabel"; this.MuxFPSLabel.Size = new System.Drawing.Size(40, 16); this.MuxFPSLabel.TabIndex = 32; this.MuxFPSLabel.Text = "FPS"; // // videoInputLabel // this.videoInputLabel.Location = new System.Drawing.Point(16, 20); this.videoInputLabel.Name = "videoInputLabel"; this.videoInputLabel.Size = new System.Drawing.Size(100, 13); this.videoInputLabel.TabIndex = 0; this.videoInputLabel.Text = "Video Input"; // // chaptersGroupbox // this.chaptersGroupbox.Controls.Add(this.chapters); this.chaptersGroupbox.Controls.Add(this.chaptersInputLabel); this.chaptersGroupbox.Location = new System.Drawing.Point(8, 318); this.chaptersGroupbox.Name = "chaptersGroupbox"; this.chaptersGroupbox.Size = new System.Drawing.Size(424, 48); this.chaptersGroupbox.TabIndex = 25; this.chaptersGroupbox.TabStop = false; this.chaptersGroupbox.Text = "Chapter"; // // chaptersInputLabel // this.chaptersInputLabel.Location = new System.Drawing.Point(16, 22); this.chaptersInputLabel.Name = "chaptersInputLabel"; this.chaptersInputLabel.Size = new System.Drawing.Size(100, 16); this.chaptersInputLabel.TabIndex = 17; this.chaptersInputLabel.Text = "Chapters File"; // // outputGroupbox // this.outputGroupbox.Controls.Add(this.splittingLabel); this.outputGroupbox.Controls.Add(this.splitting); this.outputGroupbox.Controls.Add(this.output); this.outputGroupbox.Controls.Add(this.muxedOutputLabel); this.outputGroupbox.Location = new System.Drawing.Point(8, 372); this.outputGroupbox.Name = "outputGroupbox"; this.outputGroupbox.Size = new System.Drawing.Size(424, 80); this.outputGroupbox.TabIndex = 28; this.outputGroupbox.TabStop = false; this.outputGroupbox.Text = "Output"; // // splittingLabel // this.splittingLabel.AutoSize = true; this.splittingLabel.Location = new System.Drawing.Point(14, 53); this.splittingLabel.Name = "splittingLabel"; this.splittingLabel.Size = new System.Drawing.Size(45, 13); this.splittingLabel.TabIndex = 37; this.splittingLabel.Text = "Splitting"; // // muxedOutputLabel // this.muxedOutputLabel.Location = new System.Drawing.Point(14, 23); this.muxedOutputLabel.Name = "muxedOutputLabel"; this.muxedOutputLabel.Size = new System.Drawing.Size(100, 16); this.muxedOutputLabel.TabIndex = 17; this.muxedOutputLabel.Text = "Muxed Output"; // // cancelButton // this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.cancelButton.Location = new System.Drawing.Point(376, 458); this.cancelButton.Name = "cancelButton"; this.cancelButton.Size = new System.Drawing.Size(56, 23); this.cancelButton.TabIndex = 29; this.cancelButton.Text = "Cancel"; // // audioPanel // this.audioPanel.ContextMenuStrip = this.audioMenu; this.audioPanel.Controls.Add(this.audio); this.audioPanel.Location = new System.Drawing.Point(8, 93); this.audioPanel.Name = "audioPanel"; this.audioPanel.Size = new System.Drawing.Size(424, 115); this.audioPanel.TabIndex = 31; // // audioMenu // this.audioMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.audioAddTrack, this.audioRemoveTrack }); this.audioMenu.Name = "audioMenu"; this.audioMenu.Size = new System.Drawing.Size(141, 48); this.audioMenu.Opening += new System.ComponentModel.CancelEventHandler(this.audioMenu_Opening); // // audioAddTrack // this.audioAddTrack.Name = "audioAddTrack"; this.audioAddTrack.Size = new System.Drawing.Size(140, 22); this.audioAddTrack.Text = "Add track"; this.audioAddTrack.Click += new System.EventHandler(this.audioAddTrack_Click); // // audioRemoveTrack // this.audioRemoveTrack.Name = "audioRemoveTrack"; this.audioRemoveTrack.Size = new System.Drawing.Size(140, 22); this.audioRemoveTrack.Text = "Remove track"; this.audioRemoveTrack.Click += new System.EventHandler(this.audioRemoveTrack_Click); // // audio // this.audio.Controls.Add(this.audioPage1); this.audio.Dock = System.Windows.Forms.DockStyle.Fill; this.audio.Location = new System.Drawing.Point(0, 0); this.audio.Name = "audio"; this.audio.SelectedIndex = 0; this.audio.Size = new System.Drawing.Size(424, 115); this.audio.TabIndex = 32; // // audioPage1 // this.audioPage1.Controls.Add(this.muxStreamControl2); this.audioPage1.Location = new System.Drawing.Point(4, 22); this.audioPage1.Name = "audioPage1"; this.audioPage1.Padding = new System.Windows.Forms.Padding(3); this.audioPage1.Size = new System.Drawing.Size(416, 89); this.audioPage1.TabIndex = 0; this.audioPage1.Text = "Audio 1"; this.audioPage1.UseVisualStyleBackColor = true; // // subtitleMenu // this.subtitleMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.subtitleAddTrack, this.subtitleRemoveTrack }); this.subtitleMenu.Name = "subtitleMenu"; this.subtitleMenu.Size = new System.Drawing.Size(141, 48); this.subtitleMenu.Opening += new System.ComponentModel.CancelEventHandler(this.subtitleMenu_Opening); // // subtitleAddTrack // this.subtitleAddTrack.Name = "subtitleAddTrack"; this.subtitleAddTrack.Size = new System.Drawing.Size(140, 22); this.subtitleAddTrack.Text = "Add track"; this.subtitleAddTrack.Click += new System.EventHandler(this.subtitleAddTrack_Click); // // subtitleRemoveTrack // this.subtitleRemoveTrack.Name = "subtitleRemoveTrack"; this.subtitleRemoveTrack.Size = new System.Drawing.Size(140, 22); this.subtitleRemoveTrack.Text = "Remove track"; this.subtitleRemoveTrack.Click += new System.EventHandler(this.subtitleRemoveTrack_Click); // // subtitlePanel // this.subtitlePanel.ContextMenuStrip = this.subtitleMenu; this.subtitlePanel.Controls.Add(this.subtitles); this.subtitlePanel.Location = new System.Drawing.Point(8, 214); this.subtitlePanel.Name = "subtitlePanel"; this.subtitlePanel.Size = new System.Drawing.Size(424, 98); this.subtitlePanel.TabIndex = 34; // // subtitles // this.subtitles.Controls.Add(this.subPage1); this.subtitles.Dock = System.Windows.Forms.DockStyle.Fill; this.subtitles.Location = new System.Drawing.Point(0, 0); this.subtitles.Name = "subtitles"; this.subtitles.SelectedIndex = 0; this.subtitles.Size = new System.Drawing.Size(424, 98); this.subtitles.TabIndex = 31; // // subPage1 // this.subPage1.Controls.Add(this.muxStreamControl1); this.subPage1.Location = new System.Drawing.Point(4, 22); this.subPage1.Name = "subPage1"; this.subPage1.Padding = new System.Windows.Forms.Padding(3); this.subPage1.Size = new System.Drawing.Size(416, 72); this.subPage1.TabIndex = 0; this.subPage1.Text = "Subtitle 1"; this.subPage1.UseVisualStyleBackColor = true; // // muxStreamControl1 // this.muxStreamControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.muxStreamControl1.Filter = null; this.muxStreamControl1.Location = new System.Drawing.Point(3, 3); this.muxStreamControl1.Name = "muxStreamControl1"; this.muxStreamControl1.ShowDelay = false; this.muxStreamControl1.Size = new System.Drawing.Size(410, 66); this.muxStreamControl1.TabIndex = 0; this.muxStreamControl1.FileUpdated += new System.EventHandler(this.muxStreamControl1_FileUpdated); // // muxStreamControl2 // this.muxStreamControl2.Dock = System.Windows.Forms.DockStyle.Fill; this.muxStreamControl2.Filter = null; this.muxStreamControl2.Location = new System.Drawing.Point(3, 3); this.muxStreamControl2.Name = "muxStreamControl2"; this.muxStreamControl2.ShowDelay = true; this.muxStreamControl2.Size = new System.Drawing.Size(410, 83); this.muxStreamControl2.TabIndex = 0; this.muxStreamControl2.FileUpdated += new System.EventHandler(this.muxStreamControl2_FileUpdated); // // splitting // this.splitting.Location = new System.Drawing.Point(115, 45); this.splitting.MaximumSize = new System.Drawing.Size(1000, 29); this.splitting.MinimumSize = new System.Drawing.Size(64, 29); this.splitting.Name = "splitting"; this.splitting.NullString = "No splitting"; this.splitting.SelectedIndex = 0; this.splitting.Size = new System.Drawing.Size(181, 29); this.splitting.TabIndex = 36; // // output // this.output.Filename = ""; this.output.Filter = null; this.output.FolderMode = false; this.output.Location = new System.Drawing.Point(118, 13); this.output.Name = "output"; this.output.ReadOnly = true; this.output.SaveMode = true; this.output.Size = new System.Drawing.Size(289, 26); this.output.TabIndex = 35; this.output.Title = null; this.output.FileSelected += new MeGUI.FileBarEventHandler(this.output_FileSelected); // // fps // this.fps.Location = new System.Drawing.Point(115, 45); this.fps.MaximumSize = new System.Drawing.Size(1000, 29); this.fps.MinimumSize = new System.Drawing.Size(64, 29); this.fps.Name = "fps"; this.fps.NullString = "Not set"; this.fps.SelectedIndex = 0; this.fps.Size = new System.Drawing.Size(119, 29); this.fps.TabIndex = 36; this.fps.SelectionChanged += new MeGUI.StringChanged(this.fps_SelectionChanged); // // vInput // this.vInput.Filename = ""; this.vInput.Filter = null; this.vInput.FolderMode = false; this.vInput.Location = new System.Drawing.Point(118, 13); this.vInput.Name = "vInput"; this.vInput.ReadOnly = true; this.vInput.SaveMode = false; this.vInput.Size = new System.Drawing.Size(289, 26); this.vInput.TabIndex = 35; this.vInput.Title = null; this.vInput.FileSelected += new MeGUI.FileBarEventHandler(this.vInput_FileSelected); // // chapters // this.chapters.Filename = ""; this.chapters.Filter = "Chapter files (*.txt)|*.txt"; this.chapters.FolderMode = false; this.chapters.Location = new System.Drawing.Point(118, 12); this.chapters.Name = "chapters"; this.chapters.ReadOnly = true; this.chapters.SaveMode = false; this.chapters.Size = new System.Drawing.Size(289, 26); this.chapters.TabIndex = 35; this.chapters.Title = null; this.chapters.FileSelected += new MeGUI.FileBarEventHandler(this.chapters_FileSelected); // // baseMuxWindow // this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); this.ClientSize = new System.Drawing.Size(444, 493); this.Controls.Add(this.subtitlePanel); this.Controls.Add(this.audioPanel); this.Controls.Add(this.cancelButton); this.Controls.Add(this.outputGroupbox); this.Controls.Add(this.muxButton); this.Controls.Add(this.videoGroupbox); this.Controls.Add(this.chaptersGroupbox); this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "baseMuxWindow"; this.ShowInTaskbar = false; this.Text = "Mux"; this.TopMost = true; this.videoGroupbox.ResumeLayout(false); this.videoGroupbox.PerformLayout(); this.chaptersGroupbox.ResumeLayout(false); this.outputGroupbox.ResumeLayout(false); this.outputGroupbox.PerformLayout(); this.audioPanel.ResumeLayout(false); this.audioMenu.ResumeLayout(false); this.audio.ResumeLayout(false); this.audioPage1.ResumeLayout(false); this.subtitleMenu.ResumeLayout(false); this.subtitlePanel.ResumeLayout(false); this.subtitles.ResumeLayout(false); this.subPage1.ResumeLayout(false); this.ResumeLayout(false); }
/// <summary> /// Creates and shows an Item context menu at the mouse pointer /// </summary> public ContextMenuStrip ItemContextMenu() { var top = new ToolStripMenuItem("Move to &Top"); top.Click += (o, args) => { SetItem(SelectedScene.MoveItem(SelectedItem, obs_order_movement.OBS_ORDER_MOVE_TOP)); }; var up = new ToolStripMenuItem("Move &Up"); up.Click += (o, args) => { SetItem(SelectedScene.MoveItem(SelectedItem, obs_order_movement.OBS_ORDER_MOVE_UP)); }; var down = new ToolStripMenuItem("Move &Down"); down.Click += (o, args) => { SetItem(SelectedScene.MoveItem(SelectedItem, obs_order_movement.OBS_ORDER_MOVE_DOWN)); }; var bottom = new ToolStripMenuItem("Move to &Bottom"); bottom.Click += (o, args) => { SetItem(SelectedScene.MoveItem(SelectedItem, obs_order_movement.OBS_ORDER_MOVE_BOTTOM)); }; var transform = new ToolStripMenuItem("&Edit Transform Options..."); transform.Click += (o, args) => { var transformfrm = new TestTransform(SelectedItem); transformfrm.ShowDialog(); }; var prop = new ToolStripMenuItem("&Edit Source Properties..."); prop.Click += (sender, args) => { var propfrm = new TestProperties(SelectedItem.GetSource()); propfrm.ShowDialog(); }; var visible = new ToolStripBindableMenuItem { Text = "&Visible", CheckOnClick = true }; visible.DataBindings.Add(new Binding("Checked", SelectedItem, "Visible", false, DataSourceUpdateMode.OnPropertyChanged)); var ordermenu = new ContextMenuStrip { Renderer = new AccessKeyMenuStripRenderer() }; ordermenu.Items.AddRange(new ToolStripItem[] { top, up, down, bottom, new ToolStripSeparator(), visible, new ToolStripSeparator(), transform, prop }); int index = SelectedScene.Items.IndexOf(SelectedItem); top.Enabled = up.Enabled = index != 0; down.Enabled = bottom.Enabled = index != SelectedScene.Items.Count - 1; return(ordermenu); }
public override bool Initialize(IPluginHost host) { pluginHost = host; // Get a reference to the 'Tools' menu item container ToolStripItemCollection tsMenu = pluginHost.MainWindow.ToolsMenu.DropDownItems; var groupContextMenu = pluginHost.MainWindow.GroupContextMenu.Items; var entryContextMenu = pluginHost.MainWindow.EntryContextMenu.Items; // Add a separator at the bottom toolStripSeperatorGlobal = new ToolStripSeparator(); tsMenu.Add(toolStripSeperatorGlobal); toolStripSeperatorGroup = new ToolStripSeparator(); groupContextMenu.Add(toolStripSeperatorGroup); toolStripSeperatorEntry = new ToolStripSeparator(); entryContextMenu.Add(toolStripSeperatorEntry); // Add global menu item 'Have I Been Pwned?' for all database entries haveIBeenPwnedGlobalMenuItem = new ToolStripMenuItem(); haveIBeenPwnedGlobalMenuItem.Text = Resources.MenuTitle; haveIBeenPwnedGlobalMenuItem.Image = Resources.hibp.ToBitmap(); haveIBeenPwnedGlobalServiceMenuItem = new ToolStripMenuItem(); haveIBeenPwnedGlobalServiceMenuItem.Text = Resources.MenuItemSiteTitle; haveIBeenPwnedGlobalServiceMenuItem.Image = Resources.hibp.ToBitmap(); haveIBeenPwnedGlobalServiceMenuItem.Click += this.Database_CheckHaveIBeenPwnedSites; haveIBeenPwnedGlobalMenuItem.DropDown.Items.Add(haveIBeenPwnedGlobalServiceMenuItem); haveIBeenPwnedGlobalUsernameMenuItem = new ToolStripMenuItem(); haveIBeenPwnedGlobalUsernameMenuItem.Text = Resources.MenuItemUsernameTitle; haveIBeenPwnedGlobalUsernameMenuItem.Image = Resources.hibp.ToBitmap(); haveIBeenPwnedGlobalUsernameMenuItem.Click += this.Database_CheckHaveIBeenPwnedUsernames; haveIBeenPwnedGlobalMenuItem.DropDown.Items.Add(haveIBeenPwnedGlobalUsernameMenuItem); haveIBeenPwnedGlobalPasswordMenuItem = new ToolStripMenuItem(); haveIBeenPwnedGlobalPasswordMenuItem.Text = Resources.MenuItemPasswordTitle; haveIBeenPwnedGlobalPasswordMenuItem.Image = Resources.hibp.ToBitmap(); haveIBeenPwnedGlobalPasswordMenuItem.Click += this.Database_CheckHaveIBeenPwnedPasswords; haveIBeenPwnedGlobalMenuItem.DropDown.Items.Add(haveIBeenPwnedGlobalPasswordMenuItem); checkAllGlobalMenuItem = new ToolStripMenuItem(); checkAllGlobalMenuItem.Text = Resources.MenuItemCheckAllTitle; checkAllGlobalMenuItem.Image = Resources.hibp.ToBitmap(); checkAllGlobalMenuItem.Click += this.Database_CheckAll; haveIBeenPwnedGlobalMenuItem.DropDown.Items.Add(checkAllGlobalMenuItem); tsMenu.Add(haveIBeenPwnedGlobalMenuItem); // Add group context menu item for the selected group haveIBeenPwnedGroupMenuItem = new ToolStripMenuItem(); haveIBeenPwnedGroupMenuItem.Text = Resources.MenuTitle; haveIBeenPwnedGroupMenuItem.Image = Resources.hibp.ToBitmap(); haveIBeenPwnedGroupServiceMenuItem = new ToolStripMenuItem(); haveIBeenPwnedGroupServiceMenuItem.Text = Resources.MenuItemSiteTitle; haveIBeenPwnedGroupServiceMenuItem.Image = Resources.hibp.ToBitmap(); haveIBeenPwnedGroupServiceMenuItem.Click += this.Group_CheckHaveIBeenPwnedSites; haveIBeenPwnedGroupMenuItem.DropDown.Items.Add(haveIBeenPwnedGroupServiceMenuItem); haveIBeenPwnedGroupUsernameMenuItem = new ToolStripMenuItem(); haveIBeenPwnedGroupUsernameMenuItem.Text = Resources.MenuItemUsernameTitle; haveIBeenPwnedGroupUsernameMenuItem.Image = Resources.hibp.ToBitmap(); haveIBeenPwnedGroupUsernameMenuItem.Click += this.Group_CheckHaveIBeenPwnedUsernames; haveIBeenPwnedGroupMenuItem.DropDown.Items.Add(haveIBeenPwnedGroupUsernameMenuItem); haveIBeenPwnedGroupPasswordMenuItem = new ToolStripMenuItem(); haveIBeenPwnedGroupPasswordMenuItem.Text = Resources.MenuItemPasswordTitle; haveIBeenPwnedGroupPasswordMenuItem.Image = Resources.hibp.ToBitmap(); haveIBeenPwnedGroupPasswordMenuItem.Click += this.Group_CheckHaveIBeenPwnedPasswords; haveIBeenPwnedGroupMenuItem.DropDown.Items.Add(haveIBeenPwnedGroupPasswordMenuItem); checkAllGroupMenuItem = new ToolStripMenuItem(); checkAllGroupMenuItem.Text = Resources.MenuItemCheckAllTitle; checkAllGroupMenuItem.Image = Resources.hibp.ToBitmap(); checkAllGroupMenuItem.Click += this.Group_CheckAll; haveIBeenPwnedGroupMenuItem.DropDown.Items.Add(checkAllGroupMenuItem); groupContextMenu.Add(haveIBeenPwnedGroupMenuItem); // Add entry context menu item for the selected entries haveIBeenPwnedEntryMenuItem = new ToolStripMenuItem(); haveIBeenPwnedEntryMenuItem.Text = Resources.MenuTitle; haveIBeenPwnedEntryMenuItem.Image = Resources.hibp.ToBitmap(); haveIBeenPwnedEntryServiceMenuItem = new ToolStripMenuItem(); haveIBeenPwnedEntryServiceMenuItem.Text = Resources.MenuItemSiteTitle; haveIBeenPwnedEntryServiceMenuItem.Image = Resources.hibp.ToBitmap(); haveIBeenPwnedEntryServiceMenuItem.Click += this.Entries_CheckHaveIBeenPwnedSites; haveIBeenPwnedEntryMenuItem.DropDown.Items.Add(haveIBeenPwnedEntryServiceMenuItem); haveIBeenPwnedEntryUsernameMenuItem = new ToolStripMenuItem(); haveIBeenPwnedEntryUsernameMenuItem.Text = Resources.MenuItemUsernameTitle; haveIBeenPwnedEntryUsernameMenuItem.Image = Resources.hibp.ToBitmap(); haveIBeenPwnedEntryUsernameMenuItem.Click += this.Entries_CheckHaveIBeenPwnedUsernames; haveIBeenPwnedEntryMenuItem.DropDown.Items.Add(haveIBeenPwnedEntryUsernameMenuItem); haveIBeenPwnedEntryPasswordMenuItem = new ToolStripMenuItem(); haveIBeenPwnedEntryPasswordMenuItem.Text = Resources.MenuItemPasswordTitle; haveIBeenPwnedEntryPasswordMenuItem.Image = Resources.hibp.ToBitmap(); haveIBeenPwnedEntryPasswordMenuItem.Click += this.Entries_CheckHaveIBeenPwnedPasswords; haveIBeenPwnedEntryMenuItem.DropDown.Items.Add(haveIBeenPwnedEntryPasswordMenuItem); checkAllEntryMenuItem = new ToolStripMenuItem(); checkAllEntryMenuItem.Text = Resources.MenuItemCheckAllTitle; checkAllEntryMenuItem.Image = Resources.hibp.ToBitmap(); checkAllEntryMenuItem.Click += this.Entries_CheckAll; haveIBeenPwnedEntryMenuItem.DropDown.Items.Add(checkAllEntryMenuItem); entryContextMenu.Add(haveIBeenPwnedEntryMenuItem); return(true); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.txtMsiFileName = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.btnBrowse = new System.Windows.Forms.Button(); this.tabs = new System.Windows.Forms.TabControl(); this.tabExtractFiles = new System.Windows.Forms.TabPage(); this.fileGrid = new System.Windows.Forms.DataGridView(); this.panel2 = new System.Windows.Forms.Panel(); this.btnSelectAll = new System.Windows.Forms.Button(); this.btnUnselectAll = new System.Windows.Forms.Button(); this.btnExtract = new System.Windows.Forms.Button(); this.tabTableView = new System.Windows.Forms.TabPage(); this.panel3 = new System.Windows.Forms.Panel(); this.label2 = new System.Windows.Forms.Label(); this.cboTable = new System.Windows.Forms.ComboBox(); this.msiTableGrid = new System.Windows.Forms.DataGridView(); this.tabSummary = new System.Windows.Forms.TabPage(); this.msiPropertyGrid = new System.Windows.Forms.DataGridView(); this.grpDescription = new System.Windows.Forms.GroupBox(); this.txtSummaryDescription = new System.Windows.Forms.TextBox(); this.panel1 = new System.Windows.Forms.Panel(); this.folderBrowser = new System.Windows.Forms.FolderBrowserDialog(); this.openMsiDialog = new System.Windows.Forms.OpenFileDialog(); this.statusBar1 = new System.Windows.Forms.StatusBar(); this.statusPanelDefault = new System.Windows.Forms.StatusBarPanel(); this.statusPanelFileCount = new System.Windows.Forms.StatusBarPanel(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.mruPlaceHolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabs.SuspendLayout(); this.tabExtractFiles.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.fileGrid)).BeginInit(); this.panel2.SuspendLayout(); this.tabTableView.SuspendLayout(); this.panel3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.msiTableGrid)).BeginInit(); this.tabSummary.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.msiPropertyGrid)).BeginInit(); this.grpDescription.SuspendLayout(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.statusPanelDefault)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.statusPanelFileCount)).BeginInit(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // // txtMsiFileName // this.txtMsiFileName.Anchor = ((System.Windows.Forms.AnchorStyles) (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtMsiFileName.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; this.txtMsiFileName.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystem; this.txtMsiFileName.Location = new System.Drawing.Point(55, 5); this.txtMsiFileName.Name = "txtMsiFileName"; this.txtMsiFileName.Size = new System.Drawing.Size(367, 20); this.txtMsiFileName.TabIndex = 0; this.txtMsiFileName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ReloadCurrentUIOnEnterKeyDown); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(12, 8); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(26, 13); this.label1.TabIndex = 1; this.label1.Text = "File:"; // // btnBrowse // this.btnBrowse.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnBrowse.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnBrowse.Location = new System.Drawing.Point(428, 7); this.btnBrowse.Name = "btnBrowse"; this.btnBrowse.Size = new System.Drawing.Size(24, 19); this.btnBrowse.TabIndex = 1; this.btnBrowse.Text = "..."; this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click); // // tabs // this.tabs.Controls.Add(this.tabExtractFiles); this.tabs.Controls.Add(this.tabTableView); this.tabs.Controls.Add(this.tabSummary); this.tabs.Dock = System.Windows.Forms.DockStyle.Fill; this.tabs.Location = new System.Drawing.Point(0, 55); this.tabs.Name = "tabs"; this.tabs.SelectedIndex = 0; this.tabs.Size = new System.Drawing.Size(464, 441); this.tabs.TabIndex = 0; this.tabs.TabStop = false; // // tabExtractFiles // this.tabExtractFiles.Controls.Add(this.fileGrid); this.tabExtractFiles.Controls.Add(this.panel2); this.tabExtractFiles.Location = new System.Drawing.Point(4, 22); this.tabExtractFiles.Name = "tabExtractFiles"; this.tabExtractFiles.Padding = new System.Windows.Forms.Padding(5); this.tabExtractFiles.Size = new System.Drawing.Size(456, 415); this.tabExtractFiles.TabIndex = 0; this.tabExtractFiles.Text = "Extract Files"; // // fileGrid // this.fileGrid.AllowUserToAddRows = false; this.fileGrid.AllowUserToDeleteRows = false; this.fileGrid.AllowUserToOrderColumns = true; dataGridViewCellStyle4.BackColor = System.Drawing.Color.WhiteSmoke; this.fileGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; this.fileGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.fileGrid.Dock = System.Windows.Forms.DockStyle.Fill; this.fileGrid.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnKeystroke; this.fileGrid.Location = new System.Drawing.Point(5, 5); this.fileGrid.Name = "fileGrid"; this.fileGrid.ReadOnly = true; this.fileGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.fileGrid.Size = new System.Drawing.Size(446, 368); this.fileGrid.TabIndex = 5; // // panel2 // this.panel2.Controls.Add(this.btnSelectAll); this.panel2.Controls.Add(this.btnUnselectAll); this.panel2.Controls.Add(this.btnExtract); this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel2.Location = new System.Drawing.Point(5, 373); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(446, 37); this.panel2.TabIndex = 4; // // btnSelectAll // this.btnSelectAll.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnSelectAll.Location = new System.Drawing.Point(0, 9); this.btnSelectAll.Name = "btnSelectAll"; this.btnSelectAll.Size = new System.Drawing.Size(90, 27); this.btnSelectAll.TabIndex = 1; this.btnSelectAll.Text = "Select &All"; this.btnSelectAll.Click += new System.EventHandler(this.btnSelectAll_Click); // // btnUnselectAll // this.btnUnselectAll.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnUnselectAll.Location = new System.Drawing.Point(106, 9); this.btnUnselectAll.Name = "btnUnselectAll"; this.btnUnselectAll.Size = new System.Drawing.Size(90, 27); this.btnUnselectAll.TabIndex = 2; this.btnUnselectAll.Text = "&Unselect All"; this.btnUnselectAll.Click += new System.EventHandler(this.btnUnselectAll_Click); // // btnExtract // this.btnExtract.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnExtract.Enabled = false; this.btnExtract.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnExtract.Location = new System.Drawing.Point(354, 9); this.btnExtract.Name = "btnExtract"; this.btnExtract.Size = new System.Drawing.Size(90, 27); this.btnExtract.TabIndex = 3; this.btnExtract.Text = "E&xtract"; this.btnExtract.Click += new System.EventHandler(this.btnExtract_Click); // // tabTableView // this.tabTableView.Controls.Add(this.panel3); this.tabTableView.Controls.Add(this.msiTableGrid); this.tabTableView.Location = new System.Drawing.Point(4, 22); this.tabTableView.Name = "tabTableView"; this.tabTableView.Size = new System.Drawing.Size(456, 415); this.tabTableView.TabIndex = 1; this.tabTableView.Text = "Table View"; // // panel3 // this.panel3.Controls.Add(this.label2); this.panel3.Controls.Add(this.cboTable); this.panel3.Dock = System.Windows.Forms.DockStyle.Top; this.panel3.Location = new System.Drawing.Point(0, 0); this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(456, 28); this.panel3.TabIndex = 11; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(4, 7); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(34, 13); this.label2.TabIndex = 9; this.label2.Text = "&Table"; // // cboTable // this.cboTable.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cboTable.Enabled = false; this.cboTable.Location = new System.Drawing.Point(50, 5); this.cboTable.Name = "cboTable"; this.cboTable.Size = new System.Drawing.Size(323, 21); this.cboTable.TabIndex = 8; this.cboTable.Text = "File"; this.cboTable.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); // // msiTableGrid // this.msiTableGrid.AllowUserToAddRows = false; this.msiTableGrid.AllowUserToDeleteRows = false; dataGridViewCellStyle5.BackColor = System.Drawing.Color.WhiteSmoke; this.msiTableGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.msiTableGrid.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.msiTableGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.msiTableGrid.Location = new System.Drawing.Point(0, 35); this.msiTableGrid.Name = "msiTableGrid"; this.msiTableGrid.ReadOnly = true; this.msiTableGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.msiTableGrid.Size = new System.Drawing.Size(453, 370); this.msiTableGrid.TabIndex = 10; // // tabSummary // this.tabSummary.Controls.Add(this.msiPropertyGrid); this.tabSummary.Controls.Add(this.grpDescription); this.tabSummary.Location = new System.Drawing.Point(4, 22); this.tabSummary.Name = "tabSummary"; this.tabSummary.Padding = new System.Windows.Forms.Padding(5); this.tabSummary.Size = new System.Drawing.Size(456, 415); this.tabSummary.TabIndex = 2; this.tabSummary.Text = "Summary"; // // msiPropertyGrid // this.msiPropertyGrid.AllowUserToAddRows = false; this.msiPropertyGrid.AllowUserToDeleteRows = false; dataGridViewCellStyle6.BackColor = System.Drawing.Color.WhiteSmoke; this.msiPropertyGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.msiPropertyGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.msiPropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill; this.msiPropertyGrid.Location = new System.Drawing.Point(5, 5); this.msiPropertyGrid.Name = "msiPropertyGrid"; this.msiPropertyGrid.ReadOnly = true; this.msiPropertyGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.msiPropertyGrid.Size = new System.Drawing.Size(446, 299); this.msiPropertyGrid.TabIndex = 3; this.msiPropertyGrid.SelectionChanged += new System.EventHandler(this.msiPropertyGrid_SelectionChanged); // // grpDescription // this.grpDescription.Controls.Add(this.txtSummaryDescription); this.grpDescription.Dock = System.Windows.Forms.DockStyle.Bottom; this.grpDescription.Location = new System.Drawing.Point(5, 304); this.grpDescription.Name = "grpDescription"; this.grpDescription.Size = new System.Drawing.Size(446, 106); this.grpDescription.TabIndex = 2; this.grpDescription.TabStop = false; this.grpDescription.Text = "Description:"; // // txtSummaryDescription // this.txtSummaryDescription.BorderStyle = System.Windows.Forms.BorderStyle.None; this.txtSummaryDescription.Dock = System.Windows.Forms.DockStyle.Fill; this.txtSummaryDescription.Location = new System.Drawing.Point(3, 16); this.txtSummaryDescription.Multiline = true; this.txtSummaryDescription.Name = "txtSummaryDescription"; this.txtSummaryDescription.ReadOnly = true; this.txtSummaryDescription.Size = new System.Drawing.Size(440, 87); this.txtSummaryDescription.TabIndex = 1; // // panel1 // this.panel1.Controls.Add(this.txtMsiFileName); this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.btnBrowse); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 24); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(464, 31); this.panel1.TabIndex = 0; // // openMsiDialog // this.openMsiDialog.DefaultExt = "msi"; this.openMsiDialog.Filter = "msierablefiles|*.msi|All Files|*.*"; // // statusBar1 // this.statusBar1.Location = new System.Drawing.Point(0, 496); this.statusBar1.Name = "statusBar1"; this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] { this.statusPanelDefault, this.statusPanelFileCount }); this.statusBar1.ShowPanels = true; this.statusBar1.Size = new System.Drawing.Size(464, 16); this.statusBar1.TabIndex = 2; // // statusPanelDefault // this.statusPanelDefault.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring; this.statusPanelDefault.Name = "statusPanelDefault"; this.statusPanelDefault.Width = 337; // // statusPanelFileCount // this.statusPanelFileCount.Name = "statusPanelFileCount"; this.statusPanelFileCount.Width = 110; // // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.editToolStripMenuItem, this.aboutToolStripMenuItem }); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(464, 24); this.menuStrip1.TabIndex = 3; this.menuStrip1.Text = "menuStrip1"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.openToolStripMenuItem, this.toolStripSeparator2, this.mruPlaceHolderToolStripMenuItem, this.toolStripSeparator3, this.exitToolStripMenuItem }); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "&File"; // // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.openToolStripMenuItem.Text = "&Open"; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6); // // mruPlaceHolderToolStripMenuItem // this.mruPlaceHolderToolStripMenuItem.Enabled = false; this.mruPlaceHolderToolStripMenuItem.Name = "mruPlaceHolderToolStripMenuItem"; this.mruPlaceHolderToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.mruPlaceHolderToolStripMenuItem.Text = "<Recent Files>"; // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Size = new System.Drawing.Size(149, 6); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // // editToolStripMenuItem // this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.copyToolStripMenuItem, this.toolStripSeparator1, this.preferencesToolStripMenuItem }); this.editToolStripMenuItem.Name = "editToolStripMenuItem"; this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); this.editToolStripMenuItem.Text = "&Edit"; // // copyToolStripMenuItem // this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); this.copyToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.copyToolStripMenuItem.Text = "&Copy"; this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(141, 6); // // preferencesToolStripMenuItem // this.preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem"; this.preferencesToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.preferencesToolStripMenuItem.Text = "&Preferences"; this.preferencesToolStripMenuItem.Click += new System.EventHandler(this.preferencesToolStripMenuItem_Click); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 20); this.aboutToolStripMenuItem.Text = "About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); // // MainForm // this.AllowDrop = true; this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(464, 512); this.Controls.Add(this.tabs); this.Controls.Add(this.statusBar1); this.Controls.Add(this.panel1); this.Controls.Add(this.menuStrip1); this.MainMenuStrip = this.menuStrip1; this.MinimumSize = new System.Drawing.Size(352, 404); this.Name = "MainForm"; this.Text = "Less MSIérables"; this.DragDrop += new System.Windows.Forms.DragEventHandler(this.MainForm_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.MainForm_DragEnter); this.tabs.ResumeLayout(false); this.tabExtractFiles.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.fileGrid)).EndInit(); this.panel2.ResumeLayout(false); this.tabTableView.ResumeLayout(false); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.msiTableGrid)).EndInit(); this.tabSummary.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.msiPropertyGrid)).EndInit(); this.grpDescription.ResumeLayout(false); this.grpDescription.PerformLayout(); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.statusPanelDefault)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.statusPanelFileCount)).EndInit(); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
public ShowNetworkServersItemMenu(ToolStripMenuItem i) { item = i; }
public override void Initialize() { if (CurrentVersion < 90020140221) { //send back a message that we need to update! PluginArgs a = new PluginArgs { Command = "/echo Channel Monitor Plugin v1.3 requires IceChat 9 RC 8.22 or newer (" + CurrentVersion + ")" }; OnCommand(a); this.Enabled = false; return; } settingsFile = CurrentFolder + System.IO.Path.DirectorySeparatorChar + "IceChatChannelMonitor.xml"; LoadSettings(); panel = new Panel { Height = 150, Dock = DockStyle.Bottom }; listMonitor = new ListView(); columnTime = new ColumnHeader(); columnChannel = new ColumnHeader(); columnMessage = new ColumnHeader(); columnServerID = new ColumnHeader(); columnTime.Width = 175; columnTime.Text = "Time"; columnChannel.Width = 150; columnChannel.Text = "Channel/Nick"; columnMessage.Width = 1000; columnMessage.Text = "Message"; columnServerID.Width = 0; //hidden listMonitor.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { columnTime, columnChannel, columnMessage, columnServerID }); listMonitor.View = System.Windows.Forms.View.Details; listMonitor.FullRowSelect = true; listMonitor.Font = new System.Drawing.Font("Verdana", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); listMonitor.Dock = DockStyle.Fill; panel.Controls.Add(listMonitor); listMonitor.BackColor = System.Drawing.ColorTranslator.FromHtml(monitorChannels.MonitorBackColor); listMonitor.ForeColor = System.Drawing.ColorTranslator.FromHtml(monitorChannels.MonitorForeColor); if (CurrentVersion > 90220150213) { listMonitor.DoubleClick += new EventHandler(ListMonitor_DoubleClick); } m_EnableMonitor = new ToolStripMenuItem { Text = "Toggle Monitor", Checked = true }; m_EnableMonitor.Click += new EventHandler(OnEnableMonitor_Click); }
/// <summary> /// (re)initialize all controls and data<br /> /// this is needed if the configuration has changed /// </summary> private void init() { //if (m_parent.InvokeRequired) //{ // try // { // m_parent.Invoke(new UtilsHelper.Action(init)); // } // catch (ObjectDisposedException) // { // } // return; //} m_vpn = null; m_menu.DropDownItems.Clear(); m_status.Hide(); try { if (!m_isService) { m_vpn = new UserSpaceConnection(m_bin, m_file, new EventHandler <LogEventArgs>(addLog), m_dbglevel, m_smartCard); } else { m_vpn = new ServiceConnection(m_file, new EventHandler <LogEventArgs>(addLog), m_dbglevel, m_smartCard); } } catch (ApplicationException e) { m_error_message = e.Message; } Name = VPNConfig.GetDescriptiveName(m_file); if (m_isService) { Name += " (" + ProgramVPN.res.GetString("DIALOG_Service") + ")"; } m_menu.Text = Name; m_infobox.Init(); if (m_error_message != null) { m_menu_error = new ToolStripMenuItem(ProgramVPN.res.GetString("TRAY_Error_Information")); m_menu_error.Click += new EventHandler(m_menu_error_Click); m_menu.DropDownItems.Add(m_menu_error); return; } m_vpn.Logs.DebugLevel = m_dbglevel; m_vpn.State.StateChanged += new EventHandler <StateChangedEventArgs>(State_StateChanged); m_vpn.NeedCardId += new EventHandler <NeedCardIdEventArgs>(m_vpn_needCardID); m_vpn.NeedPassword += new EventHandler <NeedPasswordEventArgs>(m_vpn_needPassword); m_vpn.NeedLoginAndPassword += new EventHandler <NeedLoginAndPasswordEventArgs>(m_vpn_needLoginAndPassword); m_status.Init(); m_menu_connect = new ToolStripMenuItem(ProgramVPN.res.GetString("TRAY_Connect")); m_menu_connect.Image = Properties.Resources.BUTTON_Connect; m_menu_connect.Click += new EventHandler(m_menu_connect_Click); m_menu.DropDownItems.Add(m_menu_connect); m_menu_disconnect = new ToolStripMenuItem(ProgramVPN.res.GetString("TRAY_Disconnect")); m_menu_disconnect.Image = Properties.Resources.BUTTON_Disconnect; m_menu_disconnect.Click += new EventHandler(m_menu_disconnect_Click); m_menu_disconnect.Visible = false; m_menu.DropDownItems.Add(m_menu_disconnect); m_menu_show = new ToolStripMenuItem(ProgramVPN.res.GetString("TRAY_Show")); m_menu_show.Image = Properties.Resources.BUTTON_Details; m_menu_show.Click += new EventHandler(m_menu_show_Click); m_menu.DropDownItems.Add(m_menu_show); m_menu_edit = new ToolStripMenuItem(ProgramVPN.res.GetString("TRAY_Edit")); m_menu_edit.Enabled = !m_isService; m_menu_edit.Image = Properties.Resources.BUTTON_Edit; m_menu_edit.Click += new EventHandler(m_menu_edit_Click); m_menu.DropDownItems.Add(m_menu_edit); m_menu.Image = Properties.Resources.STATE_Stopped; }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CodeNowPluginControl)); this.splitContainer4 = new System.Windows.Forms.SplitContainer(); this.panelCode = new System.Windows.Forms.Panel(); this.panelStart = new System.Windows.Forms.Panel(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.label4 = new System.Windows.Forms.Label(); this.executionProgressBar = new System.Windows.Forms.ProgressBar(); this.toolStrip2 = new System.Windows.Forms.ToolStrip(); this.toolStripDropDownButton2 = new System.Windows.Forms.ToolStripDropDownButton(); this.tbLoadItem = new System.Windows.Forms.ToolStripMenuItem(); this.tbSaveItem = new System.Windows.Forms.ToolStripMenuItem(); this.tbSaveAs = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.tbNewItem = new System.Windows.Forms.ToolStripMenuItem(); this.tbNewScript = new System.Windows.Forms.ToolStripMenuItem(); this.tbCompileCode = new System.Windows.Forms.ToolStripButton(); this.tbRunCode = new System.Windows.Forms.ToolStripButton(); this.splitContainerCode = new System.Windows.Forms.SplitContainer(); this.label5 = new System.Windows.Forms.Label(); this.tbLocation = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.tbDescription = new System.Windows.Forms.TextBox(); this.Description = new System.Windows.Forms.Label(); this.tbCategory = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.tbTitle = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.tbUsing = new System.Windows.Forms.TextBox(); this.tbLog = new System.Windows.Forms.TextBox(); this.progressTimer = new System.Windows.Forms.Timer(this.components); this.tbCode = new FastColoredTextBoxNS.FastColoredTextBox(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit(); this.splitContainer4.Panel1.SuspendLayout(); this.splitContainer4.Panel2.SuspendLayout(); this.splitContainer4.SuspendLayout(); this.panelCode.SuspendLayout(); this.panelStart.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.toolStrip2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainerCode)).BeginInit(); this.splitContainerCode.Panel1.SuspendLayout(); this.splitContainerCode.Panel2.SuspendLayout(); this.splitContainerCode.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tbCode)).BeginInit(); this.SuspendLayout(); // // splitContainer4 // this.splitContainer4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.splitContainer4.Location = new System.Drawing.Point(0, 0); this.splitContainer4.Name = "splitContainer4"; this.splitContainer4.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitContainer4.Panel1 // this.splitContainer4.Panel1.Controls.Add(this.panelCode); // // splitContainer4.Panel2 // this.splitContainer4.Panel2.Controls.Add(this.tbLog); this.splitContainer4.Size = new System.Drawing.Size(877, 561); this.splitContainer4.SplitterDistance = 400; this.splitContainer4.TabIndex = 0; // // panelCode // this.panelCode.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.panelCode.Controls.Add(this.panelStart); this.panelCode.Controls.Add(this.executionProgressBar); this.panelCode.Controls.Add(this.toolStrip2); this.panelCode.Controls.Add(this.splitContainerCode); this.panelCode.Location = new System.Drawing.Point(3, 3); this.panelCode.Name = "panelCode"; this.panelCode.Size = new System.Drawing.Size(871, 394); this.panelCode.TabIndex = 0; // // panelStart // this.panelStart.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.panelStart.BackColor = System.Drawing.SystemColors.ButtonHighlight; this.panelStart.Controls.Add(this.pictureBox1); this.panelStart.Controls.Add(this.label4); this.panelStart.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.panelStart.Location = new System.Drawing.Point(82, 49); this.panelStart.Name = "panelStart"; this.panelStart.Size = new System.Drawing.Size(682, 229); this.panelStart.TabIndex = 2; // // pictureBox1 // this.pictureBox1.BackgroundImage = global::TreeCat.XrmToolBox.CodeNow.Properties.Resources.Logo64; this.pictureBox1.Location = new System.Drawing.Point(144, 55); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(62, 56); this.pictureBox1.TabIndex = 1; this.pictureBox1.TabStop = false; // // label4 // this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label4.Location = new System.Drawing.Point(212, 55); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(267, 80); this.label4.TabIndex = 0; this.label4.Text = "CodeNow Plugin for XrmToolBox\r\n\r\nTo load a script, use \r\nFile->Open"; this.label4.TextAlign = System.Drawing.ContentAlignment.TopCenter; // // executionProgressBar // this.executionProgressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.executionProgressBar.Location = new System.Drawing.Point(419, 370); this.executionProgressBar.Name = "executionProgressBar"; this.executionProgressBar.Size = new System.Drawing.Size(449, 18); this.executionProgressBar.TabIndex = 5; // // toolStrip2 // this.toolStrip2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.toolStrip2.AutoSize = false; this.toolStrip2.Dock = System.Windows.Forms.DockStyle.None; this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripDropDownButton2, this.tbCompileCode, this.tbRunCode }); this.toolStrip2.Location = new System.Drawing.Point(0, 363); this.toolStrip2.Name = "toolStrip2"; this.toolStrip2.Size = new System.Drawing.Size(216, 27); this.toolStrip2.TabIndex = 1; this.toolStrip2.Text = "toolStrip2"; // // toolStripDropDownButton2 // this.toolStripDropDownButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.toolStripDropDownButton2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.tbLoadItem, this.tbSaveItem, this.tbSaveAs, this.toolStripSeparator1, this.tbNewItem, this.tbNewScript }); this.toolStripDropDownButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton2.Image"))); this.toolStripDropDownButton2.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripDropDownButton2.Name = "toolStripDropDownButton2"; this.toolStripDropDownButton2.Size = new System.Drawing.Size(38, 24); this.toolStripDropDownButton2.Text = "File"; // // tbLoadItem // this.tbLoadItem.Name = "tbLoadItem"; this.tbLoadItem.Size = new System.Drawing.Size(135, 22); this.tbLoadItem.Text = "Open"; this.tbLoadItem.Click += new System.EventHandler(this.tbLoadItem_Click); // // tbSaveItem // this.tbSaveItem.Name = "tbSaveItem"; this.tbSaveItem.Size = new System.Drawing.Size(135, 22); this.tbSaveItem.Text = "Save"; this.tbSaveItem.Click += new System.EventHandler(this.tbSaveItem_Click); // // tbSaveAs // this.tbSaveAs.Name = "tbSaveAs"; this.tbSaveAs.Size = new System.Drawing.Size(135, 22); this.tbSaveAs.Text = "Save As"; this.tbSaveAs.Click += new System.EventHandler(this.tbSaveAs_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(132, 6); // // tbNewItem // this.tbNewItem.Name = "tbNewItem"; this.tbNewItem.Size = new System.Drawing.Size(135, 22); this.tbNewItem.Text = "New Plugin"; this.tbNewItem.Click += new System.EventHandler(this.tbNewItem_Click); // // tbNewScript // this.tbNewScript.Name = "tbNewScript"; this.tbNewScript.Size = new System.Drawing.Size(135, 22); this.tbNewScript.Text = "New Script"; this.tbNewScript.Click += new System.EventHandler(this.tbNewScript_Click); // // tbCompileCode // this.tbCompileCode.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.tbCompileCode.Image = ((System.Drawing.Image)(resources.GetObject("tbCompileCode.Image"))); this.tbCompileCode.ImageTransparentColor = System.Drawing.Color.Magenta; this.tbCompileCode.Name = "tbCompileCode"; this.tbCompileCode.Size = new System.Drawing.Size(56, 24); this.tbCompileCode.Text = "Compile"; this.tbCompileCode.Click += new System.EventHandler(this.tbMakeExeItem_Click); // // tbRunCode // this.tbRunCode.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.tbRunCode.Image = ((System.Drawing.Image)(resources.GetObject("tbRunCode.Image"))); this.tbRunCode.ImageTransparentColor = System.Drawing.Color.Magenta; this.tbRunCode.Name = "tbRunCode"; this.tbRunCode.Size = new System.Drawing.Size(32, 24); this.tbRunCode.Text = "Run"; this.tbRunCode.Click += new System.EventHandler(this.buttonRun_Click); // // splitContainerCode // this.splitContainerCode.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.splitContainerCode.Location = new System.Drawing.Point(0, 0); this.splitContainerCode.Name = "splitContainerCode"; // // splitContainerCode.Panel1 // this.splitContainerCode.Panel1.BackColor = System.Drawing.SystemColors.Control; this.splitContainerCode.Panel1.Controls.Add(this.tbCode); this.splitContainerCode.Panel1.Controls.Add(this.label5); // // splitContainerCode.Panel2 // this.splitContainerCode.Panel2.BackColor = System.Drawing.SystemColors.Control; this.splitContainerCode.Panel2.Controls.Add(this.tbLocation); this.splitContainerCode.Panel2.Controls.Add(this.label1); this.splitContainerCode.Panel2.Controls.Add(this.tbDescription); this.splitContainerCode.Panel2.Controls.Add(this.Description); this.splitContainerCode.Panel2.Controls.Add(this.tbCategory); this.splitContainerCode.Panel2.Controls.Add(this.label3); this.splitContainerCode.Panel2.Controls.Add(this.tbTitle); this.splitContainerCode.Panel2.Controls.Add(this.label2); this.splitContainerCode.Panel2.Controls.Add(this.label6); this.splitContainerCode.Panel2.Controls.Add(this.tbUsing); this.splitContainerCode.Size = new System.Drawing.Size(871, 363); this.splitContainerCode.SplitterDistance = 550; this.splitContainerCode.TabIndex = 0; // // label5 // this.label5.AutoSize = true; this.label5.BackColor = System.Drawing.SystemColors.Control; this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label5.Location = new System.Drawing.Point(4, 4); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(100, 13); this.label5.TabIndex = 0; this.label5.Text = "C# Source Code"; // // tbLocation // this.tbLocation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tbLocation.Location = new System.Drawing.Point(4, 339); this.tbLocation.Name = "tbLocation"; this.tbLocation.ReadOnly = true; this.tbLocation.Size = new System.Drawing.Size(310, 20); this.tbLocation.TabIndex = 9; // // label1 // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label1.AutoSize = true; this.label1.BackColor = System.Drawing.SystemColors.Control; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(3, 323); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(56, 13); this.label1.TabIndex = 8; this.label1.Text = "Location"; // // tbDescription // this.tbDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tbDescription.Location = new System.Drawing.Point(4, 251); this.tbDescription.Multiline = true; this.tbDescription.Name = "tbDescription"; this.tbDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.tbDescription.Size = new System.Drawing.Size(310, 69); this.tbDescription.TabIndex = 7; // // Description // this.Description.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.Description.AutoSize = true; this.Description.BackColor = System.Drawing.SystemColors.Control; this.Description.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Description.Location = new System.Drawing.Point(3, 235); this.Description.Name = "Description"; this.Description.Size = new System.Drawing.Size(71, 13); this.Description.TabIndex = 6; this.Description.Text = "Description"; // // tbCategory // this.tbCategory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tbCategory.Location = new System.Drawing.Point(4, 212); this.tbCategory.Name = "tbCategory"; this.tbCategory.Size = new System.Drawing.Size(310, 20); this.tbCategory.TabIndex = 5; // // label3 // this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label3.AutoSize = true; this.label3.BackColor = System.Drawing.SystemColors.Control; this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label3.Location = new System.Drawing.Point(3, 196); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(57, 13); this.label3.TabIndex = 4; this.label3.Text = "Category"; // // tbTitle // this.tbTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tbTitle.Location = new System.Drawing.Point(4, 173); this.tbTitle.Name = "tbTitle"; this.tbTitle.Size = new System.Drawing.Size(310, 20); this.tbTitle.TabIndex = 3; // // label2 // this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label2.AutoSize = true; this.label2.BackColor = System.Drawing.SystemColors.Control; this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label2.Location = new System.Drawing.Point(3, 156); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(32, 13); this.label2.TabIndex = 2; this.label2.Text = "Title"; // // label6 // this.label6.AutoSize = true; this.label6.BackColor = System.Drawing.SystemColors.Control; this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label6.Location = new System.Drawing.Point(2, 4); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(39, 13); this.label6.TabIndex = 1; this.label6.Text = "Using"; // // tbUsing // this.tbUsing.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tbUsing.Location = new System.Drawing.Point(4, 25); this.tbUsing.Multiline = true; this.tbUsing.Name = "tbUsing"; this.tbUsing.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.tbUsing.Size = new System.Drawing.Size(310, 128); this.tbUsing.TabIndex = 0; // // tbLog // this.tbLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tbLog.Location = new System.Drawing.Point(3, 3); this.tbLog.Multiline = true; this.tbLog.Name = "tbLog"; this.tbLog.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.tbLog.Size = new System.Drawing.Size(871, 151); this.tbLog.TabIndex = 1; // // progressTimer // this.progressTimer.Interval = 500; this.progressTimer.Tick += new System.EventHandler(this.progressTimer_Tick); // // tbCode // this.tbCode.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tbCode.AutoCompleteBracketsList = new char[] { '(', ')', '{', '}', '[', ']', '\"', '\"', '\'', '\'' }; this.tbCode.AutoIndentCharsPatterns = "\r\n^\\s*[\\w\\.]+(\\s\\w+)?\\s*(?<range>=)\\s*(?<range>[^;]+);\r\n^\\s*(case|default)\\s*[^:]" + "*(?<range>:)\\s*(?<range>[^;]+);\r\n"; this.tbCode.AutoScrollMinSize = new System.Drawing.Size(27, 14); this.tbCode.BackBrush = null; this.tbCode.BracketsHighlightStrategy = FastColoredTextBoxNS.BracketsHighlightStrategy.Strategy2; this.tbCode.CharHeight = 14; this.tbCode.CharWidth = 8; this.tbCode.Cursor = System.Windows.Forms.Cursors.IBeam; this.tbCode.DisabledColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(180)))), ((int)(((byte)(180))))); this.tbCode.HighlightingRangeType = FastColoredTextBoxNS.HighlightingRangeType.AllTextRange; this.tbCode.IsReplaceMode = false; this.tbCode.Language = FastColoredTextBoxNS.Language.CSharp; this.tbCode.LeftBracket = '('; this.tbCode.LeftBracket2 = '{'; this.tbCode.Location = new System.Drawing.Point(7, 25); this.tbCode.Name = "tbCode"; this.tbCode.Paddings = new System.Windows.Forms.Padding(0); this.tbCode.RightBracket = ')'; this.tbCode.RightBracket2 = '}'; this.tbCode.SelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255))))); this.tbCode.Size = new System.Drawing.Size(540, 335); this.tbCode.TabIndex = 1; this.tbCode.Zoom = 100; // // CodeNowPluginControl // this.Controls.Add(this.splitContainer4); this.Name = "CodeNowPluginControl"; this.Size = new System.Drawing.Size(877, 561); this.Load += new System.EventHandler(this.CodeNowPluginControl_Load); this.splitContainer4.Panel1.ResumeLayout(false); this.splitContainer4.Panel2.ResumeLayout(false); this.splitContainer4.Panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit(); this.splitContainer4.ResumeLayout(false); this.panelCode.ResumeLayout(false); this.panelStart.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.toolStrip2.ResumeLayout(false); this.toolStrip2.PerformLayout(); this.splitContainerCode.Panel1.ResumeLayout(false); this.splitContainerCode.Panel1.PerformLayout(); this.splitContainerCode.Panel2.ResumeLayout(false); this.splitContainerCode.Panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainerCode)).EndInit(); this.splitContainerCode.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.tbCode)).EndInit(); this.ResumeLayout(false); }
private void InitializeComponent() { this.icontainer_0 = new Container(); ComponentResourceManager manager = new ComponentResourceManager(typeof(MainForm)); this.toolStrip1 = new ToolStrip(); this.btnOpenDirectory = new ToolStripButton(); this.toolStripSeparator1 = new ToolStripSeparator(); this.btnAddFile = new ToolStripButton(); this.btnDeleteFile = new ToolStripButton(); this.toolStripSeparator2 = new ToolStripSeparator(); this.btnAddCommand = new ToolStripButton(); this.btnEditCommand = new ToolStripButton(); this.btnDeleteCommnad = new ToolStripButton(); this.toolStripSeparator3 = new ToolStripSeparator(); this.btnSaveAll = new ToolStripButton(); this.toolStripSeparator4 = new ToolStripSeparator(); this.btnFindCommand = new ToolStripButton(); this.toolStripSeparator5 = new ToolStripSeparator(); this.btnHelp = new ToolStripButton(); this.statusStrip1 = new StatusStrip(); this.labCurrentPath = new ToolStripStatusLabel(); this.labMessage = new ToolStripStatusLabel(); this.treeView1 = new TreeView(); this.imageList_0 = new ImageList(this.icontainer_0); this.splitter1 = new Splitter(); this.panel1 = new Panel(); this.txtSQL = new SyntaxHighlighterControlFix(); this.splitter2 = new Splitter(); this.txtXML = new SyntaxHighlighterControlFix(); this.contextMenuStrip1 = new ContextMenuStrip(this.icontainer_0); this.menuAdd = new ToolStripMenuItem(); this.menuEdit = new ToolStripMenuItem(); this.menuDelete = new ToolStripMenuItem(); this.menuPaste = new ToolStripMenuItem(); this.toolStripMenuItem1 = new ToolStripSeparator(); this.menuCopyName = new ToolStripMenuItem(); this.menuCopyXml = new ToolStripMenuItem(); this.toolStripMenuItem2 = new ToolStripSeparator(); this.menuGenerateCallCode = new ToolStripMenuItem(); this.fileSystemWatcher_0 = new FileSystemWatcher(); this.timer_0 = new Timer(this.icontainer_0); this.toolStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.panel1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.fileSystemWatcher_0.BeginInit(); base.SuspendLayout(); this.toolStrip1.Items.AddRange(new ToolStripItem[] { this.btnOpenDirectory, this.toolStripSeparator1, this.btnAddFile, this.btnDeleteFile, this.toolStripSeparator2, this.btnAddCommand, this.btnEditCommand, this.btnDeleteCommnad, this.toolStripSeparator3, this.btnSaveAll, this.toolStripSeparator4, this.btnFindCommand, this.toolStripSeparator5, this.btnHelp }); this.toolStrip1.Location = new Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new Size(0x39b, 0x19); this.toolStrip1.TabIndex = 0; this.toolStrip1.Text = "toolStrip1"; // this.btnOpenDirectory.Image = Resources.openfolderHS; this.btnOpenDirectory.ImageTransparentColor = Color.Magenta; this.btnOpenDirectory.Name = "btnOpenDirectory"; this.btnOpenDirectory.Size = new Size(0x5c, 0x16); this.btnOpenDirectory.Text = "打开目录(&D)"; this.btnOpenDirectory.Click += new EventHandler(this.btnOpenDirectory_Click); this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new Size(6, 0x19); //this.btnAddFile.Image = Resources.NewFolderHS; this.btnAddFile.ImageTransparentColor = Color.Magenta; this.btnAddFile.Name = "btnAddFile"; this.btnAddFile.Size = new Size(0x5d, 0x16); this.btnAddFile.Text = "新增文件(&N)"; this.btnAddFile.Click += new EventHandler(this.btnAddFile_Click); //this.btnDeleteFile.Image = Resources.DeleteFolderHS; this.btnDeleteFile.ImageTransparentColor = Color.Magenta; this.btnDeleteFile.Name = "btnDeleteFile"; this.btnDeleteFile.Size = new Size(0x4b, 0x16); this.btnDeleteFile.Text = "删除文件"; this.btnDeleteFile.Click += new EventHandler(this.btnDeleteFile_Click); this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new Size(6, 0x19); // this.btnAddCommand.Image = Resources.NewDocumentHS; this.btnAddCommand.ImageTransparentColor = Color.Magenta; this.btnAddCommand.Name = "btnAddCommand"; this.btnAddCommand.Size = new Size(0x5b, 0x16); this.btnAddCommand.Text = "新增命令(&C)"; this.btnAddCommand.Click += new EventHandler(this.menuAdd_Click); //this.btnEditCommand.Image = (Image) manager.GetObject("btnEditCommand.Image"); this.btnEditCommand.ImageTransparentColor = Color.Magenta; this.btnEditCommand.Name = "btnEditCommand"; this.btnEditCommand.Size = new Size(90, 0x16); this.btnEditCommand.Text = "修改命令(&E)"; this.btnEditCommand.Click += new EventHandler(this.menuEdit_Click); // this.btnDeleteCommnad.Image = Resources.DeleteHS; this.btnDeleteCommnad.ImageTransparentColor = Color.Magenta; this.btnDeleteCommnad.Name = "btnDeleteCommnad"; this.btnDeleteCommnad.Size = new Size(0x4b, 0x16); this.btnDeleteCommnad.Text = "删除命令"; this.btnDeleteCommnad.Click += new EventHandler(this.menuDelete_Click); this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Size = new Size(6, 0x19); // this.btnSaveAll.Image = Resources.SaveAllHS; this.btnSaveAll.ImageTransparentColor = Color.Magenta; this.btnSaveAll.Name = "btnSaveAll"; this.btnSaveAll.Size = new Size(0x72, 0x16); this.btnSaveAll.Text = "保存所有修改(&S)"; this.btnSaveAll.Click += new EventHandler(this.btnSaveAll_Click); this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new Size(6, 0x19); // this.btnFindCommand.Image = Resources.FindHS; this.btnFindCommand.ImageTransparentColor = Color.Magenta; this.btnFindCommand.Name = "btnFindCommand"; this.btnFindCommand.Size = new Size(0x59, 0x16); this.btnFindCommand.Text = "查找命令(&F)"; this.btnFindCommand.Click += new EventHandler(this.btnFindCommand_Click); this.toolStripSeparator5.Name = "toolStripSeparator5"; this.toolStripSeparator5.Size = new Size(6, 0x19); this.btnHelp.DisplayStyle = ToolStripItemDisplayStyle.Image; // this.btnHelp.Image = Resources.Help; this.btnHelp.ImageTransparentColor = Color.Magenta; this.btnHelp.Name = "btnHelp"; this.btnHelp.Size = new Size(0x17, 0x16); this.btnHelp.Text = "帮助页面"; this.btnHelp.ToolTipText = "查看帮助页面"; this.btnHelp.Click += new EventHandler(this.btnHelp_Click); this.statusStrip1.Items.AddRange(new ToolStripItem[] { this.labCurrentPath, this.labMessage }); this.statusStrip1.Location = new Point(0, 0x1dd); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new Size(0x39b, 0x18); this.statusStrip1.TabIndex = 1; this.statusStrip1.Text = "statusStrip1"; this.labCurrentPath.BorderSides = ToolStripStatusLabelBorderSides.All; this.labCurrentPath.BorderStyle = Border3DStyle.SunkenOuter; this.labCurrentPath.ForeColor = Color.Tomato; this.labCurrentPath.IsLink = true; this.labCurrentPath.LinkBehavior = LinkBehavior.NeverUnderline; this.labCurrentPath.LinkColor = Color.Tomato; this.labCurrentPath.Name = "labCurrentPath"; this.labCurrentPath.Size = new Size(0x61, 0x13); this.labCurrentPath.Text = "labCurrentPath"; this.labCurrentPath.TextAlign = ContentAlignment.MiddleLeft; this.labCurrentPath.Click += new EventHandler(this.labCurrentPath_Click); this.labMessage.Name = "labMessage"; this.labMessage.Size = new Size(0x32b, 0x13); this.labMessage.Spring = true; this.labMessage.Text = "Ready."; this.labMessage.TextAlign = ContentAlignment.MiddleLeft; this.treeView1.Dock = DockStyle.Left; this.treeView1.ImageIndex = 0; this.treeView1.ImageList = this.imageList_0; this.treeView1.Location = new Point(0, 0x19); this.treeView1.Name = "treeView1"; this.treeView1.SelectedImageIndex = 0; this.treeView1.Size = new Size(0xe3, 0x1c4); this.treeView1.TabIndex = 2; this.treeView1.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseDoubleClick); this.treeView1.AfterSelect += new TreeViewEventHandler(this.treeView1_AfterSelect); this.treeView1.NodeMouseClick += new TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseClick); this.treeView1.KeyDown += new KeyEventHandler(this.treeView1_KeyDown); this.imageList_0.ColorDepth = ColorDepth.Depth8Bit; this.imageList_0.ImageSize = new Size(0x10, 0x10); this.imageList_0.TransparentColor = Color.Transparent; this.splitter1.Location = new Point(0xe3, 0x19); this.splitter1.Name = "splitter1"; this.splitter1.Size = new Size(7, 0x1c4); this.splitter1.TabIndex = 3; this.splitter1.TabStop = false; this.panel1.Controls.Add(this.txtSQL); this.panel1.Controls.Add(this.splitter2); this.panel1.Controls.Add(this.txtXML); this.panel1.Dock = DockStyle.Fill; this.panel1.Location = new Point(0xea, 0x19); this.panel1.Name = "panel1"; this.panel1.Size = new Size(0x2b1, 0x1c4); this.panel1.TabIndex = 4; this.txtSQL.Dock = DockStyle.Fill; this.txtSQL.Location = new Point(0, 0); this.txtSQL.Name = "txtSQL"; this.txtSQL.Size = new Size(0x2b1, 0xc0); this.txtSQL.TabIndex = 2; this.splitter2.Dock = DockStyle.Bottom; this.splitter2.Location = new Point(0, 0xc0); this.splitter2.Name = "splitter2"; this.splitter2.Size = new Size(0x2b1, 7); this.splitter2.TabIndex = 1; this.splitter2.TabStop = false; this.txtXML.Dock = DockStyle.Bottom; this.txtXML.SetLanguage("xml"); this.txtXML.Location = new Point(0, 0xc7); this.txtXML.Name = "txtXML"; this.txtXML.Size = new Size(0x2b1, 0xfd); this.txtXML.TabIndex = 0; this.contextMenuStrip1.Items.AddRange(new ToolStripItem[] { this.menuAdd, this.menuEdit, this.menuDelete, this.menuPaste, this.toolStripMenuItem1, this.menuCopyName, this.menuCopyXml, this.toolStripMenuItem2, this.menuGenerateCallCode }); this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Size = new Size(0xb3, 170); this.contextMenuStrip1.Opening += new CancelEventHandler(this.contextMenuStrip1_Opening); // this.menuAdd.Image = Resources.NewDocumentHS; this.menuAdd.Name = "menuAdd"; this.menuAdd.Size = new Size(0xb2, 0x16); this.menuAdd.Text = "新增命令"; this.menuAdd.Click += new EventHandler(this.menuAdd_Click); //this.menuEdit.Image = Resources.EditTableHS; this.menuEdit.Name = "menuEdit"; this.menuEdit.Size = new Size(0xb2, 0x16); this.menuEdit.Text = "修改命令"; this.menuEdit.Click += new EventHandler(this.menuEdit_Click); // this.menuDelete.Image = Resources.DeleteHS; this.menuDelete.Name = "menuDelete"; this.menuDelete.Size = new Size(0xb2, 0x16); this.menuDelete.Text = "删除命令"; this.menuDelete.Click += new EventHandler(this.menuDelete_Click); // this.menuPaste.Image = Resources.PasteHS; this.menuPaste.Name = "menuPaste"; this.menuPaste.Size = new Size(0xb2, 0x16); this.menuPaste.Text = "粘贴命令"; this.menuPaste.Click += new EventHandler(this.menuPaste_Click); this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Size = new Size(0xaf, 6); // this.menuCopyName.Image = Resources.CopyHS; this.menuCopyName.Name = "menuCopyName"; this.menuCopyName.Size = new Size(0xb2, 0x16); this.menuCopyName.Text = "复制名称 Ctrl-C"; this.menuCopyName.Click += new EventHandler(this.menuCopyName_Click); this.menuCopyXml.Name = "menuCopyXml"; this.menuCopyXml.Size = new Size(0xb2, 0x16); this.menuCopyXml.Text = "复制节点XML"; this.menuCopyXml.Click += new EventHandler(this.menuCopyXml_Click); this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Size = new Size(0xaf, 6); // this.menuGenerateCallCode.Image = Resources.Bitmap_0; this.menuGenerateCallCode.Name = "menuGenerateCallCode"; this.menuGenerateCallCode.Size = new Size(0xb2, 0x16); this.menuGenerateCallCode.Text = "生成调用代码 F12"; this.menuGenerateCallCode.Click += new EventHandler(this.menuGenerateCallCode_Click); this.fileSystemWatcher_0.EnableRaisingEvents = true; this.fileSystemWatcher_0.SynchronizingObject = this; this.fileSystemWatcher_0.Deleted += new FileSystemEventHandler(this.fileSystemWatcher_0_Changed); this.fileSystemWatcher_0.Created += new FileSystemEventHandler(this.fileSystemWatcher_0_Changed); this.fileSystemWatcher_0.Changed += new FileSystemEventHandler(this.fileSystemWatcher_0_Changed); this.timer_0.Enabled = true; this.timer_0.Interval = 500; this.timer_0.Tick += new EventHandler(this.timer_0_Tick); base.AutoScaleDimensions = new SizeF(6f, 12f); base.AutoScaleMode = AutoScaleMode.Font; base.ClientSize = new Size(0x39b, 0x1f5); base.Controls.Add(this.panel1); base.Controls.Add(this.splitter1); base.Controls.Add(this.treeView1); base.Controls.Add(this.statusStrip1); base.Controls.Add(this.toolStrip1); this.MinimumSize = new Size(700, 400); base.Name = "MainForm"; this.Text = "FastDBEngine XmlCommandTool"; base.WindowState = FormWindowState.Maximized; base.Load += new EventHandler(this.MainForm_Load); base.FormClosing += new FormClosingEventHandler(this.MainForm_FormClosing); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.panel1.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false); this.fileSystemWatcher_0.EndInit(); base.ResumeLayout(false); base.PerformLayout(); }
////////////////////////////////////////////////// // Public static methods ////////////////////////////////////////////////// #region Public static methods /// <summary> /// Clones the specified source tool strip menu item. /// </summary> /// <param name="sourceToolStripMenuItem">The source tool strip menu item.</param> /// <returns>A cloned version of the toolstrip menu item</returns> /// <exception cref="NotImplementedException">Menu item is not a ToolStripMenuItem or a ToolStripSeparatorr</exception> public static ToolStripMenuItem Clone(this ToolStripMenuItem sourceToolStripMenuItem) { ToolStripMenuItem menuItem = new ToolStripMenuItem(); var propInfoList = from p in typeof(ToolStripMenuItem).GetProperties() let attributes = p.GetCustomAttributes(true) let notBrowseable = (from a in attributes where a.GetType() == typeof(BrowsableAttribute) select !(a as BrowsableAttribute).Browsable).FirstOrDefault() where !notBrowseable && p.CanRead && p.CanWrite && p.Name != "DropDown" orderby p.Name select p; // Copy over using reflections foreach (var propertyInfo in propInfoList) { object propertyInfoValue = propertyInfo.GetValue(sourceToolStripMenuItem, null); propertyInfo.SetValue(menuItem, propertyInfoValue, null); } // Create a new menu name menuItem.Name = sourceToolStripMenuItem.Name + "-" + menuNameCounter++; // Process any other properties if (sourceToolStripMenuItem.ImageIndex != -1) { menuItem.ImageIndex = sourceToolStripMenuItem.ImageIndex; } if (!string.IsNullOrEmpty(sourceToolStripMenuItem.ImageKey)) { menuItem.ImageKey = sourceToolStripMenuItem.ImageKey; } // We need to make this visible menuItem.Visible = true; // Recursively clone the drop down list foreach (var item in sourceToolStripMenuItem.DropDownItems) { ToolStripItem newItem; if (item is ToolStripMenuItem) { newItem = ((ToolStripMenuItem)item).Clone(); } else if (item is ToolStripSeparator) { newItem = new ToolStripSeparator(); } else { throw new NotImplementedException("Menu item is not a ToolStripMenuItem or a ToolStripSeparatorr"); } menuItem.DropDownItems.Add(newItem); } // The handler list starts empty because we created its parent via a new // So this is equivalen to a copy. menuItem.AddHandlers(sourceToolStripMenuItem); return(menuItem); }
public ShowMetadataMenu(ToolStripMenuItem i) { item = i; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SystrayForm)); this.notifyIconMain = new System.Windows.Forms.NotifyIcon(this.components); this.contextMenuStripSysTray = new System.Windows.Forms.ContextMenuStrip(this.components); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.captureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.restoreToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pauseResumeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.manageLayoutProfile = new ToolStripMenuItem(); for (int i = 0; i < 4; ++i) { this.toolStripMenuItem[i] = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItem[i].Name = $"toolStripMenuItem{i}"; this.toolStripMenuItem[i].Size = new System.Drawing.Size(132, 6); } this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStripSysTray.SuspendLayout(); this.SuspendLayout(); // // notifyIconMain // this.notifyIconMain.ContextMenuStrip = this.contextMenuStripSysTray; //this.notifyIconMain.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIconMain.Icon"))); this.notifyIconMain.Icon = Properties.Resources.pwIcon; this.notifyIconMain.Text = $"{Application.ProductName} {Application.ProductVersion}"; this.notifyIconMain.BalloonTipTitle = ""; this.notifyIconMain.BalloonTipText = "Please wait while restoring windows"; this.notifyIconMain.BalloonTipIcon = ToolTipIcon.Info; this.notifyIconMain.Visible = true; this.notifyIconMain.MouseClick += new System.Windows.Forms.MouseEventHandler(this.IconMouseClick); this.notifyIconMain.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.IconMouseDoubleClick); // // contextMenuStripSysTray // this.contextMenuStripSysTray.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { /* * this.manageLayoutProfile, * this.toolStripMenuItem[3], */ this.captureToolStripMenuItem, this.restoreToolStripMenuItem, this.toolStripMenuItem[0], this.pauseResumeToolStripMenuItem, this.toolStripMenuItem[1], this.aboutToolStripMenuItem, this.toolStripMenuItem[2], this.exitToolStripMenuItem }); this.contextMenuStripSysTray.Name = "contextMenuStripSysTray"; this.contextMenuStripSysTray.Size = new System.Drawing.Size(136, 108); // manage layout profiles this.manageLayoutProfile.Name = "manage layout"; this.manageLayoutProfile.Size = new System.Drawing.Size(135, 22); this.manageLayoutProfile.Text = "&Manage layout profiles"; this.manageLayoutProfile.Click += new System.EventHandler(this.ManageLayoutProfileClickHandler); // capture // this.captureToolStripMenuItem.Name = "capture"; this.captureToolStripMenuItem.Size = new System.Drawing.Size(135, 22); this.captureToolStripMenuItem.Text = "&Capture windows to disk"; this.captureToolStripMenuItem.Click += new System.EventHandler(this.CaptureWindowClickHandler); // restore // this.restoreToolStripMenuItem.Name = "restore"; this.restoreToolStripMenuItem.Size = new System.Drawing.Size(135, 22); this.restoreToolStripMenuItem.Text = "&Restore windows from disk"; this.restoreToolStripMenuItem.Click += new System.EventHandler(this.RestoreWindowClickHandler); // suspend/resume auto restore // this.pauseResumeToolStripMenuItem.Name = "suspend/resume"; this.pauseResumeToolStripMenuItem.Size = new System.Drawing.Size(135, 22); this.pauseResumeToolStripMenuItem.Text = "&Pause auto restore"; this.pauseResumeToolStripMenuItem.Click += new System.EventHandler(this.PauseResumeAutoRestore); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; this.aboutToolStripMenuItem.Size = new System.Drawing.Size(135, 22); this.aboutToolStripMenuItem.Text = "&About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.AboutToolStripMenuItemClickHandler); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Size = new System.Drawing.Size(135, 22); this.exitToolStripMenuItem.Text = "&Exit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitToolStripMenuItemClickHandler); // // SystrayForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 261); this.Name = "SystrayForm"; this.contextMenuStripSysTray.ResumeLayout(false); this.ResumeLayout(false); }
private void InitMenu() { //ChooseDataSource if (this is IDB) { this.chooseDataBaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.chooseDataBaseToolStripMenuItem.Name = "chooseDataBaseToolStripMenuItem"; this.chooseDataBaseToolStripMenuItem.Size = new System.Drawing.Size(162, 22); this.chooseDataBaseToolStripMenuItem.Text = "ChooseDataBase"; this.chooseDataBaseToolStripMenuItem.Click += chooseDataBaseToolStripMenuItem_Click; this.TopContextMenu.Items.Add(this.chooseDataBaseToolStripMenuItem); } //Format if (this.TopContextMenu.Items.Count != 0) { ToolStripSeparator file1Splitor = new ToolStripSeparator(); this.TopContextMenu.Items.Add(file1Splitor); } if (this is IFormat) { this.FormatFileToolStripMenuItem = new ToolStripMenuItem(); this.FormatFileToolStripMenuItem.Name = "formatFileToolStripMenuItem"; this.FormatFileToolStripMenuItem.Size = new System.Drawing.Size(162, 22); this.FormatFileToolStripMenuItem.Text = "Format File"; this.FormatFileToolStripMenuItem.Click += FormatFileToolStripMenuItem_Click; this.TopContextMenu.Items.Add(this.FormatFileToolStripMenuItem); } if (this is IFormat || this is IFile) { //Save this.SaveFileToolStripMenuItem = new ToolStripMenuItem(); this.SaveFileToolStripMenuItem.Name = "saveFileToolStripMenuItem"; this.SaveFileToolStripMenuItem.Size = new System.Drawing.Size(162, 22); this.SaveFileToolStripMenuItem.Text = "Save"; this.SaveFileToolStripMenuItem.Click += SaveFileToolStripMenuItem_Click; this.TopContextMenu.Items.Add(this.SaveFileToolStripMenuItem); //Save As this.SaveFileAsToolStripMenuItem = new ToolStripMenuItem(); this.SaveFileAsToolStripMenuItem.Name = "saveFileAsToolStripMenuItem"; this.SaveFileAsToolStripMenuItem.Size = new System.Drawing.Size(162, 22); this.SaveFileAsToolStripMenuItem.Text = "Save As"; this.SaveFileAsToolStripMenuItem.Click += SaveFileAsToolStripMenuItem_Click; this.TopContextMenu.Items.Add(this.SaveFileAsToolStripMenuItem); } if (this.TopContextMenu.Items.Count > 0 && !(this.TopContextMenu.Items[this.TopContextMenu.Items.Count - 1] is ToolStripSeparator)) { ToolStripSeparator closeSplitor = new ToolStripSeparator(); this.TopContextMenu.Items.Add(closeSplitor); } //Close Me this.closeMeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.closeMeToolStripMenuItem.Name = "menuItemCloseMe"; this.closeMeToolStripMenuItem.Size = new System.Drawing.Size(141, 22); this.closeMeToolStripMenuItem.Text = "Close"; this.closeMeToolStripMenuItem.Click += new System.EventHandler(this.CloseMeToolStripMenuItem_Click); this.TopContextMenu.Items.Add(this.closeMeToolStripMenuItem); //Close Others this.closeOthersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.closeOthersToolStripMenuItem.Name = "menuItemCloseOthers"; this.closeOthersToolStripMenuItem.Size = new System.Drawing.Size(141, 22); this.closeOthersToolStripMenuItem.Text = "Close Others"; this.closeOthersToolStripMenuItem.Click += new System.EventHandler(this.CloseOtherToolStripMenuItem_Click); this.TopContextMenu.Items.Add(this.closeOthersToolStripMenuItem); //Close All this.closeAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.closeAllToolStripMenuItem.Name = "menuItemCLoseAll"; this.closeAllToolStripMenuItem.Size = new System.Drawing.Size(141, 22); this.closeAllToolStripMenuItem.Text = "Close All"; this.closeAllToolStripMenuItem.Click += new System.EventHandler(this.CloseAllToolStripMenuItem_Click); this.TopContextMenu.Items.Add(this.closeAllToolStripMenuItem); if (this is IFile) { ToolStripSeparator file2Splitor = new ToolStripSeparator(); this.TopContextMenu.Items.Add(file2Splitor); //Open File Location this.OpenFileLocationToolStripMenuItem = new ToolStripMenuItem(); this.OpenFileLocationToolStripMenuItem.Name = "openFileLocationToolStripMenuItem"; this.OpenFileLocationToolStripMenuItem.Size = new System.Drawing.Size(162, 22); this.OpenFileLocationToolStripMenuItem.Text = "Open File Location"; this.OpenFileLocationToolStripMenuItem.Click += OpenFileLocationToolStripMenuItem_Click; this.TopContextMenu.Items.Add(this.OpenFileLocationToolStripMenuItem); //Reload File this.ReloadFileToolStripMenuItem = new ToolStripMenuItem(); this.ReloadFileToolStripMenuItem.Name = "reloadFileToolStripMenuItem"; this.ReloadFileToolStripMenuItem.Size = new System.Drawing.Size(162, 22); this.ReloadFileToolStripMenuItem.Text = "Reload File"; this.ReloadFileToolStripMenuItem.Click += ReloadFileToolStripMenuItem_Click; this.TopContextMenu.Items.Add(this.ReloadFileToolStripMenuItem); } }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Windows.Forms.ToolStripSeparator toolStripSeparator2; this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.enableMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.goToMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.deleteMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.clearAllMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.addMenuItem = new System.Windows.Forms.ToolStripMenuItem(); toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.contextMenu.SuspendLayout(); this.SuspendLayout(); // // toolStripSeparator2 // toolStripSeparator2.Name = "toolStripSeparator2"; toolStripSeparator2.Size = new System.Drawing.Size(166, 6); // // contextMenu // this.contextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addMenuItem, toolStripSeparator2, this.enableMenuItem, this.editMenuItem, this.goToMenuItem, this.toolStripSeparator1, this.deleteMenuItem, this.clearAllMenuItem }); this.contextMenu.Name = "contextMenu"; this.contextMenu.Size = new System.Drawing.Size(170, 126); // // enableMenuItem // this.enableMenuItem.Name = "enableMenuItem"; this.enableMenuItem.Size = new System.Drawing.Size(169, 22); this.enableMenuItem.Text = "Enable Breakpoint"; // // editMenuItem // this.editMenuItem.Name = "editMenuItem"; this.editMenuItem.Size = new System.Drawing.Size(169, 22); this.editMenuItem.Text = "Edit Breakpoint..."; // // goToMenuItem // this.goToMenuItem.Name = "goToMenuItem"; this.goToMenuItem.Size = new System.Drawing.Size(169, 22); this.goToMenuItem.Text = "Go To Breakpoint"; // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(166, 6); // // deleteMenuItem // this.deleteMenuItem.Name = "deleteMenuItem"; this.deleteMenuItem.Size = new System.Drawing.Size(169, 22); this.deleteMenuItem.Text = "Delete Breakpoint"; // // clearAllMenuItem // this.clearAllMenuItem.Name = "clearAllMenuItem"; this.clearAllMenuItem.Size = new System.Drawing.Size(169, 22); this.clearAllMenuItem.Text = "Clear All"; // // addMenuItem // this.addMenuItem.Name = "addMenuItem"; this.addMenuItem.Size = new System.Drawing.Size(169, 22); this.addMenuItem.Text = "Add New..."; this.contextMenu.ResumeLayout(false); this.ResumeLayout(false); }
private void CreateMenu(CommandGroup [] groups) { _menuStrip = new MenuStrip (); _pluginMenu = new ToolStripMenuItem ("Plugins"); foreach (CommandGroup cg in groups) { var topItem = new ToolStripMenuItem (cg.Name); topItem.DropDownItems.AddRange (cg.Items.Select (x => new ToolStripMenuItem (x.Name, null, x.Event)).ToArray()); _menuStrip.Items.Add (topItem); } _menuStrip.Items.Add (_pluginMenu); CollectPlugins (); MainMenuStrip = _menuStrip; }
private void mViewAmpl0_Click(object sender, EventArgs e) { try { ToolStripMenuItem mi = mViewAmpl0; if (sender == mi) { if (mi.Checked == false) { PowFactor = 1; mi.Checked = true; } } else { mi.Checked = false; } mi = mViewAmpl1; if (sender == mi) { if (mi.Checked == false) { PowFactor = 0.5; mi.Checked = true; } } else { mi.Checked = false; } mi = mViewAmpl2; if (sender == mi) { if (mi.Checked == false) { PowFactor = 0.2; mi.Checked = true; } } else { mi.Checked = false; } mi = mViewAmpl3; if (sender == mi) { if (mi.Checked == false) { PowFactor = 0.1; mi.Checked = true; } } else { mi.Checked = false; } mi = mViewAmpl4; if (sender == mi) { if (mi.Checked == false) { PowFactor = 0.05; mi.Checked = true; } } else { mi.Checked = false; } ReDraw(); } catch (Exception ex) { Common.Log(ex); } }
public MainForm () { // // menuStrip // menuStrip = new MenuStrip (); menuStrip.Location = new Point (0, 0); menuStrip.Size = new Size (632, 24); menuStrip.TabIndex = 0; menuStrip.Text = "MenuStrip"; Controls.Add (menuStrip); // // fileMenu // fileMenu = new ToolStripMenuItem (); fileMenu.ImageTransparentColor = SystemColors.ActiveBorder; fileMenu.Size = new Size (35, 20); fileMenu.MergeAction = MergeAction.Append; fileMenu.MergeIndex = 1; fileMenu.Text = "&File"; fileMenu.DropDownOpened += new EventHandler (FileMenu_DropDownOpened); menuStrip.Items.Add (fileMenu); // // openToolStripMenuItem // openToolStripMenuItem = new ToolStripMenuItem (); openToolStripMenuItem.ShortcutKeys = ((Keys) ((Keys.Control | Keys.O))); openToolStripMenuItem.Size = new Size (151, 22); openToolStripMenuItem.Text = "&Open"; openToolStripMenuItem.Click += new EventHandler (OpenFile); openToolStripMenuItem.MergeAction = MergeAction.Append; openToolStripMenuItem.MergeIndex = 2; fileMenu.DropDownItems.Add (openToolStripMenuItem); // // toolStripSeparator4 // toolStripSeparator4 = new ToolStripSeparator (); toolStripSeparator4.Size = new Size (148, 6); toolStripSeparator4.MergeAction = MergeAction.Append; toolStripSeparator4.MergeIndex = 7; // // exitToolStripMenuItem // exitToolStripMenuItem = new ToolStripMenuItem (); exitToolStripMenuItem.Size = new Size (151, 22); exitToolStripMenuItem.Text = "E&xit"; exitToolStripMenuItem.Click += new EventHandler (ExitToolsStripMenuItem_Click); exitToolStripMenuItem.MergeAction = MergeAction.Append; exitToolStripMenuItem.MergeIndex = 11; fileMenu.DropDownItems.Add (exitToolStripMenuItem); // // windowsMenu // windowsMenu = new ToolStripMenuItem (); windowsMenu.Size = new Size (62, 20); windowsMenu.Text = "&Windows"; menuStrip.MdiWindowListItem = windowsMenu; menuStrip.Items.Add (windowsMenu); // // cascadeToolStripMenuItem // cascadeToolStripMenuItem = new ToolStripMenuItem (); cascadeToolStripMenuItem.Size = new Size (153, 22); cascadeToolStripMenuItem.Text = "&Cascade"; cascadeToolStripMenuItem.Click += new EventHandler (CascadeToolStripMenuItem_Click); windowsMenu.DropDownItems.Add (cascadeToolStripMenuItem); // // tileVerticalToolStripMenuItem // tileVerticalToolStripMenuItem = new ToolStripMenuItem (); tileVerticalToolStripMenuItem.Size = new Size (153, 22); tileVerticalToolStripMenuItem.Text = "Tile &Vertical"; windowsMenu.DropDownItems.Add (tileVerticalToolStripMenuItem); // // tileHorizontalToolStripMenuItem // tileHorizontalToolStripMenuItem = new ToolStripMenuItem (); tileHorizontalToolStripMenuItem.Size = new Size (153, 22); tileHorizontalToolStripMenuItem.Text = "Tile &Horizontal"; tileHorizontalToolStripMenuItem.Click += new EventHandler (TileHorizontalToolStripMenuItem_Click); windowsMenu.DropDownItems.Add (tileHorizontalToolStripMenuItem); // // closeAllToolStripMenuItem // closeAllToolStripMenuItem = new ToolStripMenuItem (); closeAllToolStripMenuItem.Size = new Size (153, 22); closeAllToolStripMenuItem.Text = "C&lose All"; closeAllToolStripMenuItem.Click += new EventHandler (CloseAllToolStripMenuItem_Click); windowsMenu.DropDownItems.Add (closeAllToolStripMenuItem); // // arrangeIconsToolStripMenuItem // arrangeIconsToolStripMenuItem = new ToolStripMenuItem (); arrangeIconsToolStripMenuItem.Size = new Size (153, 22); arrangeIconsToolStripMenuItem.Text = "&Arrange Icons"; arrangeIconsToolStripMenuItem.Click += new EventHandler (ArrangeIconsToolStripMenuItem_Click); windowsMenu.DropDownItems.Add (arrangeIconsToolStripMenuItem); // // MainForm // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size (400, 300); IsMdiContainer = true; Location = new Point (200, 100); MainMenuStrip = menuStrip; StartPosition = FormStartPosition.Manual; Text = "bug #82374"; Load += new EventHandler (MainForm_Load); }
void ReloadMenu() { Func <Action, ToolStripMenuItem> create_menu_item_from_commands = (a) => { var item = new ToolStripMenuItem(); var attributes = a.Method.GetCustomAttributes(false); var uniquename = UniqueNameAttribute.GetUniqueName(attributes); item.Text = NameAttribute.GetName(attributes); item.ShowShortcutKeys = true; item.ShortcutKeyDisplayString = Shortcuts.GetShortcutText(uniquename); item.Click += (object sender, EventArgs e) => { a(); }; return(item); }; this.menuStrip.SuspendLayout(); this.SuspendLayout(); { var menu = new ToolStripMenuItem("ファイル"); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.New)); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.Open)); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.Overwrite)); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.SaveAs)); menu.DropDownItems.Add(new ToolStripSeparator()); { var import_menu = new ToolStripMenuItem("入力"); for (int c = 0; c < Core.ImportScripts.Count; c++) { var item = new ToolStripMenuItem(); var script = Core.ImportScripts[c]; item.Text = script.Title; item.Click += (object _sender, EventArgs _e) => { OpenFileDialog ofd = new OpenFileDialog(); ofd.InitialDirectory = System.IO.Directory.GetCurrentDirectory(); ofd.Filter = script.Filter; ofd.FilterIndex = 2; ofd.Multiselect = false; if (ofd.ShowDialog() == DialogResult.OK) { var filepath = ofd.FileName; script.Function(filepath); System.IO.Directory.SetCurrentDirectory(System.IO.Path.GetDirectoryName(filepath)); } else { return; } }; import_menu.DropDownItems.Add(item); } menu.DropDownItems.Add(import_menu); } { var export_menu = new ToolStripMenuItem("出力"); for (int c = 0; c < Core.ExportScripts.Count; c++) { var item = new ToolStripMenuItem(); var script = Core.ExportScripts[c]; item.Text = script.Title; item.Click += (object _sender, EventArgs _e) => { SaveFileDialog ofd = new SaveFileDialog(); ofd.InitialDirectory = System.IO.Directory.GetCurrentDirectory(); ofd.Filter = script.Filter; ofd.FilterIndex = 2; ofd.OverwritePrompt = true; if (ofd.ShowDialog() == DialogResult.OK) { var filepath = ofd.FileName; script.Function(filepath); System.IO.Directory.SetCurrentDirectory(System.IO.Path.GetDirectoryName(filepath)); } else { return; } }; export_menu.DropDownItems.Add(item); } menu.DropDownItems.Add(export_menu); } menu.DropDownItems.Add(new ToolStripSeparator()); { ReloadRecentFiles(); menu.DropDownItems.Add(recentFiles); } menu.DropDownItems.Add(new ToolStripSeparator()); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.Exit)); menuStrip.Items.Add(menu); } { var menu = new ToolStripMenuItem("編集"); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.AddNode)); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.InsertNode)); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.RemoveNode)); menu.DropDownItems.Add(new ToolStripSeparator()); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.Copy)); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.Paste)); menu.DropDownItems.Add(new ToolStripSeparator()); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.Undo)); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.Redo)); menuStrip.Items.Add(menu); } { var menu = new ToolStripMenuItem("表示"); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.Play)); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.Stop)); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.Step)); menuStrip.Items.Add(menu); } /* * { * var menu = new ToolStripMenuItem("全体処理"); * * for (int c = 0; c < Core.CommandScripts.Count; c++) * { * var command_item = new ToolStripMenuItem(); * var command = Core.CommandScripts[c]; * command_item.Text = command.Title; * command_item.Click += (object _sender, EventArgs _e) => * { * command.Function(); * }; * menu.DropDownItems.Add(command_item); * } * * menuStrip.Items.Add(menu); * } * * { * var menu = new ToolStripMenuItem("選択部処理"); * for (int c = 0; c < Core.SelectedScripts.Count; c++) * { * var command_item = new ToolStripMenuItem(); * var command = Core.SelectedScripts[c]; * command_item.Text = command.Title; * command_item.Click += (object _sender, EventArgs _e) => * { * command.Function(Core.SelectedNode, null); * }; * menu.DropDownItems.Add(command_item); * } * * menuStrip.Items.Add(menu); * } */ { var menu = new ToolStripMenuItem("ウインドウ"); { var item = new ToolStripMenuItem(); item.Text = "ウインドウ位置を初期化"; item.Click += (object sender, EventArgs e) => { GUIManager.CloseDockWindow(); GUIManager.AssignDockWindowIntoDefaultPosition(); }; menu.DropDownItems.Add(item); } Action <string, Type> setDockWindow = (s, t) => { var item = new ToolStripMenuItem(); item.Text = s; item.Click += (object sender, EventArgs e) => { GUIManager.SelectOrShowWindow(t); }; menu.DropDownItems.Add(item); }; setDockWindow("ノードツリー", typeof(DockNodeTreeView)); setDockWindow("共通", typeof(DockNodeCommonValues)); setDockWindow("位置", typeof(DockNodeLocationValues)); setDockWindow("絶対位置", typeof(DockNodeLocationAbsValues)); setDockWindow("生成位置", typeof(DockNodeGenerationLocationValues)); setDockWindow("回転", typeof(DockNodeRotationValues)); setDockWindow("拡大", typeof(DockNodeScaleValues)); setDockWindow("描画共通", typeof(DockNodeRendererCommonValues)); setDockWindow("描画", typeof(DockNodeRendererValues)); setDockWindow("音", typeof(DockNodeSoundValues)); setDockWindow("Fカーブ", typeof(DockFCurves)); setDockWindow("ビュワー操作", typeof(DockViewerController)); setDockWindow("視点操作", typeof(DockViewPoint)); setDockWindow("録画", typeof(DockRecorder)); setDockWindow("オプション", typeof(DockOption)); setDockWindow("振る舞い", typeof(DockEffectBehavior)); setDockWindow("カリング", typeof(DockCulling)); setDockWindow("ネットワーク", typeof(DockNetwork)); menuStrip.Items.Add(menu); } { var menu = new ToolStripMenuItem("ヘルプ"); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.ViewHelp)); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.OpenSample)); menu.DropDownItems.Add(new ToolStripSeparator()); menu.DropDownItems.Add(create_menu_item_from_commands(Commands.About)); menuStrip.Items.Add(menu); } this.menuStrip.ResumeLayout(false); this.menuStrip.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
public ShowDomainsDomainRelatedDomainsItemMenu(ToolStripMenuItem i) { item = i; }
private void AddToolStripMenuItem(ToolStripMenuItem MenuItem, string Text, object Tag, ToolStropMenuItemClickHandler ClickHandler) { AddToolStripMenuItem(MenuItem, Text, Tag, ClickHandler, false); }
private void btnIcon_Click(object sender, System.Windows.Forms.MouseEventArgs e) { try { if (this.pGrid.SelectedObject is Info) { this.cMenIcons.Items.Clear(); foreach (string iStr in mRemoteNC.Connection.Icon.Icons) { ToolStripMenuItem tI = new ToolStripMenuItem(); tI.Text = iStr; tI.Image = mRemoteNC.Connection.Icon.FromString(iStr).ToBitmap(); tI.Click += new System.EventHandler(IconMenu_Click); this.cMenIcons.Items.Add(tI); } Point mPos = PointToScreen(new Point(e.Location.X + this.pGrid.Width - 100, e.Location.Y)); this.cMenIcons.Show(mPos); } } catch (Exception ex) { Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strConfigPropertyGridButtonIconClickFailed + Constants.vbNewLine + ex.Message, true); } }
void item_MouseEnter(object sender, EventArgs e) { ToolStripMenuItem m = sender as ToolStripMenuItem; m.ShowDropDown(); }
public ShowDomainsDomainItemMenu(ToolStripMenuItem i) { item = i; }
public RentCarMenuStrip() : base() { var itemVehiculos = new ToolStripMenuItem("Vehiculos"); itemVehiculos.Click += (s, ev) => { var vehiculos = new VehiculosMain(); if (this.Parent is Form) { (this.Parent as Form).Close(); } vehiculos.Show(); }; this.Items.Add(itemVehiculos); var itemEmpleados = new ToolStripMenuItem("Empleados"); itemEmpleados.Click += (s, ev) => { var empleados = new EmpleadosMain(); if (this.Parent is Form) { (this.Parent as Form).Close(); } empleados.Show(); }; this.Items.Add(itemEmpleados); var itemClientes = new ToolStripMenuItem("Clientes"); itemClientes.Click += (s, ev) => { var clientes = new ClientesMain(); if (this.Parent is Form) { (this.Parent as Form).Close(); } clientes.Show(); }; this.Items.Add(itemClientes); var itemTipos = new ToolStripMenuItem("Tipos de vehiculos"); itemTipos.Click += (s, ev) => { var tipoVehi = new TiposDeVehiculo(); if (this.Parent is Form) { (this.Parent as Form).Close(); } tipoVehi.Show(); }; this.Items.Add(itemTipos); var itemMarcas = new ToolStripMenuItem("Marcas"); itemMarcas.Click += (s, ev) => { var marcas = new MarcasMain(); if (this.Parent is Form) { (this.Parent as Form).Close(); } marcas.Show(); }; this.Items.Add(itemMarcas); var itemModelos = new ToolStripMenuItem("Modelos"); itemModelos.Click += (s, ev) => { var modelos = new ModelosMain(); if (this.Parent is Form) { (this.Parent as Form).Close(); } modelos.Show(); }; this.Items.Add(itemModelos); var itemTiposCombus = new ToolStripMenuItem("Tipos de Combustibles"); itemTiposCombus.Click += (s, ev) => { var tipoComb = new TiposCombustibleMain(); if (this.Parent is Form) { (this.Parent as Form).Close(); } tipoComb.Show(); }; this.Items.Add(itemTiposCombus); var itemInspecciones = new ToolStripMenuItem("Inspecciones"); itemInspecciones.Click += (s, ev) => { var inspecciones = new InspeccionesMain(); if (this.Parent is Form) { (this.Parent as Form).Close(); } inspecciones.Show(); }; this.Items.Add(itemInspecciones); var itemRentas = new ToolStripMenuItem("Rentas"); itemRentas.Click += (s, ev) => { var rentas = new RentasMain(); if (this.Parent is Form) { (this.Parent as Form).Close(); } rentas.Show(); }; this.Items.Add(itemRentas); var itemReportes = new ToolStripMenuItem("Reportes"); itemReportes.Click += (s, ev) => { var reportes = new ReportesMain(); if (this.Parent is Form) { (this.Parent as Form).Close(); } reportes.Show(); }; this.Items.Add(itemReportes); }
public ShowNetworkIpRangeMenu(ToolStripMenuItem i) { item = i; }
public Global(ToolStripMenuItem i) { item = i; }
private void CreateChartContextMenu() { ChartToolZoomOut = new ToolStripMenuItem("Zoom Out"); ChartToolZoomOutSeparator = new ToolStripSeparator(); ChartToolSelect = new ToolStripMenuItem("Select"); ChartToolZoom = new ToolStripMenuItem("Zoom"); ChartToolZoomX = new ToolStripMenuItem("Zoom XAxis"); ChartToolPan = new ToolStripMenuItem("Pan"); ChartContextSeparator = new ToolStripSeparator(); MenuItems = new List<ToolStripItem>(); MenuItems.Add(ChartToolZoomOut); MenuItems.Add(ChartToolZoomOutSeparator); MenuItems.Add(ChartToolSelect); MenuItems.Add(ChartToolZoom); MenuItems.Add(ChartToolZoomX); MenuItems.Add(ChartToolPan); MenuItems.Add(ChartContextSeparator); StateMenu = new Dictionary<MSChartExtensionToolState, ToolStripMenuItem> { {MSChartExtensionToolState.Select, ChartToolSelect}, {MSChartExtensionToolState.Pan, ChartToolPan}, {MSChartExtensionToolState.Zoom, ChartToolZoom}, {MSChartExtensionToolState.ZoomX, ChartToolZoomX} }; }
/// <summary> /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(""); System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem(""); System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem(""); System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem(""); System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem(""); System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem(""); System.Windows.Forms.ListViewItem listViewItem7 = new System.Windows.Forms.ListViewItem("", 0); this.listView1 = new System.Windows.Forms.ListView(); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.contextMenuStrip1 = new System.Windows.Forms.ClassicContextMenuStrip(); this.ts_OpenFile = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); this.OpenWithNotePad = new System.Windows.Forms.ToolStripMenuItem(); this.cms_ExplorerFile = new System.Windows.Forms.ToolStripMenuItem(); this.saveAs1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); this.复制ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.cms_DeleteFile = new System.Windows.Forms.ToolStripMenuItem(); this.cms_ReNameFile = new System.Windows.Forms.ToolStripMenuItem(); this.imageList1 = new System.Windows.Forms.ImageList(); this.toolTip1 = new System.Windows.Forms.ToolTip(); this.contextMenuStrip2 = new System.Windows.Forms.ClassicContextMenuStrip(); this.查看VToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.largeIcon1 = new System.Windows.Forms.RadioMenuItem(); this.smallIcon1 = new System.Windows.Forms.RadioMenuItem(); this.list1 = new System.Windows.Forms.RadioMenuItem(); this.tile1 = new System.Windows.Forms.RadioMenuItem(); this.details1 = new System.Windows.Forms.RadioMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.添加附件AToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openCurrentDir = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.cms_Refresh = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); this.cms_SelectAll = new System.Windows.Forms.ToolStripMenuItem(); this.fileSystemWatcher1 = new System.IO.FileSystemWatcher(); this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).BeginInit(); this.SuspendLayout(); // // listView1 // this.listView1.AllowDrop = true; this.listView1.BackColor = System.Drawing.Color.White; this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, this.columnHeader2, this.columnHeader3, this.columnHeader4, this.columnHeader5}); this.listView1.ContextMenuStrip = this.contextMenuStrip1; this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; this.listView1.Font = new System.Drawing.Font("微软雅黑", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.listView1.FullRowSelect = true; this.listView1.HideSelection = false; this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] { listViewItem1, listViewItem2, listViewItem3, listViewItem4, listViewItem5, listViewItem6, listViewItem7}); this.listView1.Location = new System.Drawing.Point(0, 0); this.listView1.Name = "listView1"; this.listView1.ShowGroups = false; this.listView1.ShowItemToolTips = true; this.listView1.Size = new System.Drawing.Size(655, 356); this.listView1.Sorting = System.Windows.Forms.SortOrder.Ascending; this.listView1.TabIndex = 4; this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.View = System.Windows.Forms.View.Details; this.listView1.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView1_ColumnClick); this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); this.listView1.DoubleClick += new System.EventHandler(this.打开_Click); this.listView1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseUp); // // columnHeader1 // this.columnHeader1.Text = "文件名"; this.columnHeader1.Width = 189; // // columnHeader2 // this.columnHeader2.Text = "修改时间"; this.columnHeader2.Width = 100; // // columnHeader3 // this.columnHeader3.Text = "大小"; this.columnHeader3.Width = 99; // // columnHeader4 // this.columnHeader4.Text = "路径"; this.columnHeader4.Width = 170; // // columnHeader5 // this.columnHeader5.Text = "类型"; this.columnHeader5.Width = 93; // // contextMenuStrip1 // this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ts_OpenFile, this.toolStripMenuItem1, this.OpenWithNotePad, this.cms_ExplorerFile, this.saveAs1, this.toolStripMenuItem2, this.复制ToolStripMenuItem, this.cms_DeleteFile, this.cms_ReNameFile}); this.contextMenuStrip1.Name = "contextMenuStrip_ListView"; this.contextMenuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; this.contextMenuStrip1.Size = new System.Drawing.Size(189, 170); this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening); // // ts_OpenFile // this.ts_OpenFile.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Bold); this.ts_OpenFile.Name = "ts_OpenFile"; this.ts_OpenFile.Size = new System.Drawing.Size(188, 22); this.ts_OpenFile.Text = "打开(&O)"; this.ts_OpenFile.Click += new System.EventHandler(this.打开_Click); // // toolStripMenuItem1 // this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Size = new System.Drawing.Size(185, 6); // // OpenWithNotePad // this.OpenWithNotePad.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F); this.OpenWithNotePad.Name = "OpenWithNotePad"; this.OpenWithNotePad.Size = new System.Drawing.Size(188, 22); this.OpenWithNotePad.Text = "用记事本打开(&N)"; this.OpenWithNotePad.Click += new System.EventHandler(this.用记事本打开_Click); // // cms_ExplorerFile // this.cms_ExplorerFile.Name = "cms_ExplorerFile"; this.cms_ExplorerFile.Size = new System.Drawing.Size(188, 22); this.cms_ExplorerFile.Text = "用资源管理器打开(&X)"; this.cms_ExplorerFile.Click += new System.EventHandler(this.用资源管理器打开_Click); // // saveAs1 // this.saveAs1.Name = "saveAs1"; this.saveAs1.Size = new System.Drawing.Size(188, 22); this.saveAs1.Text = "另存为(&S)..."; this.saveAs1.Click += new System.EventHandler(this.另存为_Click); // // toolStripMenuItem2 // this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Size = new System.Drawing.Size(185, 6); // // 复制ToolStripMenuItem // this.复制ToolStripMenuItem.Name = "复制ToolStripMenuItem"; this.复制ToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); this.复制ToolStripMenuItem.Size = new System.Drawing.Size(188, 22); this.复制ToolStripMenuItem.Text = "复制(&C)"; this.复制ToolStripMenuItem.Click += new System.EventHandler(this.复制文件到剪切板_Click); // // cms_DeleteFile // this.cms_DeleteFile.Name = "cms_DeleteFile"; this.cms_DeleteFile.ShortcutKeyDisplayString = ""; this.cms_DeleteFile.ShortcutKeys = System.Windows.Forms.Keys.Delete; this.cms_DeleteFile.Size = new System.Drawing.Size(188, 22); this.cms_DeleteFile.Text = "删除(&D)"; this.cms_DeleteFile.Click += new System.EventHandler(this.删除_Click); // // cms_ReNameFile // this.cms_ReNameFile.Name = "cms_ReNameFile"; this.cms_ReNameFile.ShortcutKeys = System.Windows.Forms.Keys.F2; this.cms_ReNameFile.Size = new System.Drawing.Size(188, 22); this.cms_ReNameFile.Text = "重命名(&R)"; this.cms_ReNameFile.Click += new System.EventHandler(this.重命名_Click); // // imageList1 // this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; this.imageList1.ImageSize = new System.Drawing.Size(16, 16); this.imageList1.TransparentColor = System.Drawing.Color.Transparent; // // toolTip1 // this.toolTip1.IsBalloon = true; this.toolTip1.ShowAlways = true; // // contextMenuStrip2 // this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.查看VToolStripMenuItem, this.toolStripSeparator2, this.添加附件AToolStripMenuItem, this.openCurrentDir, this.toolStripSeparator4, this.cms_Refresh, this.toolStripSeparator5, this.cms_SelectAll}); this.contextMenuStrip2.Name = "contextMenuStrip_ListView"; this.contextMenuStrip2.Size = new System.Drawing.Size(177, 132); // // 查看VToolStripMenuItem // this.查看VToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.largeIcon1, this.smallIcon1, this.list1, this.tile1, this.details1}); this.查看VToolStripMenuItem.Name = "查看VToolStripMenuItem"; this.查看VToolStripMenuItem.Size = new System.Drawing.Size(176, 22); this.查看VToolStripMenuItem.Text = "查看(&V)"; // // largeIcon1 // this.largeIcon1.CheckOnClick = true; this.largeIcon1.GroupIndex = 0; this.largeIcon1.Name = "largeIcon1"; this.largeIcon1.Size = new System.Drawing.Size(141, 22); this.largeIcon1.Text = "大图标(&R)"; this.largeIcon1.Click += new System.EventHandler(this.details1_Click); // // smallIcon1 // this.smallIcon1.CheckOnClick = true; this.smallIcon1.GroupIndex = 0; this.smallIcon1.Name = "smallIcon1"; this.smallIcon1.Size = new System.Drawing.Size(141, 22); this.smallIcon1.Text = "小图标(&N)"; this.smallIcon1.Click += new System.EventHandler(this.details1_Click); // // list1 // this.list1.CheckOnClick = true; this.list1.GroupIndex = 0; this.list1.Name = "list1"; this.list1.Size = new System.Drawing.Size(141, 22); this.list1.Text = "列表(&T)"; this.list1.Click += new System.EventHandler(this.details1_Click); // // tile1 // this.tile1.CheckOnClick = true; this.tile1.GroupIndex = 0; this.tile1.Name = "tile1"; this.tile1.Size = new System.Drawing.Size(141, 22); this.tile1.Text = "平铺(&S)"; this.tile1.Click += new System.EventHandler(this.details1_Click); // // details1 // this.details1.Checked = true; this.details1.CheckOnClick = true; this.details1.CheckState = System.Windows.Forms.CheckState.Checked; this.details1.GroupIndex = 0; this.details1.Name = "details1"; this.details1.Size = new System.Drawing.Size(141, 22); this.details1.Text = "详细信息(&D)"; this.details1.Click += new System.EventHandler(this.details1_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(173, 6); // // 添加附件AToolStripMenuItem // this.添加附件AToolStripMenuItem.Name = "添加附件AToolStripMenuItem"; this.添加附件AToolStripMenuItem.Size = new System.Drawing.Size(176, 22); this.添加附件AToolStripMenuItem.Text = "添加文件(&A)"; this.添加附件AToolStripMenuItem.Click += new System.EventHandler(this.添加_Click); // // openCurrentDir // this.openCurrentDir.Name = "openCurrentDir"; this.openCurrentDir.Size = new System.Drawing.Size(176, 22); this.openCurrentDir.Text = "打开当前文件夹(&C)"; this.openCurrentDir.Click += new System.EventHandler(this.打开当前文件夹_Click); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new System.Drawing.Size(173, 6); // // cms_Refresh // this.cms_Refresh.Name = "cms_Refresh"; this.cms_Refresh.ShortcutKeys = System.Windows.Forms.Keys.F5; this.cms_Refresh.Size = new System.Drawing.Size(176, 22); this.cms_Refresh.Text = "刷新(&R)"; this.cms_Refresh.Click += new System.EventHandler(this.刷新_Click); // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; this.toolStripSeparator5.Size = new System.Drawing.Size(173, 6); // // cms_SelectAll // this.cms_SelectAll.Name = "cms_SelectAll"; this.cms_SelectAll.ShortcutKeyDisplayString = "Ctrl+A"; this.cms_SelectAll.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); this.cms_SelectAll.Size = new System.Drawing.Size(176, 22); this.cms_SelectAll.Text = "全选(&L)"; this.cms_SelectAll.TextDirection = System.Windows.Forms.ToolStripTextDirection.Horizontal; this.cms_SelectAll.Click += new System.EventHandler(this.全选_Click); // // fileSystemWatcher1 // this.fileSystemWatcher1.EnableRaisingEvents = true; this.fileSystemWatcher1.SynchronizingObject = this; this.fileSystemWatcher1.Created += new System.IO.FileSystemEventHandler(this.fileSystemWatcher1_Created); this.fileSystemWatcher1.Deleted += new System.IO.FileSystemEventHandler(this.fileSystemWatcher1_Created); // // FormAttachment // this.AllowDrop = true; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(655, 356); this.ControlBox = false; this.Controls.Add(this.listView1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "FormAttachment"; this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "Form2"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormAttachment_FormClosed); this.Load += new System.EventHandler(this.Form1_Load); this.Shown += new System.EventHandler(this.FormAttachment_Shown); this.contextMenuStrip1.ResumeLayout(false); this.contextMenuStrip2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).EndInit(); this.ResumeLayout(false); }
public SystemTray() { #region Load Auto-Mode //Turn on Auto-Mode as soon as possible if (Properties.Settings.Default.TaskbarState.Equals(nameof(auto))) { switcher.Start(); } #endregion #region Initialization ResourceCulture resource = new ResourceCulture(); System.Drawing.Font font = new System.Drawing.Font("Segoe UI", 10F); about = new ToolStripMenuItem { Text = resource.GetString(nameof(about)), Font = font }; animation = new ToolStripMenuItem { Text = resource.GetString(nameof(animation)), Font = font }; auto = new ToolStripMenuItem { Text = resource.GetString(nameof(auto)), Name = nameof(auto), Font = font }; show = new ToolStripMenuItem { Text = resource.GetString(nameof(show)), Name = nameof(show), Font = font }; hide = new ToolStripMenuItem { Text = resource.GetString(nameof(hide)), Name = nameof(hide), Font = font }; exit = new ToolStripMenuItem { Text = resource.GetString(nameof(exit)), Font = font }; contextMenuStrip = new ContextMenuStrip { Renderer = new Win10Renderer() }; contextMenuStrip.Items.AddRange(new ToolStripItem[] { about, animation, new ToolStripSeparator(), auto, show, hide, new ToolStripSeparator(), exit }); notifyIcon = new NotifyIcon { ContextMenuStrip = contextMenuStrip, Text = "SmartTaskbar v1.1.7", Icon = System.Environment.OSVersion.Version.Major.ToString() == "10" ? Properties.Resources.logo_32 : Properties.Resources.logo_blue_32, Visible = true }; #endregion #region Load Event about.Click += (s, e) => System.Diagnostics.Process.Start(@"https://github.com/ChanpleCai/SmartTaskbar/releases"); animation.Click += (s, e) => animation.Checked = switcher.AnimationSwitcher(); auto.Click += (s, e) => { if (auto.Checked) { return; } switcher.Start(); RadioChecked(ref auto); }; show.Click += (s, e) => { if (show.Checked) { return; } switcher.Show(); RadioChecked(ref show); }; hide.Click += (s, e) => { if (hide.Checked) { return; } switcher.Hide(); RadioChecked(ref hide); }; exit.Click += (s, e) => { switcher.Stop(); notifyIcon.Dispose(); Application.Exit(); }; notifyIcon.MouseClick += (s, e) => { if (e.Button != MouseButtons.Right) { return; } switch (Properties.Settings.Default.TaskbarState) { case "auto": switcher.Resume(); break; case "hide": if (!switcher.IsHide()) { RadioChecked(ref show); } break; default: if (switcher.IsHide()) { RadioChecked(ref hide); } break; } animation.Checked = switcher.IsAnimationEnable(); }; notifyIcon.MouseDoubleClick += (s, e) => { if (switcher.IsHide()) { switcher.Show(); RadioChecked(ref show); } else { switcher.Hide(); RadioChecked(ref hide); } }; #endregion #region Load Check State switch (Properties.Settings.Default.TaskbarState) { case "auto": auto.Checked = true; break; case "hide": hide.Checked = true; break; default: show.Checked = true; break; } #endregion }
private void Dashboard_Load(object sender, EventArgs e) { DonateCategory.Dock = DockStyle.Top; // Show buttons CommonActions.DisableContextMenu(); var openItem = new DashboardItem(Resources.IconRepoOpen, openRepository.Text); openItem.Click += openItem_Click; CommonActions.AddItem(openItem); var cloneItem = new DashboardItem(Resources.IconCloneRepoGit, cloneRepository.Text); cloneItem.Click += cloneItem_Click; CommonActions.AddItem(cloneItem); var cloneSvnItem = new DashboardItem(Resources.IconCloneRepoSvn, cloneSvnRepository.Text); cloneSvnItem.Click += cloneSvnItem_Click; CommonActions.AddItem(cloneSvnItem); foreach (IRepositoryHostPlugin el in RepoHosts.GitHosters) { IRepositoryHostPlugin gitHoster = el; var di = new DashboardItem(Resources.IconCloneRepoGithub, string.Format(cloneFork.Text, el.Description)); di.Click += (repoSender, eventArgs) => UICommands.StartCloneForkFromHoster(this, gitHoster, GitModuleChanged); CommonActions.AddItem(di); } var createItem = new DashboardItem(Resources.IconRepoCreate, createRepository.Text); createItem.Click += createItem_Click; CommonActions.AddItem(createItem); DonateCategory.DisableContextMenu(); var GitHubItem = new DashboardItem(Resources.develop.ToBitmap(), develop.Text); GitHubItem.Click += GitHubItem_Click; DonateCategory.AddItem(GitHubItem); var DonateItem = new DashboardItem(Resources.dollar.ToBitmap(), donate.Text); DonateItem.Click += DonateItem_Click; DonateCategory.AddItem(DonateItem); var TranslateItem = new DashboardItem(Resources.EditItem, translate.Text); TranslateItem.Click += TranslateItem_Click; DonateCategory.AddItem(TranslateItem); var IssuesItem = new DashboardItem(Resources.bug, issues.Text); IssuesItem.Click += IssuesItem_Click; DonateCategory.AddItem(IssuesItem); // // create Show current branch menu item and add to Dashboard menu // var showCurrentBranchMenuItem = new ToolStripMenuItem(_showCurrentBranch.Text); showCurrentBranchMenuItem.Click += showCurrentBranchMenuItem_Click; showCurrentBranchMenuItem.Checked = GitCommands.AppSettings.DashboardShowCurrentBranch; var menuStrip = FindControl <MenuStrip>(Parent.Parent.Parent, p => true); // TODO: improve: Parent.Parent.Parent == FormBrowse var dashboardMenu = (ToolStripMenuItem)menuStrip.Items.Cast <ToolStripItem>().SingleOrDefault(p => p.Name == "dashboardToolStripMenuItem"); dashboardMenu.DropDownItems.Add(showCurrentBranchMenuItem); }