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);
    }
Example #2
0
    public TextEditor(string filename)
    {
        BackColor = Color.FromArgb(255, 34, 40, 42);

        //find the syntax definition
        p_SyntaxDefinition = null;
        string syntaxName = new FileInfo(filename).Extension.Replace(".", "").ToLower();
        for (int c = 0; c < p_SyntaxNames.Length; c++) {
            if (p_SyntaxNames[c] == syntaxName) {
                p_SyntaxDefinition = p_SyntaxDefinitions[c];
                break;
            }
        }

        //default to a unknown syntax definition if the file extension
        //isn't known.
        if (p_SyntaxDefinition == null) {
            for (int c = 0; c < p_SyntaxNames.Length; c++) {
                if (p_SyntaxNames[c] == "unknown") {
                    p_SyntaxDefinition = p_SyntaxDefinitions[c];
                    break;
                }
            }
        }

        //create the syntaxbox control
        p_Base = new SyntaxBoxControl() {
            Dock = DockStyle.Fill,
            BackColor = BackColor,
            BracketBackColor = Color.Transparent,
            BracketForeColor = Color.White,
            BracketBorderColor = Color.FromArgb(255, 60, 70, 70),

            ShowLineNumbers = false,
            ShowGutterMargin = false,

            SplitView = false,

            FontName = "Consolas",
            FontSize = 10
        };
        p_Base.Document = new SyntaxDocument();
        p_Base.Document.Parser.Init(p_SyntaxDefinition);
        p_Base.Document.Text = File.ReadAllText(filename);

        p_Base.Document.Change += delegate(object sender, EventArgs e) {
            if (Modified == null) { return; }
            Modified(this, e);
        };

        //create the right click menu
        ContextMenuStrip rightClickMenu = new ContextMenuStrip();
        rightClickMenu.Opening += delegate(object sender, System.ComponentModel.CancelEventArgs e) {
            presentRightClickMenu(rightClickMenu);
        };
        ContextMenuStrip = rightClickMenu;

        //add the control
        Controls.Add(p_Base);
    }
Example #3
0
	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);
	}
Example #4
0
	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 FlowLayoutPanel CreateFloor(int numberFloor, Panel panelName)
        //{
        //    //Thêm flowlayoutpanel
        //    FlowLayoutPanel floor = new FlowLayoutPanel();
        //    panelName.Controls.Add(floor);
        //    floor.Name = "flp_floor" + numberFloor;
        //    floor.Dock = DockStyle.Top;
        //    floor.AutoSize = true;
        //    //Thêm tên khu
        //    Label nameFloor = new Label();
        //    nameFloor.Text = "Tầng " + numberFloor;
        //    nameFloor.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
        //    nameFloor.ForeColor = System.Drawing.SystemColors.Highlight;
        //    nameFloor.Name = "lbl_Floor" + numberFloor;
        //    nameFloor.Dock = DockStyle.Top;
        //    panelName.Controls.Add(nameFloor);
        //    return floor;
        //}

        //Create Button have chair icon
        public SimpleButton CreateButtonChair(string numberFloor, int numberChair, FlowLayoutPanel nameFloor, ContextMenuStrip nameCMS)
        {
            SimpleButton btnChair = new SimpleButton();

            nameFloor.Controls.Add(btnChair);
            btnChair.AppearancePressed.BackColor            = System.Drawing.SystemColors.GradientInactiveCaption;
            btnChair.AppearancePressed.Options.UseBackColor = true;
            btnChair.ImageOptions.Image = global::CoffeeManagementSoftware.Properties.Resources.cocktail;
            btnChair.ImageOptions.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.TopCenter;
            btnChair.Name        = "btnChair" + numberFloor + "." + numberChair;
            btnChair.Size        = new System.Drawing.Size(100, 80);
            btnChair.Text        = "Ban " + numberFloor + "." + numberChair;
            btnChair.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
            //btnChair.Dock = DockStyle.Left;
            btnChair.Font             = new Font("Tahoma", 10F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0)));
            btnChair.ForeColor        = Color.Black;
            btnChair.DoubleClick     += btnChair_DoubleClick;
            btnChair.ContextMenuStrip = nameCMS;
            return(btnChair);
        }
Example #6
0
        private void NavBarButtonViewsOnDropDownOpening(object sender, EventArgs e)
        {
            var contextMenu   = new ContextMenuStrip();
            var bindingSource = BindingListSource;

            if (bindingSource != null && ViewContext != null)
            {
                var groups = new List <ViewGroup> {
                    ViewGroup.BUILT_IN
                };
                groups.AddRange(ViewContext.ViewGroups.Except(groups));
                bool anyOtherGroups = false;

                foreach (var group in groups)
                {
                    List <ToolStripItem> items = new List <ToolStripItem>();
                    var viewSpecList           = ViewContext.GetViewSpecList(group.Id);
                    if (!viewSpecList.ViewSpecs.Any())
                    {
                        continue;
                    }
                    foreach (var viewSpec in viewSpecList.ViewSpecs)
                    {
                        var item = NewChooseViewItem(group, viewSpec);
                        if (null != item)
                        {
                            items.Add(item);
                        }
                    }
                    if (!items.Any())
                    {
                        continue;
                    }
                    if (ViewGroup.BUILT_IN.Equals(group) || Equals(ViewContext.DefaultViewGroup, group))
                    {
                        contextMenu.Items.AddRange(items.ToArray());
                        contextMenu.Items.Add(new ToolStripSeparator());
                    }
                    else
                    {
                        var item = new ToolStripMenuItem(group.Label);
                        item.DropDownItems.AddRange(items.ToArray());
                        contextMenu.Items.Add(item);
                        anyOtherGroups = true;
                    }
                }
                if (anyOtherGroups)
                {
                    contextMenu.Items.Add(new ToolStripSeparator());
                }
                bool currentViewIsBuiltIn = ViewGroup.BUILT_IN.Equals(BindingListSource.ViewInfo.ViewGroup);
                if (currentViewIsBuiltIn)
                {
                    contextMenu.Items.Add(new ToolStripMenuItem(Resources.NavBar_NavBarButtonViewsOnDropDownOpening_Customize_View, null, OnCopyView));
                }
                else
                {
                    contextMenu.Items.Add(new ToolStripMenuItem(Resources.NavBar_NavBarButtonViewsOnDropDownOpening_Edit_View___, null, OnEditView));
                }
                contextMenu.Items.Add(new ToolStripMenuItem(Resources.NavBar_NavBarButtonViewsOnDropDownOpening_Manage_Views___, null, OnManageViews));
            }
            navBarButtonViews.DropDown = contextMenu;
        }
Example #7
0
 // Token: 0x060001B0 RID: 432 RVA: 0x000099FB File Offset: 0x00007BFB
 public ScrapMenuArgs(ScrapBase targetscrap, ContextMenuStrip targetmenu)
 {
     scrap = targetscrap;
     menu  = targetmenu;
 }
Example #8
0
        protected override ContextMenuStrip CreateMenu()
        {
            CheckUserSettings();
            // Main Menu
            using (Menu = new ContextMenuStrip())
            {
                Menu.Name = "xMenuToolsFiles";

                using (xMenuToolsMenu = new ToolStripMenuItem())
                {
                    xMenuToolsMenu.Name = "xMenuToolsMenu";

                    // OpenNotepad
                    using (OpenNotepad = new ToolStripMenuItem())
                    {
                        OpenNotepad.Text = Resources.OpenNotepad;
                        OpenNotepad.Name = "OpenNotepad";
                    }
                    // BlockFirewall
                    using (BlockFirewall = new ToolStripMenuItem())
                    {
                        BlockFirewall.Text = Resources.BlockText;
                        BlockFirewall.Name = "BlockFirewall";
                    }
                    // CopyName
                    using (CopyName = new ToolStripMenuItem())
                    {
                        CopyName.Text = Resources.CopyNameText;
                        CopyName.Name = "CopyName";
                    }
                    // CopyPath
                    using (CopyPath = new ToolStripMenuItem())
                    {
                        CopyPath.Text = Resources.CopyPathText;
                        CopyPath.Name = "CopyPath";
                    }
                    // CopyPathURL
                    using (CopyPathURL = new ToolStripMenuItem())
                    {
                        CopyPathURL.Text = Resources.CopyPathURLText;
                        CopyPathURL.Name = "CopyPathURL";
                    }
                    // CopyLONGPath
                    using (CopyLONGPath = new ToolStripMenuItem())
                    {
                        CopyLONGPath.Text = Resources.CopyLONGPathText;
                        CopyLONGPath.Name = "CopyLONGPath";
                    }
                    // Attributes
                    using (Attributes = new ToolStripMenuItem())
                    {
                        Attributes.Name = "Attributes";

                        Attributes.Text = Resources.AttributesText;
                        // AttributesMenu
                        using (AttributesMenu = new ToolStripMenuItem())
                        {
                            AttributesMenu.Text = Resources.AttributesMenu;
                            AttributesMenu.Name = "AttributesMenu";
                        }
                        // Get : Set Attributes
                        string[] SelectedPath = SelectedItemPaths.Cast <string>().ToArray();
                        if (SelectedPath.Length > 1)
                        {
                            foreach (string item in SelectedPath)
                            {
                                try
                                {
                                    AttributesInfo.GetFileAttributes(item);
                                }
                                catch (Exception ex)
                                {
                                    StartProcess.StartInfo(AttributesInfo.GetAssembly.AssemblyInformation("directory") + @"\xMenuTools.exe", "\"" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.Source + Environment.NewLine + ex.GetBaseException() + Environment.NewLine + ex.TargetSite + "\"" + " -catchhandler");
                                }
                            }
                        }
                        else
                        {
                            try
                            {
                                AttributesInfo.GetFileAttributes(SelectedPath.ToStringArray(false));
                            }
                            catch (Exception ex)
                            {
                                StartProcess.StartInfo(AttributesInfo.GetAssembly.AssemblyInformation("directory") + @"\xMenuTools.exe", "\"" + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.Source + Environment.NewLine + ex.GetBaseException() + Environment.NewLine + ex.TargetSite + "\"" + " -catchhandler");
                            }
                        }
                        SetFileAttributes();
                    }
                    // SymLink
                    using (SymLink = new ToolStripMenuItem())
                    {
                        SymLink.Text = Resources.CreateSymbolicLink;
                        SymLink.Name = "SymLink";
                    }
                    // TakeOwnership
                    using (TakeOwnership = new ToolStripMenuItem())
                    {
                        TakeOwnership.Text = Resources.TakeOwnershipText;
                        TakeOwnership.Name = "TakeOwnership";
                    }
                }
            }
            MenuDeveloper();

            return(Menu);
        }
Example #9
0
	public iPhoneDiskApplication()
	{
		#region GUI preparation
		Text = "jPhone";
		MaximizeBox = false;
		Size = new Size(nDefaultWidth, nHeightWithoutDebugLog);
		FormBorderStyle = FormBorderStyle.FixedSingle;
		ShowIcon = true;
		iApplication = new Icon(GetType(), "jphone.icons.icon.ico");
		Icon = iApplication;
		FormClosing += new FormClosingEventHandler(iPhoneDiskApplication_FormClosing);
		SizeChanged += new EventHandler(iPhoneDiskApplication_SizeChanged);
		Show();

		niTrayIcon = new NotifyIcon();
		niTrayIcon.Text = "jPhone";
		niTrayIcon.Icon = Icon;
		niTrayIcon.Click += new EventHandler(niTrayIcon_Click);

		lbText = new Label();
		lbText.AutoSize = true;
		lbText.Location = new Point(10, 10);
		lbText.Text = "Select the iPhone, iPod Touch or iPad to mount:";

		cbDeviceList = new ComboBox();
		cbDeviceList.Location = new Point(lbText.Left + 5, lbText.Bottom);
		cbDeviceList.Width = 320;
		cbDeviceList.DropDownStyle = ComboBoxStyle.DropDownList;

		buMount = new Button();
		buMount.Location = new Point(cbDeviceList.Right + 15, cbDeviceList.Top - 3);
		buMount.Size = new Size(80, 25);
		buMount.Click += new EventHandler(buMount_Click);
		buMount.Enabled = false;

		cmOptions = new ContextMenuStrip();
		cmOptions.RenderMode = ToolStripRenderMode.System;
		cmOptions.ShowImageMargin = false;
		cmOptions.ShowCheckMargin = true;
		tsmiAutomount = new ToolStripMenuItem("Automount", null, (s, e) => { tsmiAutomount.Checked = !tsmiAutomount.Checked; });
		tsmiMinimizeToTray = new ToolStripMenuItem("Minimize to tray", null, (s, e) => { tsmiMinimizeToTray.Checked = !tsmiMinimizeToTray.Checked; });
		tsmiShowDebugLog = new ToolStripMenuItem("Show debug log", null, (s, e) =>
		{
			tsmiShowDebugLog.Checked = !tsmiShowDebugLog.Checked;
			if (bShowDebugLog) Height = nHeightWithDebugLog;
			else Height = nHeightWithoutDebugLog;
		});
		tsmiReapplyLibUSBFilters = new ToolStripMenuItem("Re-apply libusb filters", null, ReapplyLibUSBFilters_Click);
		cmOptions.Items.Add(tsmiAutomount);
		cmOptions.Items.Add(tsmiShowDebugLog);
		cmOptions.Items.Add(tsmiMinimizeToTray);
		cmOptions.Items.Add("-");
		cmOptions.Items.Add(tsmiReapplyLibUSBFilters);

		buOptions = new Button();
		buOptions.Location = new Point(buMount.Right + 5, buMount.Top);
		buOptions.Size = new Size(80, 25);
		buOptions.Text = "Options";
		buOptions.Click += (s, e) => { cmOptions.Show(PointToScreen(new Point(buOptions.Left, buOptions.Bottom))); };
	
		bool[] bOptions = GetRegistryOptions();
		tsmiAutomount.Checked = bOptions[0];
		tsmiShowDebugLog.Checked = bOptions[1]; 
		tsmiMinimizeToTray.Checked = bOptions[2];
		if (bShowDebugLog) Height = nHeightWithDebugLog;

		tbDebugLog = new TextBox();
		tbDebugLog.ReadOnly = true;
		tbDebugLog.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;
		tbDebugLog.Location = new Point(10, 75);
		tbDebugLog.Size = new Size(ClientSize.Width - 20, nHeightWithDebugLog - 145);
		tbDebugLog.Multiline = true;
		tbDebugLog.BorderStyle = BorderStyle.FixedSingle;
		tbDebugLog.ScrollBars = ScrollBars.Vertical;

		sbStatus = new StatusBar();
		sbStatus.Dock = DockStyle.Bottom;
		sbStatus.SizingGrip = false;
		sbStatus.ShowPanels = true;
		sbpDeviceCount = new StatusBarPanel();
		sbpDeviceCount.Width = 150;
		sbpDeviceCount.Alignment = HorizontalAlignment.Center;
		sbpMountStatus = new StatusBarPanel();
		sbpMountStatus.AutoSize = StatusBarPanelAutoSize.Spring;
		sbpMountStatus.Alignment = HorizontalAlignment.Center;
		sbStatus.Panels.Add(sbpDeviceCount);
		sbStatus.Panels.Add(sbpMountStatus);

		Controls.AddRange(new Control[] { lbText, cbDeviceList, buMount, buOptions, sbStatus, tbDebugLog });
		
		cbDeviceList.Select();
		#endregion

		Global.LogUpdated += new Global.LogEventHandler(Global_LogUpdated);
		USBNotifier.OnDeviceNotify += new EventHandler<DeviceNotifyEventArgs>(USBNotifier_OnDeviceNotify);

		Global.Log("jPhone 1.0: iPhone mounting utility. Copyright 2010 Jonathan Bergknoff.\n");
		Global.Log("Shift-click the mount button to mount a jailbroken device as root.\n");
		Global.Log("http://www.getjpod.com/jphone\n");

		// Initialize everything to an unmounted state.
		UnmountDevice();
		PopulateDeviceList();
		TryAutomount();
	}
Example #10
0
        /*
         * Dynamically populate the context menu to reflect the current COM ports.
         * Each menu entry represents a single port.
         * If more than one baud rate is specified, the port entry is nested, with
         * the next level of the menu showing all the available baud rates.
         */
        static void UpdateContextMenu(ContextMenuStrip strip, IOrderedEnumerable <SerialPortDescriptor> newerPorts)
        {
            strip.Close();
            strip.Items.Clear();

            string baudRateSuffix = "";

            // if there's only a single baud rate specified - add it to the description
            if (currentConfiguration.BaudRates.Count == 1)
            {
                baudRateSuffix = String.Format(" [{0}]", currentConfiguration.BaudRates[0]);
            }


            // key is COMYY address (might be null), value is description
            foreach (SerialPortDescriptor newPort in newerPorts)
            {
                ToolStripMenuItem portEntry = new ToolStripMenuItem
                {
                    AutoToolTip = false, // the tooltip lingers annoyingly
                    Text        = newPort.Description + baudRateSuffix,
                    Image       = Properties.Resources.usb,
                    Tag         = newPort.Address
                };

                if (newPort.Address == null)
                {
                    // disable if there's no address
                    portEntry.Enabled = false;
                }
                else
                {
                    if (currentConfiguration.BaudRates.Count == 1)
                    {
                        // define a handler for the current item
                        portEntry.Click += PortEntry_Click;
                    }
                    else
                    {
                        // create several entries for baud rates, each with COM
                        // port address as tag, and define a handler for them
                        foreach (int baudRate in currentConfiguration.BaudRates)
                        {
                            ToolStripMenuItem baudRateItem = new ToolStripMenuItem
                            {
                                AutoToolTip = false, // the tooltip lingers annoyingly
                                Text        = baudRate.ToString(),
                                Image       = Properties.Resources.speedometer,
                                Tag         = newPort.Address
                            };
                            baudRateItem.Click += BaudRateItem_Click;

                            portEntry.DropDownItems.Add(baudRateItem);
                        }
                    }
                }

                strip.Items.Add(portEntry);
            }

            // add a separator
            strip.Items.Add(new ToolStripSeparator());

            // add a settings button
            ToolStripMenuItem settingsButton = new ToolStripMenuItem
            {
                AutoToolTip = false, // the tooltip lingers annoyingly
                Text        = "Settings",
                Image       = Properties.Resources.coding
            };

            settingsButton.Click += SettingsButton_Click;
            strip.Items.Add(settingsButton);

            // add a quit button
            ToolStripMenuItem quitButton = new ToolStripMenuItem
            {
                AutoToolTip = false, // the tooltip lingers annoyingly
                Text        = "Quit",
                Image       = Properties.Resources.exit
            };

            quitButton.Click += QuitButton_Click;
            strip.Items.Add(quitButton);
        }
Example #11
0
 private void InitializeComponent()
 {
     this.icontainer_0 = new Container();
     this.panel1 = new Panel();
     this.cboConnectionString = new ComboBox();
     this.btnConnect = new Button();
     this.label1 = new Label();
     this.panel2 = new Panel();
     this.splitter2 = new Splitter();
     this.panel5 = new Panel();
     this.linkLabel1 = new LinkLabel();
     this.splitter1 = new Splitter();
     this.panel3 = new Panel();
     this.treeView1 = new TreeView();
     this.imageList_0 = new ImageList(this.icontainer_0);
     this.panel4 = new Panel();
     this.contextMenuStrip5 = new ContextMenuStrip(this.icontainer_0);
     this.显示隐藏代码窗口ToolStripMenuItem = new ToolStripMenuItem();
     this.label2 = new Label();
     this.contextMenuStrip1 = new ContextMenuStrip(this.icontainer_0);
     this.menuCopySpName = new ToolStripMenuItem();
     this.toolStripMenuItem1 = new ToolStripSeparator();
     this.menuGetXmlCommandBySP = new ToolStripMenuItem();
     this.contextMenuStrip2 = new ContextMenuStrip(this.icontainer_0);
     this.menuCopyTableName = new ToolStripMenuItem();
     this.toolStripMenuItem2 = new ToolStripSeparator();
     this.生成增删改命令到剪切板ToolStripMenuItem = new ToolStripMenuItem();
     this.contextMenuStrip3 = new ContextMenuStrip(this.icontainer_0);
     this.menuCopyDbName = new ToolStripMenuItem();
     this.名称ToolStripMenuItem = new ToolStripSeparator();
     this.根据查询生成数据实体类ToolStripMenuItem = new ToolStripMenuItem();
     this.toolStripMenuItem3 = new ToolStripSeparator();
     this.定位到指定对象ToolStripMenuItem = new ToolStripMenuItem();
     this.contextMenuStrip4 = new ContextMenuStrip(this.icontainer_0);
     this.menuCopyViewName = new ToolStripMenuItem();
     this.txtSqlScript = new SyntaxHighlighterControlFix();
     this.txtCsCode = new SyntaxHighlighterControlFix();
     this.ucParameterStyle1 = new ucParameterStyleFix();
     this.ucCsClassStyle1 = new UcCsClassStyleFix();
     this.panel1.SuspendLayout();
     this.panel2.SuspendLayout();
     this.panel5.SuspendLayout();
     this.panel3.SuspendLayout();
     this.panel4.SuspendLayout();
     this.contextMenuStrip5.SuspendLayout();
     this.contextMenuStrip1.SuspendLayout();
     this.contextMenuStrip2.SuspendLayout();
     this.contextMenuStrip3.SuspendLayout();
     this.contextMenuStrip4.SuspendLayout();
     base.SuspendLayout();
     this.panel1.Controls.Add(this.cboConnectionString);
     this.panel1.Controls.Add(this.btnConnect);
     this.panel1.Controls.Add(this.label1);
     this.panel1.Dock = DockStyle.Top;
     this.panel1.Location = new Point(0, 0);
     this.panel1.Name = "panel1";
     this.panel1.Size = new Size(0x38f, 0x24);
     this.panel1.TabIndex = 0;
     this.cboConnectionString.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this.cboConnectionString.Font = new Font("Courier New", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.cboConnectionString.FormattingEnabled = true;
     this.cboConnectionString.Location = new Point(0x4d, 7);
     this.cboConnectionString.Name = "cboConnectionString";
     this.cboConnectionString.Size = new Size(0x2ca, 0x17);
     this.cboConnectionString.TabIndex = 2;
     this.btnConnect.Anchor = AnchorStyles.Right | AnchorStyles.Top;
     this.btnConnect.FlatStyle = FlatStyle.Popup;
     this.btnConnect.Location = new Point(0x328, 8);
     this.btnConnect.Name = "btnConnect";
     this.btnConnect.Size = new Size(0x5e, 0x15);
     this.btnConnect.TabIndex = 0;
     this.btnConnect.Text = "连接数据库(&C)";
     this.btnConnect.UseVisualStyleBackColor = true;
     this.btnConnect.Click += new EventHandler(this.btnConnect_Click);
     this.label1.AutoSize = true;
     this.label1.Location = new Point(4, 11);
     this.label1.Name = "label1";
     this.label1.Size = new Size(0x41, 12);
     this.label1.TabIndex = 1;
     this.label1.Text = "连接字符串";
     this.panel2.Controls.Add(this.txtSqlScript);
     this.panel2.Controls.Add(this.splitter2);
     this.panel2.Controls.Add(this.txtCsCode);
     this.panel2.Controls.Add(this.panel5);
     this.panel2.Controls.Add(this.splitter1);
     this.panel2.Controls.Add(this.panel3);
     this.panel2.Dock = DockStyle.Fill;
     this.panel2.Location = new Point(0, 0x24);
     this.panel2.Name = "panel2";
     this.panel2.Size = new Size(0x38f, 0x221);
     this.panel2.TabIndex = 1;
     this.splitter2.Dock = DockStyle.Top;
     this.splitter2.Location = new Point(0xe1, 0x18a);
     this.splitter2.Name = "splitter2";
     this.splitter2.Size = new Size(0x2ae, 7);
     this.splitter2.TabIndex = 4;
     this.splitter2.TabStop = false;
     this.panel5.Controls.Add(this.ucParameterStyle1);
     this.panel5.Controls.Add(this.ucCsClassStyle1);
     this.panel5.Controls.Add(this.linkLabel1);
     this.panel5.Dock = DockStyle.Top;
     this.panel5.Location = new Point(0xe1, 0);
     this.panel5.Name = "panel5";
     this.panel5.Size = new Size(0x2ae, 0x1a);
     this.panel5.TabIndex = 2;
     this.linkLabel1.Anchor = AnchorStyles.Right | AnchorStyles.Top;
     //this.linkLabel1.Image = Resources.Help;
     this.linkLabel1.ImageAlign = ContentAlignment.MiddleLeft;
     this.linkLabel1.LinkBehavior = LinkBehavior.NeverUnderline;
     this.linkLabel1.Location = new Point(0x24b, 4);
     this.linkLabel1.Name = "linkLabel1";
     this.linkLabel1.Size = new Size(0x60, 0x11);
     this.linkLabel1.TabIndex = 7;
     this.linkLabel1.TabStop = true;
     this.linkLabel1.Text = "查看帮助页面";
     this.linkLabel1.TextAlign = ContentAlignment.MiddleRight;
     this.linkLabel1.LinkClicked += new LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
     this.splitter1.Location = new Point(0xdb, 0);
     this.splitter1.Name = "splitter1";
     this.splitter1.Size = new Size(6, 0x221);
     this.splitter1.TabIndex = 1;
     this.splitter1.TabStop = false;
     this.panel3.Controls.Add(this.treeView1);
     this.panel3.Controls.Add(this.panel4);
     this.panel3.Dock = DockStyle.Left;
     this.panel3.Location = new Point(0, 0);
     this.panel3.Name = "panel3";
     this.panel3.Size = new Size(0xdb, 0x221);
     this.panel3.TabIndex = 0;
     this.treeView1.Dock = DockStyle.Fill;
     this.treeView1.HideSelection = false;
     this.treeView1.ImageIndex = 0;
     this.treeView1.ImageList = this.imageList_0;
     this.treeView1.Location = new Point(0, 0x1a);
     this.treeView1.Name = "treeView1";
     this.treeView1.SelectedImageIndex = 0;
     this.treeView1.Size = new Size(0xdb, 0x207);
     this.treeView1.TabIndex = 1;
     this.treeView1.AfterCollapse += new TreeViewEventHandler(this.treeView1_AfterCollapse);
     this.treeView1.BeforeExpand += new TreeViewCancelEventHandler(this.treeView1_BeforeExpand);
     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.treeView1.AfterExpand += new TreeViewEventHandler(this.treeView1_AfterExpand);
     this.imageList_0.ColorDepth = ColorDepth.Depth8Bit;
     this.imageList_0.ImageSize = new Size(0x10, 0x10);
     this.imageList_0.TransparentColor = Color.Transparent;
     this.panel4.ContextMenuStrip = this.contextMenuStrip5;
     this.panel4.Controls.Add(this.label2);
     this.panel4.Dock = DockStyle.Top;
     this.panel4.Location = new Point(0, 0);
     this.panel4.Name = "panel4";
     this.panel4.Size = new Size(0xdb, 0x1a);
     this.panel4.TabIndex = 0;
     this.contextMenuStrip5.Items.AddRange(new ToolStripItem[] { this.显示隐藏代码窗口ToolStripMenuItem });
     this.contextMenuStrip5.Name = "contextMenuStrip5";
     this.contextMenuStrip5.Size = new Size(0x99, 0x30);
     this.显示隐藏代码窗口ToolStripMenuItem.Name = "显示隐藏代码窗口ToolStripMenuItem";
     this.显示隐藏代码窗口ToolStripMenuItem.Size = new Size(0x98, 0x16);
     this.显示隐藏代码窗口ToolStripMenuItem.Text = "隐藏 代码窗口";
     this.显示隐藏代码窗口ToolStripMenuItem.Click += new EventHandler(this.显示隐藏代码窗口ToolStripMenuItem_Click);
     this.label2.AutoSize = true;
     this.label2.Location = new Point(4, 6);
     this.label2.Name = "label2";
     this.label2.Size = new Size(0x53, 12);
     this.label2.TabIndex = 0;
     this.label2.Text = "数据表列表(&D)";
     this.contextMenuStrip1.Items.AddRange(new ToolStripItem[] { this.menuCopySpName, this.toolStripMenuItem1, this.menuGetXmlCommandBySP });
     this.contextMenuStrip1.Name = "contextMenuStrip1";
     this.contextMenuStrip1.Size = new Size(210, 0x36);
     this.menuCopySpName.Name = "menuCopySpName";
     this.menuCopySpName.Size = new Size(0xd1, 0x16);
     this.menuCopySpName.Text = "复制名称";
     this.menuCopySpName.Click += new EventHandler(this.menuCopyViewName_Click);
     this.toolStripMenuItem1.Name = "toolStripMenuItem1";
     this.toolStripMenuItem1.Size = new Size(0xce, 6);
     this.menuGetXmlCommandBySP.Name = "menuGetXmlCommandBySP";
     this.menuGetXmlCommandBySP.Size = new Size(0xd1, 0x16);
     this.menuGetXmlCommandBySP.Text = "生成XmlCommand到剪切板";
     this.menuGetXmlCommandBySP.Click += new EventHandler(this.menuGetXmlCommandBySP_Click);
     this.contextMenuStrip2.Items.AddRange(new ToolStripItem[] { this.menuCopyTableName, this.toolStripMenuItem2, this.生成增删改命令到剪切板ToolStripMenuItem });
     this.contextMenuStrip2.Name = "contextMenuStrip2";
     this.contextMenuStrip2.Size = new Size(0xf6, 0x36);
     this.menuCopyTableName.Name = "menuCopyTableName";
     this.menuCopyTableName.Size = new Size(0xf5, 0x16);
     this.menuCopyTableName.Text = "复制名称";
     this.menuCopyTableName.Click += new EventHandler(this.menuCopyViewName_Click);
     this.toolStripMenuItem2.Name = "toolStripMenuItem2";
     this.toolStripMenuItem2.Size = new Size(0xf2, 6);
     this.生成增删改命令到剪切板ToolStripMenuItem.Name = "生成增删改命令到剪切板ToolStripMenuItem";
     this.生成增删改命令到剪切板ToolStripMenuItem.Size = new Size(0xf5, 0x16);
     this.生成增删改命令到剪切板ToolStripMenuItem.Text = "生成增删改XmlCommand到剪切板";
     this.生成增删改命令到剪切板ToolStripMenuItem.Click += new EventHandler(this.生成增删改命令到剪切板ToolStripMenuItem_Click);
     this.contextMenuStrip3.Items.AddRange(new ToolStripItem[] { this.menuCopyDbName, this.名称ToolStripMenuItem, this.根据查询生成数据实体类ToolStripMenuItem, this.toolStripMenuItem3, this.定位到指定对象ToolStripMenuItem });
     this.contextMenuStrip3.Name = "contextMenuStrip3";
     this.contextMenuStrip3.Size = new Size(0xcf, 0x52);
     this.menuCopyDbName.Name = "menuCopyDbName";
     this.menuCopyDbName.Size = new Size(0xce, 0x16);
     this.menuCopyDbName.Text = "复制名称";
     this.menuCopyDbName.Click += new EventHandler(this.menuCopyViewName_Click);
     this.名称ToolStripMenuItem.Name = "名称ToolStripMenuItem";
     this.名称ToolStripMenuItem.Size = new Size(0xcb, 6);
     this.根据查询生成数据实体类ToolStripMenuItem.Name = "根据查询生成数据实体类ToolStripMenuItem";
     this.根据查询生成数据实体类ToolStripMenuItem.Size = new Size(0xce, 0x16);
     this.根据查询生成数据实体类ToolStripMenuItem.Text = "根据查询生成数据实体类";
     this.根据查询生成数据实体类ToolStripMenuItem.Click += new EventHandler(this.根据查询生成数据实体类ToolStripMenuItem_Click);
     this.toolStripMenuItem3.Name = "toolStripMenuItem3";
     this.toolStripMenuItem3.Size = new Size(0xcb, 6);
     this.定位到指定对象ToolStripMenuItem.Name = "定位到指定对象ToolStripMenuItem";
     this.定位到指定对象ToolStripMenuItem.Size = new Size(0xce, 0x16);
     this.定位到指定对象ToolStripMenuItem.Text = "定位到指定对象";
     this.定位到指定对象ToolStripMenuItem.Click += new EventHandler(this.定位到指定对象ToolStripMenuItem_Click);
     this.contextMenuStrip4.Items.AddRange(new ToolStripItem[] { this.menuCopyViewName });
     this.contextMenuStrip4.Name = "contextMenuStrip4";
     this.contextMenuStrip4.Size = new Size(0x7b, 0x1a);
     this.menuCopyViewName.Name = "menuCopyViewName";
     this.menuCopyViewName.Size = new Size(0x7a, 0x16);
     this.menuCopyViewName.Text = "复制名称";
     this.menuCopyViewName.Click += new EventHandler(this.menuCopyViewName_Click);
     this.txtSqlScript.Dock = DockStyle.Fill;
     this.txtSqlScript.Location = new Point(0xe1, 0x191);
     this.txtSqlScript.Name = "txtSqlScript";
     this.txtSqlScript.Size = new Size(0x2ae, 0x90);
     this.txtSqlScript.TabIndex = 6;
     this.txtCsCode.Dock = DockStyle.Top;
     this.txtCsCode.Font = new Font("Courier New", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.txtCsCode.method_0("cs");
     this.txtCsCode.Location = new Point(0xe1, 0x1a);
     this.txtCsCode.Margin = new Padding(3, 4, 3, 4);
     this.txtCsCode.Name = "txtCsCode";
     this.txtCsCode.method_6(false);
     this.txtCsCode.Size = new Size(0x2ae, 0x170);
     this.txtCsCode.TabIndex = 5;
     this.ucParameterStyle1.Location = new Point(0x41, 0);
     this.ucParameterStyle1.Name = "ucParameterStyle1";
     this.ucParameterStyle1.Size = new Size(0x18d, 0x19);
     this.ucParameterStyle1.TabIndex = 9;
     this.ucParameterStyle1.Visible = false;
     this.ucParameterStyle1.method_0(new EventHandler(this.method_7));
     this.ucCsClassStyle1.Location = new Point(3, 0);
     this.ucCsClassStyle1.Name = "ucCsClassStyle1";
     this.ucCsClassStyle1.Size = new Size(0x1f6, 0x19);
     this.ucCsClassStyle1.TabIndex = 8;
     this.ucCsClassStyle1.Visible = false;
     this.ucCsClassStyle1.method_0(new EventHandler(this.method_7));
     base.AutoScaleDimensions = new SizeF(6f, 12f);
     base.AutoScaleMode = AutoScaleMode.Font;
     base.ClientSize = new Size(0x38f, 0x245);
     base.Controls.Add(this.panel2);
     base.Controls.Add(this.panel1);
     base.KeyPreview = true;
     this.MinimumSize = new Size(700, 400);
     base.Name = "MainForm";
     base.StartPosition = FormStartPosition.CenterScreen;
     this.Text = "FastDBEngine CodeGenerator for ORACLE";
     base.WindowState = FormWindowState.Maximized;
     base.Load += new EventHandler(this.MainForm_Load);
     base.Shown += new EventHandler(this.MainForm_Shown);
     base.FormClosing += new FormClosingEventHandler(this.MainForm_FormClosing);
     base.KeyDown += new KeyEventHandler(this.MainForm_KeyDown);
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     this.panel2.ResumeLayout(false);
     this.panel5.ResumeLayout(false);
     this.panel3.ResumeLayout(false);
     this.panel4.ResumeLayout(false);
     this.panel4.PerformLayout();
     this.contextMenuStrip5.ResumeLayout(false);
     this.contextMenuStrip1.ResumeLayout(false);
     this.contextMenuStrip2.ResumeLayout(false);
     this.contextMenuStrip3.ResumeLayout(false);
     this.contextMenuStrip4.ResumeLayout(false);
     base.ResumeLayout(false);
 }
Example #12
0
        public static TreeNode GetNewNode(string name)
        {
            TreeNode         node;
            ContextMenuStrip cmnull = new ContextMenuStrip();

            switch (name.ToUpper())
            {
            case StaticVariablesClass.DatabaseKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Database",
                    Tag  = new DBRegistrationClass(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsDatabase,
                    ImageIndex = (int)eImageIndex.DATABASE_INACTIVE
                };
                return(node);

            case StaticVariablesClass.ProceduresKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Procedures",
                    Tag  = new ProceduresGroupClass(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsProcedureGroup,
                    ImageIndex = (int)eImageIndex.PROCEDURE
                };
                return(node);

            case StaticVariablesClass.ProceduresKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Procedures",
                    Tag  = new ProcedureClass(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsProcedure,
                    ImageIndex = (int)eImageIndex.PROCEDURE
                };
                return(node);

            case StaticVariablesClass.FunctionsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "User defined functions",
                    Tag  = new FunctionGroupClass(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsFunctionGroup,
                    ImageIndex = (int)eImageIndex.FUNCTION
                };
                return(node);

            case StaticVariablesClass.UserDefinedFunctionsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "User defined functions",
                    Tag  = new UserDefinedFunctionGroupClass(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsUserDefinedFunctionGroup,
                    ImageIndex = (int)eImageIndex.FUNCTION
                };
                return(node);

            case StaticVariablesClass.ForeignKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsForeignKeyGroup,
                    Text       = "Foreign Keys",
                    Tag        = new ForeignKeyGroupClass(),
                    ImageIndex = (int)eImageIndex.KEYS
                };
                return(node);

            case StaticVariablesClass.PrimaryKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsPrimaryKeyGroup,
                    Text       = "Primary Keys",
                    Tag        = new PrimaryKeyGroupClass(),
                    ImageIndex = (int)eImageIndex.PRIMARYKEY
                };
                return(node);

            case StaticVariablesClass.PrimaryKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsPrimaryKey,
                    Text       = "Primary Key",
                    Tag        = new PrimaryKeyClass(),
                    ImageIndex = (int)eImageIndex.PRIMARYKEY
                };
                return(node);

            case StaticVariablesClass.ConstraintsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsContraintsGroup,
                    Text       = "Constraints",
                    Tag        = new ConstraintsGroupClass(),
                    ImageIndex = (int)eImageIndex.KEYS
                };
                return(node);

            case StaticVariablesClass.ConstraintsKeyStr:
                node = new TreeNode()
                {
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsContraints,
                    Text       = "Constraint",
                    Name       = name.ToUpper(),
                    Tag        = new ConstraintsClass(),
                    ImageIndex = (int)eImageIndex.KEYS
                };
                return(node);

            case StaticVariablesClass.FunctionsKeyStr:
                node = new TreeNode()
                {
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsFunction,
                    Text       = "Function",
                    Name       = name.ToUpper(),
                    Tag        = new FunctionClass(),
                    ImageIndex = (int)eImageIndex.FUNCTION
                };
                return(node);

            case StaticVariablesClass.UserDefinedFunctionsKeyStr:
                node = new TreeNode()
                {
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsUserDefinedFunction,
                    Text       = "User defined function",
                    Name       = name.ToUpper(),
                    Tag        = new UserDefinedFunctionClass(),
                    ImageIndex = (int)eImageIndex.FUNCTION
                };
                return(node);

            case StaticVariablesClass.ForeignKeyStr:
                node = new TreeNode()
                {
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsForeignKey,
                    Text       = "Foreign Key",
                    Tag        = new ForeignKeyClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.FOREIGNKEY
                };
                return(node);

            case StaticVariablesClass.FieldsKeyStr:

                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Field",
                    Tag        = new TableFieldClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.FIELDS
                };

                return(node);

            case StaticVariablesClass.FieldsKeyGroupStr:

                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Fields",
                    Name       = name.ToUpper(),
                    Tag        = new TableFieldGroupClass(),
                    ImageIndex = (int)eImageIndex.FIELDS
                };

                return(node);

            case StaticVariablesClass.ViewFieldsKeyStr:

                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Field",
                    Tag        = new ViewFieldClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.FIELDS
                };

                return(node);

            case StaticVariablesClass.ViewFieldsKeyGroupStr:

                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Fields",
                    Name       = name.ToUpper(),
                    Tag        = new  ViewFieldGroupClass(),
                    ImageIndex = (int)eImageIndex.FIELDS
                };

                return(node);

            case StaticVariablesClass.UniquesKeyGroupStr:
                node = new TreeNode()
                {
                    ContextMenuStrip = cmnull,
                    Text             = "Uniques",
                    //    Name = StaticVariablesClass.UniquesKeyGroupStr,
                    Tag        = new  UniqueConstraintsGroupClass(),
                    ImageIndex = (int)eImageIndex.UNIQUE
                };
                return(node);

            case StaticVariablesClass.UniquesKeyStr:

                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Unique",
                    Name       = name.ToUpper(),
                    Tag        = new ConstraintsClass(),
                    ImageIndex = (int)eImageIndex.UNIQUE
                };

                return(node);

            case StaticVariablesClass.NotNullKeyGroupStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Not Nulls",
                    Name       = name.ToUpper(),
                    Tag        = new NotNullConstraintsGroupClass(),
                    ImageIndex = (int)eImageIndex.NOTNULL
                };
                return(node);

            case StaticVariablesClass.NotNullKeyStr:

                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Not Null",
                    Name       = name.ToUpper(),
                    Tag        = new ConstraintsClass(),
                    ImageIndex = (int)eImageIndex.NOTNULL
                };
                return(node);

            case StaticVariablesClass.ChecksKeyGroupStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Checks",
                    Name       = name.ToUpper(),
                    Tag        = new ChecksKeyConstraintsGroupClass(),
                    ImageIndex = (int)eImageIndex.CHECK
                };
                return(node);

            case StaticVariablesClass.ChecksKeyStr:

                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Check",
                    Name       = name.ToUpper(),
                    Tag        = new ConstraintsClass(),
                    ImageIndex = (int)eImageIndex.CHECK
                };
                return(node);

            case StaticVariablesClass.DependenciesKeyGroupStr:

                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Dependencies",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCY
                };
                return(node);

            case StaticVariablesClass.DependenciesTablesKeyGroupStr:

                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Tables",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCY
                };
                return(node);

            case StaticVariablesClass.DependenciesToTablesKeyGroupStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Dependencies To",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesFromTablesKeyGroupStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Dependencies From",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesTriggersKeyGroupStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Triggers",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCY
                };
                return(node);

            case StaticVariablesClass.DependenciesToTriggersKeyGroupStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = cmnull,
                    Text       = "Dependencies To",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesFromTriggersKeyGroupStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Dependencies From",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesToTriggersKeyStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Dependency to",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesFromTriggersKeyStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Dependency from",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesViewsKeyGroupStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Views",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCY
                };
                return(node);

            case StaticVariablesClass.DependenciesToViewsKeyGroupStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Depends on Views",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesToViewsKeyStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Depends to View",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesFromViewsKeyGroupStr:
                node = new TreeNode()
                {
                    // ContextMenuStrip = cmnull,
                    Text       = "Dependencies from Views",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesFromViewsKeyStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Depends from View",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);


            case StaticVariablesClass.DependenciesFromKeyGroupStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Dependencies from ",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesFromKeyStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Depends from ",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesToKeyGroupStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Dependencies to ",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesToKeyStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Depends to ",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);


            case StaticVariablesClass.DependenciesProceduresKeyGroupStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Procedures",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCY
                };
                return(node);

            case StaticVariablesClass.DependenciesToProceduresKeyGroupStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Depends on Procedures",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesToProceduresKeyStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Depends on procedure",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYTO
                };
                return(node);

            case StaticVariablesClass.DependenciesFromProceduresKeyGroupStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Dependencies From",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyGroupClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.DependenciesFromProceduresKeyStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = cmnull,
                    Text       = "Depends from procedure",
                    Name       = name.ToUpper(),
                    Tag        = new DependencyClass(),
                    ImageIndex = (int)eImageIndex.DEPENDENCYFROM
                };
                return(node);

            case StaticVariablesClass.TriggersKeyGroupStr:
                node = new TreeNode()
                {
                    Text = "Triggers",
                    Name = name.ToUpper(),
                    Tag  = new TriggerGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsTriggerGroup,
                    ImageIndex = (int)eImageIndex.TRIGGERS
                };

                return(node);

            case StaticVariablesClass.TriggersKeyStr:
                node = new TreeNode()
                {
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsTrigger,
                    Text       = "Trigger",
                    Tag        = new TriggerClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.TRIGGERS
                };
                return(node);

            case StaticVariablesClass.SystemTriggersKeyGroupStr:
                node = new TreeNode()
                {
                    Text = "System Triggers",
                    Name = name.ToUpper(),
                    Tag  = new TriggerGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsTriggerGroup,
                    ImageIndex = (int)eImageIndex.TRIGGERS
                };

                return(node);

            case StaticVariablesClass.SystemTriggersKeyStr:
                node = new TreeNode()
                {
                    //ContextMenuStrip = ContextMenusClass.Instance().cmsTrigger,
                    Text       = "System Trigger",
                    Tag        = new TriggerClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.TRIGGERS
                };
                return(node);


            case StaticVariablesClass.IndicesKeyGroupStr:
                node = new TreeNode()
                {
                    Text = "Indices",
                    Name = name.ToUpper(),
                    Tag  = new IndexGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsIndicesGroup,
                    ImageIndex = (int)eImageIndex.INDEX
                };
                return(node);

            case StaticVariablesClass.SystemIndicesKeyStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = ContextMenusClass.Instance().cmsIndices,
                    Text       = "System-Index",
                    Tag        = new IndexClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.INDEX
                };
                return(node);

            case StaticVariablesClass.SystemIndicesKeyGroupStr:
                node = new TreeNode()
                {
                    Text = "System-Indices",
                    Name = name.ToUpper(),
                    Tag  = new IndexGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsIndicesGroup,
                    ImageIndex = (int)eImageIndex.INDEX
                };
                return(node);

            case StaticVariablesClass.IndicesKeyStr:
                node = new TreeNode()
                {
                    //  ContextMenuStrip = ContextMenusClass.Instance().cmsIndices,
                    Text       = "Index",
                    Tag        = new IndexClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.INDEX
                };
                return(node);

            case StaticVariablesClass.RolesKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Roles",
                    Tag  = new RoleGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsRolesGroup,
                    ImageIndex = (int)eImageIndex.ROLES
                };
                return(node);

            case StaticVariablesClass.RolesKeyStr:
                node = new TreeNode()
                {
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsRoles,
                    Text       = "Role",
                    Tag        = new RoleClass(),
                    Name       = name.ToUpper(),
                    ImageIndex = (int)eImageIndex.ROLES
                };
                return(node);

            case StaticVariablesClass.GeneratorsKeyGroupStr:
                node = new TreeNode()
                {
                    Text = "Generators",
                    Name = name.ToUpper(),
                    Tag  = new GeneratorGroupClass(),
                    // ContextMenuStrip = ContextMenusClass.Instance().cmsGeneratorGroup,
                    ImageIndex = (int)eImageIndex.GENERATORS
                };
                return(node);

            case StaticVariablesClass.GeneratorsKeyStr:
                node = new TreeNode()
                {
                    Text = "Generators",
                    Name = name.ToUpper(),
                    Tag  = new GeneratorClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsGenerator,
                    ImageIndex = (int)eImageIndex.GENERATORS
                };
                return(node);

            case StaticVariablesClass.CommonTablesKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Tables",
                    Tag  = new TableGroupClass(),
                    //  ContextMenuStrip = ContextMenusClass.Instance().cmsTableGroup,
                    ImageIndex = (int)eImageIndex.TABLES
                };
                return(node);

            case StaticVariablesClass.TablesKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Table",
                    Tag  = new TableClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsTable,
                    ImageIndex = (int)eImageIndex.TABLES
                };
                return(node);

            case StaticVariablesClass.SystemTablesKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "System Tables",
                    Tag  = new SystemTableGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsSystemTableGroup,
                    ImageIndex = (int)eImageIndex.TABLES
                };
                return(node);

            case StaticVariablesClass.SystemTablesKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Systemtable",
                    Tag  = new SystemTableClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsSystemTable,
                    ImageIndex = (int)eImageIndex.TABLES
                };
                return(node);

            case StaticVariablesClass.ViewsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Views",
                    Tag  = new ViewGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsViewGroup,
                    ImageIndex = (int)eImageIndex.VIEW
                };
                return(node);

            case StaticVariablesClass.ViewsKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "View",
                    Tag  = new ViewClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsView,
                    ImageIndex = (int)eImageIndex.VIEW
                };
                return(node);


            case StaticVariablesClass.ConstraintsViewsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Constraints Views",
                    Tag  = new ViewGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsViewGroup,
                    ImageIndex = (int)eImageIndex.VIEW
                };
                return(node);

            case StaticVariablesClass.ConstraintsViewsKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Constraints for View",
                    Tag  = new ViewClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsView,
                    ImageIndex = (int)eImageIndex.VIEW
                };
                return(node);

            case StaticVariablesClass.DomainsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Domains",
                    Tag  = new DomainGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsDomainGroup,
                    ImageIndex = (int)eImageIndex.DOMAIN
                };
                return(node);

            case StaticVariablesClass.DomainsKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "Domain",
                    Tag  = new DomainClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsDomain,
                    ImageIndex = (int)eImageIndex.DOMAIN
                };
                return(node);

            case StaticVariablesClass.SystemDomainsKeyGroupStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "System Domains",
                    Tag  = new DomainGroupClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsDomainGroup,
                    ImageIndex = (int)eImageIndex.DOMAIN
                };
                return(node);

            case StaticVariablesClass.SystemDomainsKeyStr:
                node = new TreeNode()
                {
                    Name = name.ToUpper(),
                    Text = "System Domain",
                    Tag  = new DomainClass(),
                    //   ContextMenuStrip = ContextMenusClass.Instance().cmsDomain,
                    ImageIndex = (int)eImageIndex.DOMAIN
                };
                return(node);
            }
            NotifiesClass.Instance.AddToERROR("DataCLassFactory->GetNode->" + name + " not created", "GetNode");
            return(null);
        }
Example #13
0
    private void presentRightClickMenu(ContextMenuStrip menu)
    {
        //clear all items currently in the menu
        menu.Items.Clear();

        //is anything selected?
        if (p_Tree.SelectedNode == null) { return; }

        //position the menu where the mouse is
        menu.SetBounds(Cursor.Position.X, Cursor.Position.Y, menu.Width, menu.Height);
        menu.Hide(); menu.Show();

        //get the selected tag
        object tag = p_Tree.SelectedNode.Tag;

        /*Solution entry*/
        if (tag is Solution) {
            return;
        }

        /*ProjectEntity/Project items*/
        if (tag is Project || tag is ProjectDirectory) {
            ToolStripMenuItem add = (ToolStripMenuItem)menu.Items.Add("Add", null);

            add.DropDownItems.Add(getRightClickItem_Add_NewItem());
            add.DropDownItems.Add(getRightClickItem_Add_ExistingItem());
            add.DropDownItems.Add(getRightClickItem_Add_NewFolder());

            menu.Items.Add(new ToolStripSeparator());
        }

        #region Clipboard
        ToolStripItem cut = menu.Items.Add("Cut", Icons.GetBitmap("menu.cut", 16), null);
        ToolStripItem copy = menu.Items.Add("Copy", Icons.GetBitmap("menu.copy", 16), null);
        ToolStripItem paste = menu.Items.Add("Paste", Icons.GetBitmap("menu.paste", 16), null);
        menu.Items.Add(getRightClickItem_Delete());
        menu.Items.Add(new ToolStripSeparator());
        #endregion
    }
Example #14
0
    // コンテキストメニューの追加
    private void addContextMenu()
    {
        // コンテキストメニュー
        ContextMenuStrip cms = new ContextMenuStrip();
        // 追加されるメニュー
        ToolStripMenuItem exit = new ToolStripMenuItem("終了");
        // メニューの追加
        cms.Items.AddRange(
            new ToolStripMenuItem[]{exit}
            );
        // メニューのクリックイベントハンドラの追加
        exit.Click += new EventHandler(menu_exitClick);

        // フォームにコンテキストメニューの追加
        this.ContextMenuStrip = cms;
    }
 private void InitializeComponent()
 {
     this.components = new Container();
     this.mnuJSONTree = new ContextMenuStrip(this.components);
     this.tsmiCopyNode = new ToolStripMenuItem();
     this.tsmiSendNodeToTextWizard = new ToolStripMenuItem();
     this.pnlFooter = new Panel();
     this.lblStatus = new Label();
     this.txtSearch = new TextBox();
     this.btnCollapseAll = new Button();
     this.btnExpandAll = new Button();
     this.tvJSON = new TreeView();
     this.mnuJSONTree.SuspendLayout();
     this.pnlFooter.SuspendLayout();
     base.SuspendLayout();
     ToolStripItem[] toolStripItemArray = new ToolStripItem[2];
     toolStripItemArray[0] = this.tsmiCopyNode;
     toolStripItemArray[1] = this.tsmiSendNodeToTextWizard;
     this.mnuJSONTree.Items.AddRange(toolStripItemArray);
     this.mnuJSONTree.Name = "contextMenuStrip1";
     this.mnuJSONTree.Size = new Size(185, 48);
     this.mnuJSONTree.Opening += new CancelEventHandler(this.mnuJSONTree_Opening);
     this.tsmiCopyNode.Name = "tsmiCopyNode";
     this.tsmiCopyNode.Size = new Size(184, 22);
     this.tsmiCopyNode.Text = "&Copy";
     this.tsmiCopyNode.Click += new EventHandler(this.tsmiCopyNode_Click);
     this.tsmiSendNodeToTextWizard.Name = "tsmiSendNodeToTextWizard";
     this.tsmiSendNodeToTextWizard.Size = new Size(184, 22);
     this.tsmiSendNodeToTextWizard.Text = "S&end to TextWizard...";
     this.tsmiSendNodeToTextWizard.Click += new EventHandler(this.tsmiSendNodeToTextWizard_Click);
     this.pnlFooter.Controls.Add(this.lblStatus);
     this.pnlFooter.Controls.Add(this.txtSearch);
     this.pnlFooter.Controls.Add(this.btnCollapseAll);
     this.pnlFooter.Controls.Add(this.btnExpandAll);
     this.pnlFooter.Dock = DockStyle.Bottom;
     this.pnlFooter.Location = new Point(0, 272);
     this.pnlFooter.Name = "pnlFooter";
     this.pnlFooter.Size = new Size(489, 25);
     this.pnlFooter.TabIndex = 1;
     this.lblStatus.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
     this.lblStatus.Location = new Point(162, 3);
     this.lblStatus.Name = "lblStatus";
     this.lblStatus.Size = new Size(314, 20);
     this.lblStatus.TabIndex = 3;
     this.lblStatus.TextAlign = ContentAlignment.MiddleLeft;
     this.txtSearch.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
     this.txtSearch.Location = new Point(421, 2);
     this.txtSearch.Name = "txtSearch";
     this.txtSearch.Size = new Size(65, 21);
     this.txtSearch.TabIndex = 2;
     this.txtSearch.Visible = false;
     this.btnCollapseAll.Location = new Point(81, 2);
     this.btnCollapseAll.Name = "btnCollapseAll";
     this.btnCollapseAll.Size = new Size(75, 23);
     this.btnCollapseAll.TabIndex = 1;
     this.btnCollapseAll.Text = "Collapse";
     this.btnCollapseAll.UseVisualStyleBackColor = true;
     this.btnCollapseAll.Click += new EventHandler(this.btnCollapseAll_Click);
     this.btnExpandAll.Location = new Point(0, 2);
     this.btnExpandAll.Name = "btnExpandAll";
     this.btnExpandAll.Size = new Size(75, 23);
     this.btnExpandAll.TabIndex = 0;
     this.btnExpandAll.Text = "Expand All";
     this.btnExpandAll.UseVisualStyleBackColor = true;
     this.btnExpandAll.Click += new EventHandler(this.btnExpandAll_Click);
     this.tvJSON.BackColor = Color.AliceBlue;
     this.tvJSON.ContextMenuStrip = this.mnuJSONTree;
     this.tvJSON.Dock = DockStyle.Fill;
     this.tvJSON.Font = new Font("Tahoma", 8.25f);
     this.tvJSON.Location = new Point(0, 0);
     this.tvJSON.Name = "tvJSON";
     this.tvJSON.Size = new Size(489, 272);
     this.tvJSON.TabIndex = 0;
     this.tvJSON.KeyDown += new KeyEventHandler(this.tvXML_KeyDown);
     base.Controls.Add(this.tvJSON);
     base.Controls.Add(this.pnlFooter);
     this.Font = new Font("Tahoma", 8.25f);
     base.Name = "JsonpView";
     base.Size = new Size(489, 297);
     this.mnuJSONTree.ResumeLayout(false);
     this.pnlFooter.ResumeLayout(false);
     this.pnlFooter.PerformLayout();
     base.ResumeLayout(false);
 }
                private void SetButtons()
                {
                    if (DockPane.ActiveContent != null)
                    {
                        m_buttonClose.Enabled = DockPane.ActiveContent.DockHandler.CloseButton;
                        m_contextmenu = DockPane.ActiveContent.DockHandler.TabPageContextMenuStrip;
                        if (m_contextmenu != null)
                        {
                            m_buttonOptions.Visible = true;
                            if (m_buttonOptions.ToolTipText == "")
                            {
                                m_buttonOptions.ToolTipText = m_contextmenu.Text;
                            }
                        }
                        else
                        {
                            m_buttonOptions.Visible = false;
                        }
                    }
                    else
                    {
                        m_buttonClose.Enabled = false;
                    }

                    m_buttonAutoHide.Visible = ! DockPane.IsFloat;
                    if (DockPane.IsAutoHide)
                    {
                        m_buttonAutoHide.ImageEnabled = ImageAutoHideYes;
                    }
                    else
                    {
                        m_buttonAutoHide.ImageEnabled = ImageAutoHideNo;
                    }

                    m_buttonAutoHide.IsActivated = DockPane.IsActivated;
                    m_buttonClose.IsActivated = DockPane.IsActivated;
                    m_buttonOptions.IsActivated = DockPane.IsActivated;

                    if (DockPane.IsActivated)
                    {
                        m_buttonAutoHide.ForeColor = ActiveTextColor;
                        m_buttonAutoHide.BorderColor = ActiveButtonBorderColor;
                    }
                    else
                    {
                        m_buttonAutoHide.ForeColor = InactiveTextColor;
                        m_buttonAutoHide.BorderColor = InactiveButtonBorderColor;
                    }

                    m_buttonClose.ForeColor = m_buttonAutoHide.ForeColor;
                    m_buttonClose.BorderColor = m_buttonAutoHide.BorderColor;
                    m_buttonOptions.ForeColor = m_buttonAutoHide.ForeColor;
                    m_buttonOptions.BorderColor = m_buttonAutoHide.BorderColor;
                }
        /// <summary>
        /// Enable Zoom and Pan Controls.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="selectionChanged">Selection changed callabck. Triggered when user select a point with selec tool.</param>
        /// <param name="cursorMoved">Cursor moved callabck. Triggered when user move the mouse in chart area.</param>
        /// <param name="zoomChanged">Callback triggered when chart has 
        /// zoomed in or out (and on first painting of the chart).</param>
        /// <param name="option">Additional user options</param>
        /// <remarks>
        /// <para>Callback are optional (pass in null to ignore).</para>
        /// <para>WARNING: Add or Remove Chart Area or Chart Series after enabled zoom and pan controls may cause unexpected behavior.</para>
        /// <para>Recommended to enable the zoom and pan controls after configure the <see cref="ChartArea"/> and <see cref="Series"/>.</para>
        /// </remarks>
        public static void EnableZoomAndPanControls(this Chart sender,
            CursorPositionChanged selectionChanged,
            CursorPositionChanged cursorMoved,
            ZoomChanged zoomChanged = null, ChartOption option = null)
        {
            if (!ChartTool.ContainsKey(sender))
            {
                ChartTool[sender] = new ChartData(sender);
                ChartData ptrChartData = ChartTool[sender];
                ptrChartData.Option = (option == null) ? new ChartOption() : option;
                ptrChartData.Backup();
                ptrChartData.PositionChangedCallback = selectionChanged;
                ptrChartData.CursorMovedCallback = cursorMoved;
                ptrChartData.ZoomChangedCallback = zoomChanged;

                //Scan through series to identify valid ChartArea
                Chart ptrChart = sender;
                foreach (ChartArea cArea in ptrChart.ChartAreas)
                {
                    IEnumerable<Series> chartSeries = ptrChart.Series.Where(n => n.ChartArea == cArea.Name);
                    if (chartSeries.Count() == 0)
                    {
                        Debug.WriteLine(string.Format("WARNING: Chart Area [{0}] does not contains any series.", cArea.Name));
                    }
                    else if (chartSeries.Where(n => UnsupportedChartType.Contains(n.ChartType)).Count() > 0)
                    {
                        Debug.WriteLine(string.Format("WARNING: Chart Area [{0}] contains unsupported series.", cArea.Name));
                    }
                    else ptrChartData.SupportedChartArea.Add(cArea);
                }

                //Populate Context menu
                if (ptrChart.ContextMenuStrip == null)
                {
                    //Context menu is empty, use ChartContextMenuStrip directly
                    ptrChart.ContextMenuStrip = new ContextMenuStrip();
                    ptrChart.ContextMenuStrip.Items.AddRange(ChartTool[ptrChart].MenuItems.ToArray());
                }
                else
                {
                    //User assigned context menu to chart. Merge current menu with ChartContextMenuStrip.
                    ContextMenuStrip newMenu = new ContextMenuStrip();
                    newMenu.Items.AddRange(ChartTool[sender].MenuItems.ToArray());

                    foreach (object ptrItem in ChartTool[sender].ContextMenuStrip.Items)
                    {
                        if (ptrItem is ToolStripMenuItem) newMenu.Items.Add(((ToolStripMenuItem)ptrItem).Clone());
                        else if (ptrItem is ToolStripSeparator) newMenu.Items.Add(new ToolStripSeparator());
                    }
                    ptrChart.ContextMenuStrip = newMenu;
                    ptrChart.ContextMenuStrip.AddHandlers(ChartTool[sender].ContextMenuStrip);
                }
                ptrChart.ContextMenuStrip.Opening += ChartContext_Opening;
                ptrChart.ContextMenuStrip.ItemClicked += ChartContext_ItemClicked;
                ptrChart.MouseWheel += ChartControl_MouseWheel;
                ptrChart.MouseDown += ChartControl_MouseDown;
                ptrChart.MouseMove += ChartControl_MouseMove;
                ptrChart.MouseUp += ChartControl_MouseUp;

                //Override settings.
                foreach (ChartArea ptrChartArea in ptrChart.ChartAreas)
                {
                    ptrChartArea.CursorX.AutoScroll = false;
                    ptrChartArea.CursorX.Interval = 1e-06;
                    ptrChartArea.CursorY.AutoScroll = false;
                    ptrChartArea.CursorY.Interval = 1e-06;

                    ptrChartArea.AxisX.ScrollBar.Enabled = false;
                    ptrChartArea.AxisX2.ScrollBar.Enabled = false;
                    ptrChartArea.AxisY.ScrollBar.Enabled = false;
                    ptrChartArea.AxisY2.ScrollBar.Enabled = false;
                }
                SetChartControlState(sender, MSChartExtensionToolState.Select);
            }
        }
        private void NodesControl_MouseClick(object sender, MouseEventArgs e)
        {
            lastMouseLocation = e.Location;

            if (Context == null)
            {
                return;
            }

            if (e.Button == MouseButtons.Right)
            {
                var methods = Context.GetType().GetMethods();
                var nodes   =
                    methods.Select(
                        x =>
                        new
                        NodeToken()
                {
                    Method    = x,
                    Attribute =
                        x.GetCustomAttributes(typeof(NodeAttribute), false)
                        .Cast <NodeAttribute>()
                        .FirstOrDefault()
                }).Where(x => x.Attribute != null);

                var context = new ContextMenuStrip();
                if (graph.Nodes.Exists(x => x.IsSelected))
                {
                    context.Items.Add("Delete Node(s)", null, ((o, args) =>
                    {
                        DeleteSelectedNodes();
                    }));
                    context.Items.Add("Duplicate Node(s)", null, ((o, args) =>
                    {
                        DuplicateSelectedNodes();
                    }));
                    context.Items.Add("Change Color ...", null, ((o, args) =>
                    {
                        ChangeSelectedNodesColor();
                    }));
                    if (graph.Nodes.Count(x => x.IsSelected) == 2)
                    {
                        var sel = graph.Nodes.Where(x => x.IsSelected).ToArray();
                        context.Items.Add("Check Impact", null, ((o, args) =>
                        {
                            if (HasImpact(sel[0], sel[1]) || HasImpact(sel[1], sel[0]))
                            {
                                MessageBox.Show("One node has impact on other.", "Impact detected.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                            else
                            {
                                MessageBox.Show("These nodes not impacts themselves.", "No impact.", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                        }));
                    }
                    context.Items.Add(new ToolStripSeparator());
                }
                if (allContextItems.Values.Any(x => x > 0))
                {
                    var handy = allContextItems.Where(x => x.Value > 0 && !string.IsNullOrEmpty(((x.Key.Tag) as NodeToken).Attribute.Menu)).OrderByDescending(x => x.Value).Take(8);
                    foreach (var kv in handy)
                    {
                        context.Items.Add(kv.Key);
                    }
                    context.Items.Add(new ToolStripSeparator());
                }
                foreach (var node in nodes.OrderBy(x => x.Attribute.Path))
                {
                    AddToMenu(context.Items, node, node.Attribute.Path, (s, ev) =>
                    {
                        var tag = (s as ToolStripMenuItem).Tag as NodeToken;

                        var nv           = new NodeVisual();
                        nv.X             = lastMouseLocation.X;
                        nv.Y             = lastMouseLocation.Y;
                        nv.Type          = node.Method;
                        nv.Callable      = node.Attribute.IsCallable;
                        nv.Name          = node.Attribute.Name;
                        nv.Order         = graph.Nodes.Count;
                        nv.ExecInit      = node.Attribute.IsExecutionInitiator;
                        nv.XmlExportName = node.Attribute.XmlExportName;

                        if (node.Attribute.CustomEditor != null)
                        {
                            Control ctrl    = null;
                            nv.CustomEditor = ctrl = Activator.CreateInstance(node.Attribute.CustomEditor) as Control;
                            if (ctrl != null)
                            {
                                ctrl.Tag = nv;
                                Controls.Add(ctrl);
                            }
                            nv.LayoutEditor();
                        }

                        graph.Nodes.Add(nv);
                        Refresh();
                        needRepaint = true;
                    });
                }
                context.Show(MousePosition);
            }
        }
Example #19
0
    private void initializeFileEditor()
    {
        //intitialize the tabs
        p_Tabs = new TabControl {
            Dock = DockStyle.Fill,
            Visible = false
        };

        //initialize the right click menu for the tabs
        ContextMenuStrip rightClickMenu = new ContextMenuStrip();
        rightClickMenu.Opening += delegate(object sender, System.ComponentModel.CancelEventArgs e) {
            rightClickMenu.Items.Clear();
            if (p_Tabs.SelectedTab == null) { return; }
            rightClickMenu.Items.Add("Close", null, menu_file_closeFile);
            rightClickMenu.Items.Add("Close all but this", null, menu_file_closeAllOtherFiles);
            rightClickMenu.Items.Add(new ToolStripSeparator());
            rightClickMenu.Items.Add("Save", Icons.GetBitmap("menu.save", 16), menu_file_save);
        };
        p_Tabs.ContextMenuStrip = rightClickMenu;

        //add the tab control
        p_WorkingBodyContainer.Panel1.Controls.Add(p_Tabs);

        //load all the files that were loaded the last time the program was running
        if (RuntimeState.ObjectExists("mainIDE.openedFiles") && p_SolutionExplorer.Solution != null) {
            byte[] rawData = RuntimeState.GetObjectData("mainIDE.openedFiles");
            string[] files = Helpers.StringArrayFromBytes(rawData, false);
            foreach (string file in files) {
                //does the file still exist?
                if (!File.Exists(file)) { continue; }

                //add the file
                AddTab(file);
            }

            //select the selected file in the previous instance
            if (RuntimeState.ObjectExists("mainIDE.openedFile")) {
                string fileSelected = RuntimeState.GetObjectString("mainIDE.openedFile");
                fileSelected = fileSelected.ToLower();
                foreach (TabPage t in p_Tabs.TabPages) {
                    if (((string)t.Tag).ToLower() == fileSelected) {
                        p_Tabs.SelectedTab = t;
                        break;
                    }
                }
            }
        }
    }
        private void InitializeComponent()
        {
            cmsHistory                    = new ContextMenuStrip();
            tsmiOpen                      = new ToolStripMenuItem();
            tsmiOpenURL                   = new ToolStripMenuItem();
            tsmiOpenShortenedURL          = new ToolStripMenuItem();
            tsmiOpenThumbnailURL          = new ToolStripMenuItem();
            tsmiOpenDeletionURL           = new ToolStripMenuItem();
            tssOpen1                      = new ToolStripSeparator();
            tsmiOpenFile                  = new ToolStripMenuItem();
            tsmiOpenFolder                = new ToolStripMenuItem();
            tsmiCopy                      = new ToolStripMenuItem();
            tsmiCopyURL                   = new ToolStripMenuItem();
            tsmiCopyShortenedURL          = new ToolStripMenuItem();
            tsmiCopyThumbnailURL          = new ToolStripMenuItem();
            tsmiCopyDeletionURL           = new ToolStripMenuItem();
            tssCopy1                      = new ToolStripSeparator();
            tsmiCopyFile                  = new ToolStripMenuItem();
            tsmiCopyImage                 = new ToolStripMenuItem();
            tsmiCopyText                  = new ToolStripMenuItem();
            tssCopy2                      = new ToolStripSeparator();
            tsmiCopyHTMLLink              = new ToolStripMenuItem();
            tsmiCopyHTMLImage             = new ToolStripMenuItem();
            tsmiCopyHTMLLinkedImage       = new ToolStripMenuItem();
            tssCopy3                      = new ToolStripSeparator();
            tsmiCopyForumLink             = new ToolStripMenuItem();
            tsmiCopyForumImage            = new ToolStripMenuItem();
            tsmiCopyForumLinkedImage      = new ToolStripMenuItem();
            tssCopy4                      = new ToolStripSeparator();
            tsmiCopyMarkdownLink          = new ToolStripMenuItem();
            tsmiCopyMarkdownImage         = new ToolStripMenuItem();
            tsmiCopyMarkdownLinkedImage   = new ToolStripMenuItem();
            tssCopy5                      = new ToolStripSeparator();
            tsmiCopyFilePath              = new ToolStripMenuItem();
            tsmiCopyFileName              = new ToolStripMenuItem();
            tsmiCopyFileNameWithExtension = new ToolStripMenuItem();
            tsmiCopyFolder                = new ToolStripMenuItem();
            tsmiShow                      = new ToolStripMenuItem();
            tsmiShowImagePreview          = new ToolStripMenuItem();
            tsmiShowMoreInfo              = new ToolStripMenuItem();
            tsmiUploadFile                = new ToolStripMenuItem();
            tsmiEditImage                 = new ToolStripMenuItem();
            cmsHistory.SuspendLayout();

            //
            // cmsHistory
            //
            cmsHistory.Items.AddRange(new ToolStripItem[]
            {
                tsmiOpen,
                tsmiCopy,
                tsmiShow,
                tsmiUploadFile,
                tsmiEditImage
            });
            cmsHistory.Name            = "cmsHistory";
            cmsHistory.ShowImageMargin = false;
            cmsHistory.Size            = new Size(128, 92);
            cmsHistory.Enabled         = false;
            //
            // tsmiOpen
            //
            tsmiOpen.DropDownItems.AddRange(new ToolStripItem[]
            {
                tsmiOpenURL,
                tsmiOpenShortenedURL,
                tsmiOpenThumbnailURL,
                tsmiOpenDeletionURL,
                tssOpen1,
                tsmiOpenFile,
                tsmiOpenFolder
            });
            tsmiOpen.Name = "tsmiOpen";
            tsmiOpen.Size = new Size(127, 22);
            tsmiOpen.Text = Resources.HistoryItemManager_InitializeComponent_Open;
            //
            // tsmiOpenURL
            //
            tsmiOpenURL.Name   = "tsmiOpenURL";
            tsmiOpenURL.Size   = new Size(156, 22);
            tsmiOpenURL.Text   = Resources.HistoryItemManager_InitializeComponent_URL;
            tsmiOpenURL.Click += tsmiOpenURL_Click;
            //
            // tsmiOpenShortenedURL
            //
            tsmiOpenShortenedURL.Name   = "tsmiOpenShortenedURL";
            tsmiOpenShortenedURL.Size   = new Size(156, 22);
            tsmiOpenShortenedURL.Text   = Resources.HistoryItemManager_InitializeComponent_Shortened_URL;
            tsmiOpenShortenedURL.Click += tsmiOpenShortenedURL_Click;
            //
            // tsmiOpenThumbnailURL
            //
            tsmiOpenThumbnailURL.Name   = "tsmiOpenThumbnailURL";
            tsmiOpenThumbnailURL.Size   = new Size(156, 22);
            tsmiOpenThumbnailURL.Text   = Resources.HistoryItemManager_InitializeComponent_Thumbnail_URL;
            tsmiOpenThumbnailURL.Click += tsmiOpenThumbnailURL_Click;
            //
            // tsmiOpenDeletionURL
            //
            tsmiOpenDeletionURL.Name   = "tsmiOpenDeletionURL";
            tsmiOpenDeletionURL.Size   = new Size(156, 22);
            tsmiOpenDeletionURL.Text   = Resources.HistoryItemManager_InitializeComponent_Deletion_URL;
            tsmiOpenDeletionURL.Click += tsmiOpenDeletionURL_Click;
            //
            // tssOpen1
            //
            tssOpen1.Name = "tssOpen1";
            tssOpen1.Size = new Size(153, 6);
            //
            // tsmiOpenFile
            //
            tsmiOpenFile.Name   = "tsmiOpenFile";
            tsmiOpenFile.Size   = new Size(156, 22);
            tsmiOpenFile.Text   = Resources.HistoryItemManager_InitializeComponent_File;
            tsmiOpenFile.Click += tsmiOpenFile_Click;
            //
            // tsmiOpenFolder
            //
            tsmiOpenFolder.Name   = "tsmiOpenFolder";
            tsmiOpenFolder.Size   = new Size(156, 22);
            tsmiOpenFolder.Text   = Resources.HistoryItemManager_InitializeComponent_Folder;
            tsmiOpenFolder.Click += tsmiOpenFolder_Click;
            //
            // tsmiCopy
            //
            tsmiCopy.DropDownItems.AddRange(new ToolStripItem[]
            {
                tsmiCopyURL,
                tsmiCopyShortenedURL,
                tsmiCopyThumbnailURL,
                tsmiCopyDeletionURL,
                tssCopy1,
                tsmiCopyFile,
                tsmiCopyImage,
                tsmiCopyText,
                tssCopy2,
                tsmiCopyHTMLLink,
                tsmiCopyHTMLImage,
                tsmiCopyHTMLLinkedImage,
                tssCopy3,
                tsmiCopyForumLink,
                tsmiCopyForumImage,
                tsmiCopyForumLinkedImage,
                tssCopy4,
                tsmiCopyMarkdownLink,
                tsmiCopyMarkdownImage,
                tsmiCopyMarkdownLinkedImage,
                tssCopy5,
                tsmiCopyFilePath,
                tsmiCopyFileName,
                tsmiCopyFileNameWithExtension,
                tsmiCopyFolder
            });
            tsmiCopy.Name = "tsmiCopy";
            tsmiCopy.Size = new Size(127, 22);
            tsmiCopy.Text = Resources.HistoryItemManager_InitializeComponent_Copy;
            //
            // tsmiCopyURL
            //
            tsmiCopyURL.Name   = "tsmiCopyURL";
            tsmiCopyURL.Size   = new Size(233, 22);
            tsmiCopyURL.Text   = Resources.HistoryItemManager_InitializeComponent_URL;
            tsmiCopyURL.Click += tsmiCopyURL_Click;
            //
            // tsmiCopyShortenedURL
            //
            tsmiCopyShortenedURL.Name   = "tsmiCopyShortenedURL";
            tsmiCopyShortenedURL.Size   = new Size(233, 22);
            tsmiCopyShortenedURL.Text   = Resources.HistoryItemManager_InitializeComponent_Shortened_URL;
            tsmiCopyShortenedURL.Click += tsmiCopyShortenedURL_Click;
            //
            // tsmiCopyThumbnailURL
            //
            tsmiCopyThumbnailURL.Name   = "tsmiCopyThumbnailURL";
            tsmiCopyThumbnailURL.Size   = new Size(233, 22);
            tsmiCopyThumbnailURL.Text   = Resources.HistoryItemManager_InitializeComponent_Thumbnail_URL;
            tsmiCopyThumbnailURL.Click += tsmiCopyThumbnailURL_Click;
            //
            // tsmiCopyDeletionURL
            //
            tsmiCopyDeletionURL.Name   = "tsmiCopyDeletionURL";
            tsmiCopyDeletionURL.Size   = new Size(233, 22);
            tsmiCopyDeletionURL.Text   = Resources.HistoryItemManager_InitializeComponent_Deletion_URL;
            tsmiCopyDeletionURL.Click += tsmiCopyDeletionURL_Click;
            //
            // tssCopy1
            //
            tssCopy1.Name = "tssCopy1";
            tssCopy1.Size = new Size(230, 6);
            //
            // tsmiCopyFile
            //
            tsmiCopyFile.Name   = "tsmiCopyFile";
            tsmiCopyFile.Size   = new Size(233, 22);
            tsmiCopyFile.Text   = Resources.HistoryItemManager_InitializeComponent_File;
            tsmiCopyFile.Click += tsmiCopyFile_Click;
            //
            // tsmiCopyImage
            //
            tsmiCopyImage.Name   = "tsmiCopyImage";
            tsmiCopyImage.Size   = new Size(233, 22);
            tsmiCopyImage.Text   = Resources.HistoryItemManager_InitializeComponent_Image;
            tsmiCopyImage.Click += tsmiCopyImage_Click;
            //
            // tsmiCopyText
            //
            tsmiCopyText.Name   = "tsmiCopyText";
            tsmiCopyText.Size   = new Size(233, 22);
            tsmiCopyText.Text   = Resources.HistoryItemManager_InitializeComponent_Text;
            tsmiCopyText.Click += tsmiCopyText_Click;
            //
            // tssCopy2
            //
            tssCopy2.Name = "tssCopy2";
            tssCopy2.Size = new Size(230, 6);
            //
            // tsmiCopyHTMLLink
            //
            tsmiCopyHTMLLink.Name   = "tsmiCopyHTMLLink";
            tsmiCopyHTMLLink.Size   = new Size(233, 22);
            tsmiCopyHTMLLink.Text   = Resources.HistoryItemManager_InitializeComponent_HTML_link;
            tsmiCopyHTMLLink.Click += tsmiCopyHTMLLink_Click;
            //
            // tsmiCopyHTMLImage
            //
            tsmiCopyHTMLImage.Name   = "tsmiCopyHTMLImage";
            tsmiCopyHTMLImage.Size   = new Size(233, 22);
            tsmiCopyHTMLImage.Text   = Resources.HistoryItemManager_InitializeComponent_HTML_image;
            tsmiCopyHTMLImage.Click += tsmiCopyHTMLImage_Click;
            //
            // tsmiCopyHTMLLinkedImage
            //
            tsmiCopyHTMLLinkedImage.Name   = "tsmiCopyHTMLLinkedImage";
            tsmiCopyHTMLLinkedImage.Size   = new Size(233, 22);
            tsmiCopyHTMLLinkedImage.Text   = Resources.HistoryItemManager_InitializeComponent_HTML_linked_image;
            tsmiCopyHTMLLinkedImage.Click += tsmiCopyHTMLLinkedImage_Click;
            //
            // tssCopy3
            //
            tssCopy3.Name = "tssCopy3";
            tssCopy3.Size = new Size(230, 6);
            //
            // tsmiCopyForumLink
            //
            tsmiCopyForumLink.Name   = "tsmiCopyForumLink";
            tsmiCopyForumLink.Size   = new Size(233, 22);
            tsmiCopyForumLink.Text   = Resources.HistoryItemManager_InitializeComponent_Forum__BBCode__link;
            tsmiCopyForumLink.Click += tsmiCopyForumLink_Click;
            //
            // tsmiCopyForumImage
            //
            tsmiCopyForumImage.Name   = "tsmiCopyForumImage";
            tsmiCopyForumImage.Size   = new Size(233, 22);
            tsmiCopyForumImage.Text   = Resources.HistoryItemManager_InitializeComponent_Forum__BBCode__image;
            tsmiCopyForumImage.Click += tsmiCopyForumImage_Click;
            //
            // tsmiCopyForumLinkedImage
            //
            tsmiCopyForumLinkedImage.Name   = "tsmiCopyForumLinkedImage";
            tsmiCopyForumLinkedImage.Size   = new Size(233, 22);
            tsmiCopyForumLinkedImage.Text   = Resources.HistoryItemManager_InitializeComponent_Forum__BBCode__linked_image;
            tsmiCopyForumLinkedImage.Click += tsmiCopyForumLinkedImage_Click;
            //
            // tssCopy4
            //
            tssCopy4.Name = "tssCopy4";
            tssCopy4.Size = new Size(230, 6);
            //
            // tsmiCopyMarkdownLink
            //
            tsmiCopyMarkdownLink.Name   = "tsmiCopyMarkdownLink";
            tsmiCopyMarkdownLink.Size   = new Size(233, 22);
            tsmiCopyMarkdownLink.Text   = Resources.HistoryItemManager_InitializeComponent_Markdown__link;
            tsmiCopyMarkdownLink.Click += tsmiCopyMarkdownLink_Click;
            //
            // tsmiCopyMarkdownImage
            //
            tsmiCopyMarkdownImage.Name   = "tsmiCopyMarkdownImage";
            tsmiCopyMarkdownImage.Size   = new Size(233, 22);
            tsmiCopyMarkdownImage.Text   = Resources.HistoryItemManager_InitializeComponent_Markdown__image;
            tsmiCopyMarkdownImage.Click += tsmiCopyMarkdownImage_Click;
            //
            // tsmiCopyMarkdownLinkedImage
            //
            tsmiCopyMarkdownLinkedImage.Name   = "tsmiCopyMarkdownLinkedImage";
            tsmiCopyMarkdownLinkedImage.Size   = new Size(233, 22);
            tsmiCopyMarkdownLinkedImage.Text   = Resources.HistoryItemManager_InitializeComponent_Markdown__linked_image;
            tsmiCopyMarkdownLinkedImage.Click += tsmiCopyMarkdownLinkedImage_Click;
            //
            // tssCopy5
            //
            tssCopy5.Name = "tssCopy5";
            tssCopy5.Size = new Size(230, 6);
            //
            // tsmiCopyFilePath
            //
            tsmiCopyFilePath.Name   = "tsmiCopyFilePath";
            tsmiCopyFilePath.Size   = new Size(233, 22);
            tsmiCopyFilePath.Text   = Resources.HistoryItemManager_InitializeComponent_File_path;
            tsmiCopyFilePath.Click += tsmiCopyFilePath_Click;
            //
            // tsmiCopyFileName
            //
            tsmiCopyFileName.Name   = "tsmiCopyFileName";
            tsmiCopyFileName.Size   = new Size(233, 22);
            tsmiCopyFileName.Text   = Resources.HistoryItemManager_InitializeComponent_File_name;
            tsmiCopyFileName.Click += tsmiCopyFileName_Click;
            //
            // tsmiCopyFileNameWithExtension
            //
            tsmiCopyFileNameWithExtension.Name   = "tsmiCopyFileNameWithExtension";
            tsmiCopyFileNameWithExtension.Size   = new Size(233, 22);
            tsmiCopyFileNameWithExtension.Text   = Resources.HistoryItemManager_InitializeComponent_File_name_with_extension;
            tsmiCopyFileNameWithExtension.Click += tsmiCopyFileNameWithExtension_Click;
            //
            // tsmiCopyFolder
            //
            tsmiCopyFolder.Name   = "tsmiCopyFolder";
            tsmiCopyFolder.Size   = new Size(233, 22);
            tsmiCopyFolder.Text   = Resources.HistoryItemManager_InitializeComponent_Folder;
            tsmiCopyFolder.Click += tsmiCopyFolder_Click;
            //
            // tsmiShow
            //
            tsmiShow.DropDownItems.AddRange(new ToolStripItem[]
            {
                tsmiShowImagePreview,
                tsmiShowMoreInfo
            });
            tsmiShow.Name = "tsmiShow";
            tsmiShow.Size = new Size(127, 22);
            tsmiShow.Text = Resources.HistoryItemManager_InitializeComponent_Show;
            //
            // tsmiShowImagePreview
            //
            tsmiShowImagePreview.Name   = "tsmiShowImagePreview";
            tsmiShowImagePreview.Size   = new Size(127, 22);
            tsmiShowImagePreview.Text   = Resources.HistoryItemManager_InitializeComponent_Image_preview;
            tsmiShowImagePreview.Click += tsmiShowImagePreview_Click;
            //
            // tsmiShowMoreInfo
            //
            tsmiShowMoreInfo.Name   = "tsmiShowMoreInfo";
            tsmiShowMoreInfo.Size   = new Size(127, 22);
            tsmiShowMoreInfo.Text   = Resources.HistoryItemManager_InitializeComponent_More_info;
            tsmiShowMoreInfo.Click += tsmiShowMoreInfo_Click;
            //
            // tsmiUploadFile
            //
            tsmiUploadFile.Name   = "tsmiUploadFile";
            tsmiUploadFile.Size   = new Size(127, 22);
            tsmiUploadFile.Text   = Resources.HistoryItemManager_InitializeComponent_UploadFile;
            tsmiUploadFile.Click += tsmiUploadFile_Click;
            //
            // tsmiEditImage
            //
            tsmiEditImage.Name   = "tsmiEditImage";
            tsmiEditImage.Size   = new Size(127, 22);
            tsmiEditImage.Text   = Resources.HistoryItemManager_InitializeComponent_EditImage;
            tsmiEditImage.Click += tsmiEditImage_Click;

            cmsHistory.ResumeLayout(false);
        }
Example #21
0
        public override ContextMenuStrip GetContextMenuStrip()
        {
            if (_contextMenuStrip == null)
            {
                ToolStripMenuItem itemOpenSettings = new ToolStripMenuItem("Open Settings");
                itemOpenSettings.Click += (sender, e) =>
                {
                    List <(string specialType, string varName, WatchVariableSubclass subclass)> varData =
                        new List <(string specialType, string varName, WatchVariableSubclass subclass)>()
                    {
                        ("CompassPosition", "Position", WatchVariableSubclass.String),

                        ("CompassLineHeight", "Line Height", WatchVariableSubclass.Number),
                        ("CompassLineWidth", "Line Width", WatchVariableSubclass.Number),

                        ("CompassArrowHeight", "Arrow Height", WatchVariableSubclass.Number),
                        ("CompassArrowWidth", "Arrow Width", WatchVariableSubclass.Number),

                        ("CompassHorizontalMargin", "Horizontal Margin", WatchVariableSubclass.Number),
                        ("CompassVerticalMargin", "Vertical Margin", WatchVariableSubclass.Number),

                        ("CompassDirectionTextSize", "Direction Text Size", WatchVariableSubclass.Number),
                        ("CompassAngleTextSize", "Angle Text Size", WatchVariableSubclass.Number),

                        ("CompassDirectionTextPosition", "Direction Text Position", WatchVariableSubclass.Number),
                        ("CompassAngleTextPosition", "Angle Text Position", WatchVariableSubclass.Number),

                        ("CompassShowDirectionText", "Show Direction Text", WatchVariableSubclass.Boolean),
                        ("CompassShowAngleText", "Show Angle Text", WatchVariableSubclass.Boolean),

                        ("CompassAngleTextSigned", "Angle Text Signed", WatchVariableSubclass.Boolean),
                    };

                    List <WatchVariableControl> controls = new List <WatchVariableControl>();
                    foreach ((string specialType, string varName, WatchVariableSubclass subclass) in varData)
                    {
                        WatchVariable watchVar = new WatchVariable(
                            memoryTypeName: null,
                            specialType: specialType,
                            baseAddressType: BaseAddressTypeEnum.None,
                            offsetUS: null,
                            offsetJP: null,
                            offsetSH: null,
                            offsetEU: null,
                            offsetDefault: null,
                            mask: null,
                            shift: null,
                            handleMapping: true);
                        WatchVariableControlPrecursor precursor = new WatchVariableControlPrecursor(
                            name: varName,
                            watchVar: watchVar,
                            subclass: subclass,
                            backgroundColor: null,
                            displayType: null,
                            roundingLimit: null,
                            useHex: null,
                            invertBool: null,
                            isYaw: null,
                            coordinate: null,
                            groupList: new List <VariableGroup>()
                        {
                            VariableGroup.Custom
                        });
                        WatchVariableControl control = precursor.CreateWatchVariableControl();
                        controls.Add(control);
                    }

                    VariablePopOutForm form = new VariablePopOutForm();
                    form.Initialize(controls);
                    form.ShowForm();
                };

                _contextMenuStrip = new ContextMenuStrip();
                _contextMenuStrip.Items.Add(itemOpenSettings);
            }

            return(_contextMenuStrip);
        }
Example #22
0
        public SAV_MysteryGiftDB(PKMEditor tabs, SAVEditor sav)
        {
            SAV       = sav.SAV;
            BoxView   = sav;
            PKME_Tabs = tabs;
            InitializeComponent();

            // Preset Filters to only show PKM available for loaded save
            CB_FormatComparator.SelectedIndex = 3; // <=

            PKXBOXES = new[]
            {
                bpkx1, bpkx2, bpkx3, bpkx4, bpkx5, bpkx6,
                bpkx7, bpkx8, bpkx9, bpkx10, bpkx11, bpkx12,
                bpkx13, bpkx14, bpkx15, bpkx16, bpkx17, bpkx18,
                bpkx19, bpkx20, bpkx21, bpkx22, bpkx23, bpkx24,
                bpkx25, bpkx26, bpkx27, bpkx28, bpkx29, bpkx30,

                bpkx31, bpkx32, bpkx33, bpkx34, bpkx35, bpkx36,
                bpkx37, bpkx38, bpkx39, bpkx40, bpkx41, bpkx42,
                bpkx43, bpkx44, bpkx45, bpkx46, bpkx47, bpkx48,
                bpkx49, bpkx50, bpkx51, bpkx52, bpkx53, bpkx54,
                bpkx55, bpkx56, bpkx57, bpkx58, bpkx59, bpkx60,
                bpkx61, bpkx62, bpkx63, bpkx64, bpkx65, bpkx66,
            };

            // Enable Scrolling when hovered over
            foreach (var slot in PKXBOXES)
            {
                // Enable Click
                slot.MouseClick += (sender, e) =>
                {
                    if (ModifierKeys == Keys.Control)
                    {
                        ClickView(sender, e);
                    }
                };
            }

            Counter       = L_Count.Text;
            Viewed        = L_Viewed.Text;
            L_Viewed.Text = ""; // invis for now
            var hover = new ToolTip();

            L_Viewed.MouseEnter += (sender, e) => hover.SetToolTip(L_Viewed, L_Viewed.Text);

            ContextMenuStrip  mnu       = new ContextMenuStrip();
            ToolStripMenuItem mnuView   = new ToolStripMenuItem("View");
            ToolStripMenuItem mnuSaveMG = new ToolStripMenuItem("Save Gift");
            ToolStripMenuItem mnuSavePK = new ToolStripMenuItem("Save PKM");

            // Assign event handlers
            mnuView.Click   += ClickView;
            mnuSaveMG.Click += ClickSaveMG;
            mnuSavePK.Click += ClickSavePK;

            // Add to main context menu
            mnu.Items.AddRange(new ToolStripItem[] { mnuView, mnuSaveMG, mnuSavePK });

            // Assign to datagridview
            foreach (PictureBox p in PKXBOXES)
            {
                p.ContextMenuStrip = mnu;
            }

            // Load Data
            B_Search.Enabled = false;
            L_Count.Text     = "Loading...";
            new Task(LoadDatabase).Start();

            Menu_SearchSettings.DropDown.Closing += (sender, e) =>
            {
                if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked)
                {
                    e.Cancel = true;
                }
            };
            CenterToParent();
        }
Example #23
0
	public MainForm ()
	{
		// 
		// _contextMenuStrip
		// 
		_contextMenuStrip = new ContextMenuStrip ();
		// 
		// _toolStripMenuItem1
		// 
		_toolStripMenuItem1 = new ToolStripMenuItem ();
		_toolStripMenuItem1.Text = "Menu Item 1";
		_contextMenuStrip.Items.Add (_toolStripMenuItem1);
		// 
		// _toolStripMenuItem2
		// 
		_toolStripMenuItem2 = new ToolStripMenuItem ();
		_toolStripMenuItem2.Text = "Menu Item 2";
		_contextMenuStrip.Items.Add (_toolStripMenuItem2);
		// 
		// _toolStripMenuItem3
		// 
		_toolStripMenuItem3 = new ToolStripMenuItem ();
		_toolStripMenuItem3.Text = "Menu Item 3";
		_contextMenuStrip.Items.Add (_toolStripMenuItem3);
		// 
		// _toolStripMenuItem4
		// 
		_toolStripMenuItem4 = new ToolStripMenuItem ();
		_toolStripMenuItem4.Text = "Menu Item 4";
		_contextMenuStrip.Items.Add (_toolStripMenuItem4);
		// 
		// _notifyIcon
		// 
		_notifyIcon = new NotifyIcon ();
		_notifyIcon.ContextMenuStrip = _contextMenuStrip;
		_notifyIcon.Icon = Icon;
		_notifyIcon.Visible = true;
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Steps to execute:{0}{0}" +
			"1. Ensure the taskbar is positioned at the top of the screen.{0}{0}" +
			"2. Right-click the notify icon.{0}{0}" +
			"Expected result:{0}{0}" +
			"1. The context menu pops up below the cursor.",
				Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 170);
		StartPosition = FormStartPosition.CenterScreen;
		Text = "bug #82210";
	}
Example #24
0
    private void presentRightClickMenu(ContextMenuStrip menu)
    {
        //clear the menu
        menu.Items.Clear();

        /*Clipboard*/
        menu.Items.Add("Cut", Icons.GetBitmap("menu.cut", 16), menu_cut);
        menu.Items.Add("Copy", Icons.GetBitmap("menu.copy", 16), menu_copy);
        menu.Items.Add("Paste", Icons.GetBitmap("menu.paste", 16), menu_paste);
        menu.Items.Add(new ToolStripSeparator());

        /*Collapse menu*/
        menu.Items.Add(new ToolStripMenuItem("Outlining", null, new ToolStripItem[] {
            new ToolStripMenuItem("Toggle folding", null, menu_collapse_foldToggle),
            new ToolStripMenuItem("Collapse to definitions", null, menu_collapse_foldAll)
        }));
    }
Example #25
0
 /// <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.xmlTextBox = new System.Windows.Forms.RichTextBox();
         this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
         this.cmsCut = new System.Windows.Forms.ToolStripMenuItem();
         this.cmsCopy = new System.Windows.Forms.ToolStripMenuItem();
         this.cmsPaste = new System.Windows.Forms.ToolStripMenuItem();
         this.cmsDelete = new System.Windows.Forms.ToolStripMenuItem();
         this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
         this.cmsSelectAll = new System.Windows.Forms.ToolStripMenuItem();
         this.contextMenuStrip1.SuspendLayout();
         this.SuspendLayout();
         //
         // xmlTextBox
         //
         this.xmlTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
         this.xmlTextBox.Location = new System.Drawing.Point(0, 0);
         this.xmlTextBox.Name = "xmlTextBox";
         this.xmlTextBox.Size = new System.Drawing.Size(150, 150);
         this.xmlTextBox.TabIndex = 0;
         this.xmlTextBox.Text = "";
         this.xmlTextBox.TextChanged += new System.EventHandler(this.xmlTextBox_TextChanged);
         this.xmlTextBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.xmlTextBox_MouseDown);
         //
         // contextMenuStrip1
         //
         this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.cmsCut,
         this.cmsCopy,
         this.cmsPaste,
         this.cmsDelete,
         this.toolStripSeparator2,
         this.cmsSelectAll});
         this.contextMenuStrip1.Name = "contextMenuStrip1";
         this.contextMenuStrip1.Size = new System.Drawing.Size(153, 142);
         this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
         //
         // cmsCut
         //
         this.cmsCut.Name = "cmsCut";
         this.cmsCut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
         this.cmsCut.ShowShortcutKeys = false;
         this.cmsCut.Size = new System.Drawing.Size(152, 22);
         this.cmsCut.Text = "Cu&t";
         this.cmsCut.Click += new System.EventHandler(this.cmsCut_Click);
         //
         // cmsCopy
         //
         this.cmsCopy.Name = "cmsCopy";
         this.cmsCopy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
         this.cmsCopy.ShowShortcutKeys = false;
         this.cmsCopy.Size = new System.Drawing.Size(152, 22);
         this.cmsCopy.Text = "&Copy";
         this.cmsCopy.Click += new System.EventHandler(this.cmsCopy_Click);
         //
         // cmsPaste
         //
         this.cmsPaste.Name = "cmsPaste";
         this.cmsPaste.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
         this.cmsPaste.ShowShortcutKeys = false;
         this.cmsPaste.Size = new System.Drawing.Size(152, 22);
         this.cmsPaste.Text = "&Paste";
         this.cmsPaste.Click += new System.EventHandler(this.cmsPaste_Click);
         //
         // cmsDelete
         //
         this.cmsDelete.Name = "cmsDelete";
         this.cmsDelete.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D)));
         this.cmsDelete.ShowShortcutKeys = false;
         this.cmsDelete.Size = new System.Drawing.Size(152, 22);
         this.cmsDelete.Text = "&Delete";
         this.cmsDelete.Click += new System.EventHandler(this.cmsDelete_Click);
         //
         // toolStripSeparator2
         //
         this.toolStripSeparator2.Name = "toolStripSeparator2";
         this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6);
         //
         // cmsSelectAll
         //
         this.cmsSelectAll.Name = "cmsSelectAll";
         this.cmsSelectAll.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
         this.cmsSelectAll.ShowShortcutKeys = false;
         this.cmsSelectAll.Size = new System.Drawing.Size(152, 22);
         this.cmsSelectAll.Text = "Select &All";
         this.cmsSelectAll.Click += new System.EventHandler(this.cmsSelectAll_Click);
         //
         // XmlEditor
         //
         this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
         this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
         this.Controls.Add(this.xmlTextBox);
         this.Name = "XmlEditor";
         this.contextMenuStrip1.ResumeLayout(false);
         this.ResumeLayout(false);
 }
Example #26
0
    public SolutionBrowserControl()
    {
        #region Image list
        int iconSize = 16;
        ImageList imageList = new ImageList() {
            ColorDepth = ColorDepth.Depth32Bit,
            ImageSize = new Size(iconSize, iconSize)
        };

        imageList.Images.Add("folder", Icons.GetBitmap("solutionexplorer.folder", iconSize));
        imageList.Images.Add("folderOpen", Icons.GetBitmap("solutionexplorer.folderOpen", iconSize));
        imageList.Images.Add("asm", Icons.GetBitmap("filetype.asm", iconSize));
        imageList.Images.Add("c", Icons.GetBitmap("filetype.c", iconSize));
        imageList.Images.Add("cpp", Icons.GetBitmap("filetype.cpp", iconSize));
        imageList.Images.Add("h", Icons.GetBitmap("filetype.h", iconSize));
        imageList.Images.Add("vb", Icons.GetBitmap("filetype.vb", iconSize));
        imageList.Images.Add("cs", Icons.GetBitmap("filetype.cs", iconSize));
        imageList.Images.Add("unknown", Icons.GetBitmap("filetype.unknown", iconSize));

        imageList.Images.Add("solution", Icons.GetBitmap("solutionexplorer.solution", iconSize));
        imageList.Images.Add("proj", Icons.GetBitmap("solutionexplorer.project", iconSize));
        #endregion

        #region Tree view
        p_Tree = new TreeView() {
            Dock = DockStyle.Fill,
            ImageList = imageList,
            LabelEdit = true,

            AllowDrop = true
        };
        Controls.Add(p_Tree);

        /*Drag drop*/
        p_Tree.ItemDrag += tree_itemDrag;
        p_Tree.DragEnter += tree_dragEnter;
        p_Tree.DragOver += tree_dragOver;
        p_Tree.DragDrop += tree_dragDrop;

        /*When the user hit's enter, make whatever is selected in
          the tree list expand.*/
        p_Tree.KeyDown += delegate(object s, KeyEventArgs e) {
            if (e.KeyCode != Keys.Enter) { return; }
            TreeNode selected = p_Tree.SelectedNode;
            if (selected == null) { return; }
            selected.Expand();

            //open the file?
            if (selected.Tag is ProjectFile && FileOpened != null) {
                FileOpened(this, (ProjectFile)selected.Tag);
            }
        };

        /*When the user double clicks on a file, open it*/
        p_Tree.DoubleClick += delegate(object s, EventArgs e) {
            Point cursorPosition = Cursor.Position;
            cursorPosition = p_Tree.PointToClient(cursorPosition);
            TreeNode node = p_Tree.GetNodeAt(cursorPosition);
            if (node == null || !(node.Tag is ProjectFile)) { return; }
            if (FileOpened != null) {
                FileOpened(this, (ProjectFile)node.Tag);
            }
        };

        /*Make sure that left/right click causes the appropriate node
          to be selected*/
        p_Tree.MouseDown += delegate(object s, MouseEventArgs e) {
            TreeNode selected = p_Tree.GetNodeAt(e.X, e.Y);
            if (selected == null) { return; }
            p_Tree.SelectedNode = selected;
        };

        /*When a folder is expanded, change the icon to an expanded
         folde*/
        p_Tree.AfterCollapse += delegate(object sender, TreeViewEventArgs e) {
            if (!(e.Node.Tag is ProjectDirectory)) { return; }
            e.Node.ImageKey = e.Node.SelectedImageKey = "folder";
        };
        p_Tree.AfterExpand += delegate(object sender, TreeViewEventArgs e) {
            if (!(e.Node.Tag is ProjectDirectory)) { return; }
            e.Node.ImageKey = e.Node.SelectedImageKey = "folderOpen";
        };
        #endregion

        #region Tree right click
        ContextMenuStrip rightClick = new ContextMenuStrip();
        rightClick.Opening += delegate(object s, System.ComponentModel.CancelEventArgs e) {
            presentRightClickMenu(rightClick);
            e.Cancel = rightClick.Items.Count == 0;
        };
        p_Tree.ContextMenuStrip = rightClick;
        #endregion
    }
Example #27
0
            public static Form AddPanel(string title = "", bool noTabber = false)
            {
                try
                {
                    if (title == "")
                    {
                        title = Language.strNewPanel;
                    }

                    DockContent pnlcForm = new DockContent();
                    UI.Window.Connection cForm = new UI.Window.Connection(pnlcForm);
                    pnlcForm = cForm;

                    //create context menu
                    ContextMenuStrip cMen = new ContextMenuStrip();

                    //create rename item
                    ToolStripMenuItem cMenRen = new ToolStripMenuItem();
                    cMenRen.Text = Language.strRename;
                    cMenRen.Image = Resources.Rename;
                    cMenRen.Tag = pnlcForm;
                    cMenRen.Click += new EventHandler(cMenConnectionPanelRename_Click);

                    ToolStripMenuItem cMenScreens = new ToolStripMenuItem();
                    cMenScreens.Text = Language.strSendTo;
                    cMenScreens.Image = Resources.Monitor;
                    cMenScreens.Tag = pnlcForm;
                    cMenScreens.DropDownItems.Add("Dummy");
                    cMenScreens.DropDownOpening += new EventHandler(cMenConnectionPanelScreens_DropDownOpening);

                    cMen.Items.AddRange(new ToolStripMenuItem[] { cMenRen, cMenScreens });

                    pnlcForm.TabPageContextMenuStrip = cMen;

                    cForm.SetFormText(title.Replace("&", "&&"));

                    //ToDo: Fix this
                    try
                    {
                        frmMain.Default.pnlDock.DocumentStyle = frmMain.Default.pnlDock.DocumentsCount > 1 ? DocumentStyle.DockingMdi : DocumentStyle.DockingSdi;
                        pnlcForm.Show(frmMain.Default.pnlDock, DockState.Document);
                    }
                    catch (Exception)
                    {
                        frmMain.Default.pnlDock.DocumentStyle = DocumentStyle.DockingSdi;
                        pnlcForm.Show(frmMain.Default.pnlDock, DockState.Document);
                    }

                    if (noTabber)
                    {
                        cForm.TabController.Dispose();
                    }
                    else
                    {
                        WindowList.Add(cForm);
                    }

                    return cForm;
                }
                catch (Exception ex)
                {
                    MessageCollector.AddMessage(MessageClass.ErrorMsg,
                                                (string)
                                                ("Couldn\'t add panel" + Constants.vbNewLine + ex.Message));
                    return null;
                }
            }
Example #28
0
        /// Create a Weapon Accessory from an XmlNode and return the TreeNodes for it.
        /// <param name="objXmlAccessory">XmlNode to create the object from.</param>
        /// <param name="objNode">TreeNode to populate a TreeView.</param>
        /// <param name="strMount">Mount slot that the Weapon Accessory will consume.</param>
        /// <param name="intRating">Rating of the Weapon Accessory.</param>
        public void Create(XmlNode objXmlAccessory, TreeNode objNode, Tuple <string, string> strMount, int intRating, ContextMenuStrip cmsAccessoryGear, bool blnSkipCost = false, bool blnCreateChildren = true)
        {
            objXmlAccessory.TryGetStringFieldQuickly("name", ref _strName);
            _strMount      = strMount.Item1;
            _strExtraMount = strMount.Item2;
            _intRating     = intRating;
            objXmlAccessory.TryGetStringFieldQuickly("avail", ref _strAvail);
            // Check for a Variable Cost.
            if (blnSkipCost)
            {
                _strCost = "0";
            }
            else if (objXmlAccessory["cost"] != null)
            {
                if (objXmlAccessory["cost"].InnerText.StartsWith("Variable"))
                {
                    int    intMin  = 0;
                    int    intMax  = 0;
                    string strCost = objXmlAccessory["cost"].InnerText.Replace("Variable(", string.Empty).Replace(")", string.Empty);
                    if (strCost.Contains("-"))
                    {
                        string[] strValues = strCost.Split('-');
                        intMin = Convert.ToInt32(strValues[0]);
                        intMax = Convert.ToInt32(strValues[1]);
                    }
                    else
                    {
                        intMin = Convert.ToInt32(strCost.Replace("+", string.Empty));
                    }

                    if (intMin != 0 || intMax != 0)
                    {
                        frmSelectNumber frmPickNumber = new frmSelectNumber();
                        if (intMax == 0)
                        {
                            intMax = 1000000;
                        }
                        frmPickNumber.Minimum     = intMin;
                        frmPickNumber.Maximum     = intMax;
                        frmPickNumber.Description = LanguageManager.Instance.GetString("String_SelectVariableCost").Replace("{0}", DisplayNameShort);
                        frmPickNumber.AllowCancel = false;
                        frmPickNumber.ShowDialog();
                        _strCost = frmPickNumber.SelectedValue.ToString();
                    }
                }
                else
                {
                    _strCost = objXmlAccessory["cost"].InnerText;
                }
            }

            objXmlAccessory.TryGetStringFieldQuickly("source", ref _strSource);
            objXmlAccessory.TryGetStringFieldQuickly("page", ref _strPage);
            _nodAllowGear = objXmlAccessory["allowgear"];
            objXmlAccessory.TryGetStringFieldQuickly("rc", ref _strRC);
            objXmlAccessory.TryGetBoolFieldQuickly("rcdeployable", ref _blnDeployable);
            objXmlAccessory.TryGetInt32FieldQuickly("rcgroup", ref _intRCGroup);
            objXmlAccessory.TryGetStringFieldQuickly("conceal", ref _strConceal);
            objXmlAccessory.TryGetInt32FieldQuickly("ammoslots", ref _intAmmoSlots);
            objXmlAccessory.TryGetStringFieldQuickly("ammoreplace", ref _strAmmoReplace);
            objXmlAccessory.TryGetInt32FieldQuickly("accuracy", ref _intAccuracy);
            objXmlAccessory.TryGetStringFieldQuickly("dicepool", ref _strDicePool);
            objXmlAccessory.TryGetStringFieldQuickly("damagetype", ref _strDamageType);
            objXmlAccessory.TryGetStringFieldQuickly("damage", ref _strDamage);
            objXmlAccessory.TryGetStringFieldQuickly("damagereplace", ref _strDamageReplace);
            objXmlAccessory.TryGetStringFieldQuickly("firemode", ref _strFireMode);
            objXmlAccessory.TryGetStringFieldQuickly("firemodereplace", ref _strFireModeReplace);
            objXmlAccessory.TryGetStringFieldQuickly("ap", ref _strAP);
            objXmlAccessory.TryGetStringFieldQuickly("apreplace", ref _strAPReplace);
            objXmlAccessory.TryGetStringFieldQuickly("addmode", ref _strAddMode);
            objXmlAccessory.TryGetInt32FieldQuickly("fullburst", ref _intFullBurst);
            objXmlAccessory.TryGetInt32FieldQuickly("suppressive", ref _intSuppressive);
            objXmlAccessory.TryGetInt32FieldQuickly("rangebonus", ref _intRangeBonus);
            objXmlAccessory.TryGetStringFieldQuickly("extra", ref _strExtra);
            objXmlAccessory.TryGetInt32FieldQuickly("ammobonus", ref _intAmmoBonus);
            objXmlAccessory.TryGetInt32FieldQuickly("accessorycostmultiplier", ref _intAccessoryCostMultiplier);

            // Add any Gear that comes with the Weapon Accessory.
            if (objXmlAccessory["gears"] != null && blnCreateChildren)
            {
                XmlDocument objXmlGearDocument = XmlManager.Instance.Load("gear.xml");
                foreach (XmlNode objXmlAccessoryGear in objXmlAccessory.SelectNodes("gears/usegear"))
                {
                    intRating = 0;
                    string strForceValue = string.Empty;
                    if (objXmlAccessoryGear.Attributes["rating"] != null)
                    {
                        intRating = Convert.ToInt32(objXmlAccessoryGear.Attributes["rating"].InnerText);
                    }
                    if (objXmlAccessoryGear.Attributes["select"] != null)
                    {
                        strForceValue = objXmlAccessoryGear.Attributes["select"].InnerText;
                    }

                    XmlNode objXmlGear = objXmlGearDocument.SelectSingleNode("/chummer/gears/gear[name = \"" + objXmlAccessoryGear.InnerText + "\"]");
                    Gear    objGear    = new Gear(_objCharacter);

                    TreeNode        objGearNode    = new TreeNode();
                    List <Weapon>   lstWeapons     = new List <Weapon>();
                    List <TreeNode> lstWeaponNodes = new List <TreeNode>();

                    objGear.Create(objXmlGear, _objCharacter, objGearNode, intRating, lstWeapons, lstWeaponNodes, strForceValue, false, false, !blnSkipCost);
                    objGear.Cost             = "0";
                    objGear.MaxRating        = objGear.Rating;
                    objGear.MinRating        = objGear.Rating;
                    objGear.IncludedInParent = true;
                    _lstGear.Add(objGear);

                    objGearNode.ContextMenuStrip = cmsAccessoryGear;
                    objNode.Nodes.Add(objGearNode);
                    objNode.Expand();
                }
            }

            if (GlobalOptions.Instance.Language != "en-us")
            {
                XmlNode objAccessoryNode = MyXmlNode;
                if (objAccessoryNode != null)
                {
                    _strAltName = objAccessoryNode["translate"]?.InnerText ?? string.Empty;
                    _strAltPage = objAccessoryNode["altpage"]?.InnerText ?? string.Empty;
                }
            }

            objNode.Text = DisplayName;
            objNode.Tag  = _guiID.ToString();
        }
Example #29
0
 /// <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(main));
     this.tabControl1 = new System.Windows.Forms.TabControl();
     this.tabPage1 = new System.Windows.Forms.TabPage();
     this.exitButton = new System.Windows.Forms.Button();
     this.cameraButton = new SkimptControls.GlassButton();
     this.hightlightButton = new SkimptControls.GlassButton();
     this.updateMessageLink = new System.Windows.Forms.LinkLabel();
     this.updateMessageLabel = new System.Windows.Forms.Label();
     this.unhookButton = new System.Windows.Forms.Button();
     this.mainProgramMessage = new System.Windows.Forms.TextBox();
     this.tabPage2 = new System.Windows.Forms.TabPage();
     this.groupBox1 = new System.Windows.Forms.GroupBox();
     this.browseButton = new System.Windows.Forms.Button();
     this.fileLocationTextBox = new System.Windows.Forms.TextBox();
     this.label1 = new System.Windows.Forms.Label();
     this.radioButton2 = new System.Windows.Forms.RadioButton();
     this.radioButton1 = new System.Windows.Forms.RadioButton();
     this.saveFileSettingButton = new SkimptControls.GlassButton();
     this.tabPage3 = new System.Windows.Forms.TabPage();
     this.saveFtpSettingButton = new SkimptControls.GlassButton();
     this.ftpTestConnButton = new SkimptControls.GlassButton();
     this.ftpDirTxtBox = new System.Windows.Forms.TextBox();
     this.ftpPortTxtBox = new System.Windows.Forms.TextBox();
     this.ftpPassTxtBox = new System.Windows.Forms.TextBox();
     this.ftpUserTxtBox = new System.Windows.Forms.TextBox();
     this.ftpHostTxtBox = new System.Windows.Forms.TextBox();
     this.label6 = new System.Windows.Forms.Label();
     this.label5 = new System.Windows.Forms.Label();
     this.label4 = new System.Windows.Forms.Label();
     this.label3 = new System.Windows.Forms.Label();
     this.label2 = new System.Windows.Forms.Label();
     this.tabPage4 = new System.Windows.Forms.TabPage();
     this.savePSDasFileCheckbox = new System.Windows.Forms.CheckBox();
     this.groupBox2 = new System.Windows.Forms.GroupBox();
     this.removeContextMenuButton = new SkimptControls.GlassButton();
     this.attachContextMenuButton = new SkimptControls.GlassButton();
     this.ShowMessagesCheckbox = new System.Windows.Forms.CheckBox();
     this.HideUponLaunchCheckbox = new System.Windows.Forms.CheckBox();
     this.startOnWindowsLoadCheckBox = new System.Windows.Forms.CheckBox();
     this.saveGlobalSettingButton = new SkimptControls.GlassButton();
     this.tabPage5 = new System.Windows.Forms.TabPage();
     this.fontDialog1 = new System.Windows.Forms.FontDialog();
     this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
     this.notificationIconContext = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.contextStartCamera = new System.Windows.Forms.ToolStripMenuItem();
     this.contextHighlightMode = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
     this.contextShowMenu = new System.Windows.Forms.ToolStripMenuItem();
     this.contextExitMenu = new System.Windows.Forms.ToolStripMenuItem();
     this.tabControl1.SuspendLayout();
     this.tabPage1.SuspendLayout();
     this.tabPage2.SuspendLayout();
     this.groupBox1.SuspendLayout();
     this.tabPage3.SuspendLayout();
     this.tabPage4.SuspendLayout();
     this.groupBox2.SuspendLayout();
     this.notificationIconContext.SuspendLayout();
     this.SuspendLayout();
     //
     // tabControl1
     //
     this.tabControl1.Controls.Add(this.tabPage1);
     this.tabControl1.Controls.Add(this.tabPage2);
     this.tabControl1.Controls.Add(this.tabPage3);
     this.tabControl1.Controls.Add(this.tabPage4);
     this.tabControl1.Controls.Add(this.tabPage5);
     this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.tabControl1.Font = new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.tabControl1.HotTrack = true;
     this.tabControl1.ItemSize = new System.Drawing.Size(96, 26);
     this.tabControl1.Location = new System.Drawing.Point(0, 0);
     this.tabControl1.Name = "tabControl1";
     this.tabControl1.SelectedIndex = 0;
     this.tabControl1.ShowToolTips = true;
     this.tabControl1.Size = new System.Drawing.Size(483, 250);
     this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
     this.tabControl1.TabIndex = 0;
     //
     // tabPage1
     //
     this.tabPage1.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
     this.tabPage1.Controls.Add(this.exitButton);
     this.tabPage1.Controls.Add(this.cameraButton);
     this.tabPage1.Controls.Add(this.hightlightButton);
     this.tabPage1.Controls.Add(this.updateMessageLink);
     this.tabPage1.Controls.Add(this.updateMessageLabel);
     this.tabPage1.Controls.Add(this.unhookButton);
     this.tabPage1.Controls.Add(this.mainProgramMessage);
     this.tabPage1.Location = new System.Drawing.Point(4, 30);
     this.tabPage1.Name = "tabPage1";
     this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
     this.tabPage1.Size = new System.Drawing.Size(475, 216);
     this.tabPage1.TabIndex = 0;
     this.tabPage1.Text = "Main";
     this.tabPage1.ToolTipText = "Main screen";
     //
     // exitButton
     //
     this.exitButton.Location = new System.Drawing.Point(13, 178);
     this.exitButton.Name = "exitButton";
     this.exitButton.Size = new System.Drawing.Size(88, 31);
     this.exitButton.TabIndex = 5;
     this.exitButton.Text = "Exit Skimpt";
     this.exitButton.UseVisualStyleBackColor = true;
     this.exitButton.Click += new System.EventHandler(this.exitButton_Click);
     //
     // cameraButton
     //
     this.cameraButton.BackColor = System.Drawing.Color.DarkViolet;
     this.cameraButton.ForeColor = System.Drawing.Color.Black;
     this.cameraButton.Location = new System.Drawing.Point(12, 73);
     this.cameraButton.Name = "cameraButton";
     this.cameraButton.ShineColor = System.Drawing.Color.Thistle;
     this.cameraButton.Size = new System.Drawing.Size(214, 36);
     this.cameraButton.TabIndex = 6;
     this.cameraButton.Text = "Start Camera Mode";
     this.cameraButton.Click += new System.EventHandler(this.cameraButton_Click);
     //
     // hightlightButton
     //
     this.hightlightButton.BackColor = System.Drawing.Color.SteelBlue;
     this.hightlightButton.Location = new System.Drawing.Point(244, 73);
     this.hightlightButton.Name = "hightlightButton";
     this.hightlightButton.ShineColor = System.Drawing.Color.SkyBlue;
     this.hightlightButton.Size = new System.Drawing.Size(214, 36);
     this.hightlightButton.TabIndex = 5;
     this.hightlightButton.Text = "Start Highlight mode";
     this.hightlightButton.Click += new System.EventHandler(this.hightlightButton_Click);
     //
     // updateMessageLink
     //
     this.updateMessageLink.AutoSize = true;
     this.updateMessageLink.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
     this.updateMessageLink.Location = new System.Drawing.Point(184, 151);
     this.updateMessageLink.Name = "updateMessageLink";
     this.updateMessageLink.Size = new System.Drawing.Size(126, 19);
     this.updateMessageLink.TabIndex = 4;
     this.updateMessageLink.TabStop = true;
     this.updateMessageLink.Text = "Skimpt Homepage";
     this.updateMessageLink.Visible = false;
     this.updateMessageLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.updateMessageLink_LinkClicked);
     //
     // updateMessageLabel
     //
     this.updateMessageLabel.AutoSize = true;
     this.updateMessageLabel.ForeColor = System.Drawing.Color.Red;
     this.updateMessageLabel.Location = new System.Drawing.Point(15, 151);
     this.updateMessageLabel.Name = "updateMessageLabel";
     this.updateMessageLabel.Size = new System.Drawing.Size(173, 19);
     this.updateMessageLabel.TabIndex = 3;
     this.updateMessageLabel.Text = "New Update Available on";
     this.updateMessageLabel.Visible = false;
     //
     // unhookButton
     //
     this.unhookButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
     this.unhookButton.Location = new System.Drawing.Point(320, 177);
     this.unhookButton.Name = "unhookButton";
     this.unhookButton.Size = new System.Drawing.Size(149, 33);
     this.unhookButton.TabIndex = 1;
     this.unhookButton.Text = "Unhook Print Screen";
     this.unhookButton.UseVisualStyleBackColor = true;
     this.unhookButton.Click += new System.EventHandler(this.unhookButton_Click);
     //
     // mainProgramMessage
     //
     this.mainProgramMessage.Font = new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.mainProgramMessage.ForeColor = System.Drawing.Color.Green;
     this.mainProgramMessage.Location = new System.Drawing.Point(8, 19);
     this.mainProgramMessage.Multiline = true;
     this.mainProgramMessage.Name = "mainProgramMessage";
     this.mainProgramMessage.Size = new System.Drawing.Size(463, 48);
     this.mainProgramMessage.TabIndex = 0;
     this.mainProgramMessage.Text = "Program messages will be displayed here";
     //
     // tabPage2
     //
     this.tabPage2.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
     this.tabPage2.Controls.Add(this.groupBox1);
     this.tabPage2.Controls.Add(this.radioButton2);
     this.tabPage2.Controls.Add(this.radioButton1);
     this.tabPage2.Controls.Add(this.saveFileSettingButton);
     this.tabPage2.Location = new System.Drawing.Point(4, 30);
     this.tabPage2.Name = "tabPage2";
     this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
     this.tabPage2.Size = new System.Drawing.Size(475, 216);
     this.tabPage2.TabIndex = 1;
     this.tabPage2.Text = "File";
     this.tabPage2.ToolTipText = "change file settings including save path";
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.browseButton);
     this.groupBox1.Controls.Add(this.fileLocationTextBox);
     this.groupBox1.Controls.Add(this.label1);
     this.groupBox1.Location = new System.Drawing.Point(6, 74);
     this.groupBox1.Name = "groupBox1";
     this.groupBox1.Size = new System.Drawing.Size(463, 92);
     this.groupBox1.TabIndex = 3;
     this.groupBox1.TabStop = false;
     this.groupBox1.Text = "File Location";
     //
     // browseButton
     //
     this.browseButton.Location = new System.Drawing.Point(416, 49);
     this.browseButton.Name = "browseButton";
     this.browseButton.Size = new System.Drawing.Size(32, 27);
     this.browseButton.TabIndex = 2;
     this.browseButton.Text = "...";
     this.browseButton.UseVisualStyleBackColor = true;
     this.browseButton.Click += new System.EventHandler(this.browseButton_Click);
     //
     // fileLocationTextBox
     //
     this.fileLocationTextBox.Font = new System.Drawing.Font("Calibri", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.fileLocationTextBox.Location = new System.Drawing.Point(17, 50);
     this.fileLocationTextBox.Name = "fileLocationTextBox";
     this.fileLocationTextBox.ReadOnly = true;
     this.fileLocationTextBox.Size = new System.Drawing.Size(393, 27);
     this.fileLocationTextBox.TabIndex = 1;
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(13, 27);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(191, 19);
     this.label1.TabIndex = 0;
     this.label1.Text = "Save my file to this location:";
     //
     // radioButton2
     //
     this.radioButton2.AutoSize = true;
     this.radioButton2.Location = new System.Drawing.Point(26, 45);
     this.radioButton2.Name = "radioButton2";
     this.radioButton2.Size = new System.Drawing.Size(213, 23);
     this.radioButton2.TabIndex = 1;
     this.radioButton2.Text = "Allow me to specify each file";
     this.radioButton2.UseVisualStyleBackColor = true;
     //
     // radioButton1
     //
     this.radioButton1.AutoSize = true;
     this.radioButton1.Checked = true;
     this.radioButton1.Location = new System.Drawing.Point(26, 16);
     this.radioButton1.Name = "radioButton1";
     this.radioButton1.Size = new System.Drawing.Size(185, 23);
     this.radioButton1.TabIndex = 0;
     this.radioButton1.TabStop = true;
     this.radioButton1.Text = "Randomly name my files";
     this.radioButton1.UseVisualStyleBackColor = true;
     //
     // saveFileSettingButton
     //
     this.saveFileSettingButton.Location = new System.Drawing.Point(155, 172);
     this.saveFileSettingButton.Name = "saveFileSettingButton";
     this.saveFileSettingButton.Size = new System.Drawing.Size(141, 36);
     this.saveFileSettingButton.TabIndex = 5;
     this.saveFileSettingButton.Text = "Save File Settings";
     this.saveFileSettingButton.Click += new System.EventHandler(this.saveFileSettingButton_Click);
     //
     // tabPage3
     //
     this.tabPage3.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
     this.tabPage3.Controls.Add(this.saveFtpSettingButton);
     this.tabPage3.Controls.Add(this.ftpTestConnButton);
     this.tabPage3.Controls.Add(this.ftpDirTxtBox);
     this.tabPage3.Controls.Add(this.ftpPortTxtBox);
     this.tabPage3.Controls.Add(this.ftpPassTxtBox);
     this.tabPage3.Controls.Add(this.ftpUserTxtBox);
     this.tabPage3.Controls.Add(this.ftpHostTxtBox);
     this.tabPage3.Controls.Add(this.label6);
     this.tabPage3.Controls.Add(this.label5);
     this.tabPage3.Controls.Add(this.label4);
     this.tabPage3.Controls.Add(this.label3);
     this.tabPage3.Controls.Add(this.label2);
     this.tabPage3.Location = new System.Drawing.Point(4, 30);
     this.tabPage3.Name = "tabPage3";
     this.tabPage3.Size = new System.Drawing.Size(475, 216);
     this.tabPage3.TabIndex = 2;
     this.tabPage3.Text = "Upload";
     this.tabPage3.ToolTipText = "Set upload settings to remote server";
     //
     // saveFtpSettingButton
     //
     this.saveFtpSettingButton.BackColor = System.Drawing.Color.DarkSlateBlue;
     this.saveFtpSettingButton.Location = new System.Drawing.Point(332, 173);
     this.saveFtpSettingButton.Name = "saveFtpSettingButton";
     this.saveFtpSettingButton.ShineColor = System.Drawing.Color.SlateBlue;
     this.saveFtpSettingButton.Size = new System.Drawing.Size(135, 35);
     this.saveFtpSettingButton.TabIndex = 13;
     this.saveFtpSettingButton.Text = "Save FTP Settings";
     this.saveFtpSettingButton.Click += new System.EventHandler(this.saveFtpSettingButton_Click);
     //
     // ftpTestConnButton
     //
     this.ftpTestConnButton.BackColor = System.Drawing.Color.Crimson;
     this.ftpTestConnButton.Location = new System.Drawing.Point(191, 173);
     this.ftpTestConnButton.Name = "ftpTestConnButton";
     this.ftpTestConnButton.ShineColor = System.Drawing.Color.Pink;
     this.ftpTestConnButton.Size = new System.Drawing.Size(135, 35);
     this.ftpTestConnButton.TabIndex = 12;
     this.ftpTestConnButton.Text = "Test Connection";
     this.ftpTestConnButton.Click += new System.EventHandler(this.ftpTestConnButton_Click);
     //
     // ftpDirTxtBox
     //
     this.ftpDirTxtBox.Location = new System.Drawing.Point(163, 140);
     this.ftpDirTxtBox.Name = "ftpDirTxtBox";
     this.ftpDirTxtBox.Size = new System.Drawing.Size(307, 27);
     this.ftpDirTxtBox.TabIndex = 11;
     //
     // ftpPortTxtBox
     //
     this.ftpPortTxtBox.Location = new System.Drawing.Point(163, 107);
     this.ftpPortTxtBox.Name = "ftpPortTxtBox";
     this.ftpPortTxtBox.Size = new System.Drawing.Size(307, 27);
     this.ftpPortTxtBox.TabIndex = 10;
     this.ftpPortTxtBox.Text = "21";
     //
     // ftpPassTxtBox
     //
     this.ftpPassTxtBox.Location = new System.Drawing.Point(163, 74);
     this.ftpPassTxtBox.Name = "ftpPassTxtBox";
     this.ftpPassTxtBox.Size = new System.Drawing.Size(307, 27);
     this.ftpPassTxtBox.TabIndex = 9;
     this.ftpPassTxtBox.UseSystemPasswordChar = true;
     //
     // ftpUserTxtBox
     //
     this.ftpUserTxtBox.Location = new System.Drawing.Point(163, 41);
     this.ftpUserTxtBox.Name = "ftpUserTxtBox";
     this.ftpUserTxtBox.Size = new System.Drawing.Size(307, 27);
     this.ftpUserTxtBox.TabIndex = 8;
     //
     // ftpHostTxtBox
     //
     this.ftpHostTxtBox.Location = new System.Drawing.Point(163, 11);
     this.ftpHostTxtBox.Name = "ftpHostTxtBox";
     this.ftpHostTxtBox.Size = new System.Drawing.Size(307, 27);
     this.ftpHostTxtBox.TabIndex = 5;
     //
     // label6
     //
     this.label6.AutoSize = true;
     this.label6.Location = new System.Drawing.Point(24, 143);
     this.label6.Name = "label6";
     this.label6.Size = new System.Drawing.Size(133, 19);
     this.label6.TabIndex = 4;
     this.label6.Text = "Initial Directory (./)";
     //
     // label5
     //
     this.label5.AutoSize = true;
     this.label5.Location = new System.Drawing.Point(64, 110);
     this.label5.Name = "label5";
     this.label5.Size = new System.Drawing.Size(93, 19);
     this.label5.TabIndex = 3;
     this.label5.Text = "Remote Port:";
     //
     // label4
     //
     this.label4.AutoSize = true;
     this.label4.Location = new System.Drawing.Point(28, 77);
     this.label4.Name = "label4";
     this.label4.Size = new System.Drawing.Size(129, 19);
     this.label4.TabIndex = 2;
     this.label4.Text = "Remote Password:"******"label3";
     this.label3.Size = new System.Drawing.Size(133, 19);
     this.label3.TabIndex = 1;
     this.label3.Text = "Remote Username:"******"label2";
     this.label2.Size = new System.Drawing.Size(139, 19);
     this.label2.TabIndex = 0;
     this.label2.Text = "Remote Host Name:";
     //
     // tabPage4
     //
     this.tabPage4.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
     this.tabPage4.Controls.Add(this.savePSDasFileCheckbox);
     this.tabPage4.Controls.Add(this.groupBox2);
     this.tabPage4.Controls.Add(this.ShowMessagesCheckbox);
     this.tabPage4.Controls.Add(this.HideUponLaunchCheckbox);
     this.tabPage4.Controls.Add(this.startOnWindowsLoadCheckBox);
     this.tabPage4.Controls.Add(this.saveGlobalSettingButton);
     this.tabPage4.Location = new System.Drawing.Point(4, 30);
     this.tabPage4.Name = "tabPage4";
     this.tabPage4.Size = new System.Drawing.Size(475, 216);
     this.tabPage4.TabIndex = 3;
     this.tabPage4.Text = "Settings";
     this.tabPage4.ToolTipText = "Set global application settings";
     //
     // savePSDasFileCheckbox
     //
     this.savePSDasFileCheckbox.AutoSize = true;
     this.savePSDasFileCheckbox.Location = new System.Drawing.Point(25, 90);
     this.savePSDasFileCheckbox.Name = "savePSDasFileCheckbox";
     this.savePSDasFileCheckbox.Size = new System.Drawing.Size(191, 23);
     this.savePSDasFileCheckbox.TabIndex = 15;
     this.savePSDasFileCheckbox.Text = "Save a JPEG of a PSD file.";
     this.savePSDasFileCheckbox.UseVisualStyleBackColor = true;
     //
     // groupBox2
     //
     this.groupBox2.Controls.Add(this.removeContextMenuButton);
     this.groupBox2.Controls.Add(this.attachContextMenuButton);
     this.groupBox2.Location = new System.Drawing.Point(25, 119);
     this.groupBox2.Name = "groupBox2";
     this.groupBox2.Size = new System.Drawing.Size(428, 62);
     this.groupBox2.TabIndex = 14;
     this.groupBox2.TabStop = false;
     this.groupBox2.Text = "Windows Context Menu";
     //
     // removeContextMenuButton
     //
     this.removeContextMenuButton.BackColor = System.Drawing.Color.Crimson;
     this.removeContextMenuButton.Location = new System.Drawing.Point(220, 21);
     this.removeContextMenuButton.Name = "removeContextMenuButton";
     this.removeContextMenuButton.ShineColor = System.Drawing.Color.Pink;
     this.removeContextMenuButton.Size = new System.Drawing.Size(198, 35);
     this.removeContextMenuButton.TabIndex = 14;
     this.removeContextMenuButton.Text = " Remove";
     this.removeContextMenuButton.Click += new System.EventHandler(this.removeContextMenuButton_Click);
     //
     // attachContextMenuButton
     //
     this.attachContextMenuButton.BackColor = System.Drawing.Color.Crimson;
     this.attachContextMenuButton.Location = new System.Drawing.Point(16, 21);
     this.attachContextMenuButton.Name = "attachContextMenuButton";
     this.attachContextMenuButton.ShineColor = System.Drawing.Color.Pink;
     this.attachContextMenuButton.Size = new System.Drawing.Size(198, 35);
     this.attachContextMenuButton.TabIndex = 13;
     this.attachContextMenuButton.Text = "Attach ";
     this.attachContextMenuButton.Click += new System.EventHandler(this.attachToWindowsButton_Click);
     //
     // ShowMessagesCheckbox
     //
     this.ShowMessagesCheckbox.AutoSize = true;
     this.ShowMessagesCheckbox.Location = new System.Drawing.Point(25, 61);
     this.ShowMessagesCheckbox.Name = "ShowMessagesCheckbox";
     this.ShowMessagesCheckbox.Size = new System.Drawing.Size(306, 23);
     this.ShowMessagesCheckbox.TabIndex = 3;
     this.ShowMessagesCheckbox.Text = "Show program messages in a message box";
     this.ShowMessagesCheckbox.UseVisualStyleBackColor = true;
     //
     // HideUponLaunchCheckbox
     //
     this.HideUponLaunchCheckbox.AutoSize = true;
     this.HideUponLaunchCheckbox.Location = new System.Drawing.Point(25, 32);
     this.HideUponLaunchCheckbox.Name = "HideUponLaunchCheckbox";
     this.HideUponLaunchCheckbox.Size = new System.Drawing.Size(284, 23);
     this.HideUponLaunchCheckbox.TabIndex = 1;
     this.HideUponLaunchCheckbox.Text = "Hide instantly upon launch of program. ";
     this.HideUponLaunchCheckbox.UseVisualStyleBackColor = true;
     //
     // startOnWindowsLoadCheckBox
     //
     this.startOnWindowsLoadCheckBox.AutoSize = true;
     this.startOnWindowsLoadCheckBox.Location = new System.Drawing.Point(25, 3);
     this.startOnWindowsLoadCheckBox.Name = "startOnWindowsLoadCheckBox";
     this.startOnWindowsLoadCheckBox.Size = new System.Drawing.Size(307, 23);
     this.startOnWindowsLoadCheckBox.TabIndex = 0;
     this.startOnWindowsLoadCheckBox.Text = "Start this program when Windows boots up";
     this.startOnWindowsLoadCheckBox.UseVisualStyleBackColor = true;
     //
     // saveGlobalSettingButton
     //
     this.saveGlobalSettingButton.BackColor = System.Drawing.Color.Chocolate;
     this.saveGlobalSettingButton.Location = new System.Drawing.Point(158, 186);
     this.saveGlobalSettingButton.Name = "saveGlobalSettingButton";
     this.saveGlobalSettingButton.OuterBorderColor = System.Drawing.Color.LightSalmon;
     this.saveGlobalSettingButton.Size = new System.Drawing.Size(161, 27);
     this.saveGlobalSettingButton.TabIndex = 6;
     this.saveGlobalSettingButton.Text = "Save Program Settings";
     this.saveGlobalSettingButton.Click += new System.EventHandler(this.saveGlobalSettingButton_Click);
     //
     // tabPage5
     //
     this.tabPage5.Location = new System.Drawing.Point(4, 30);
     this.tabPage5.Name = "tabPage5";
     this.tabPage5.Size = new System.Drawing.Size(475, 216);
     this.tabPage5.TabIndex = 4;
     this.tabPage5.Text = "Log";
     this.tabPage5.ToolTipText = "Check log files";
     this.tabPage5.UseVisualStyleBackColor = true;
     //
     // notifyIcon
     //
     this.notifyIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
     this.notifyIcon.BalloonTipText = "Program Status: Running";
     this.notifyIcon.BalloonTipTitle = "Skimpt v1.01";
     this.notifyIcon.ContextMenuStrip = this.notificationIconContext;
     this.notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon.Icon")));
     this.notifyIcon.Text = "Skimpt v1.01\r\nProgram Status: Running";
     this.notifyIcon.Visible = true;
     this.notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon_MouseDoubleClick);
     //
     // notificationIconContext
     //
     this.notificationIconContext.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.contextStartCamera,
         this.contextHighlightMode,
         this.toolStripSeparator1,
         this.contextShowMenu,
         this.contextExitMenu});
     this.notificationIconContext.Name = "notificationIconContext";
     this.notificationIconContext.Size = new System.Drawing.Size(172, 98);
     //
     // contextStartCamera
     //
     this.contextStartCamera.Name = "contextStartCamera";
     this.contextStartCamera.Size = new System.Drawing.Size(171, 22);
     this.contextStartCamera.Text = "Start Camera Mode";
     this.contextStartCamera.Click += new System.EventHandler(this.contextStartCamera_Click);
     //
     // contextHighlightMode
     //
     this.contextHighlightMode.Name = "contextHighlightMode";
     this.contextHighlightMode.Size = new System.Drawing.Size(171, 22);
     this.contextHighlightMode.Text = "Start Highlight Mode";
     this.contextHighlightMode.Click += new System.EventHandler(this.contextHighlightMode_Click);
     //
     // toolStripSeparator1
     //
     this.toolStripSeparator1.Name = "toolStripSeparator1";
     this.toolStripSeparator1.Size = new System.Drawing.Size(168, 6);
     //
     // contextShowMenu
     //
     this.contextShowMenu.Name = "contextShowMenu";
     this.contextShowMenu.Size = new System.Drawing.Size(171, 22);
     this.contextShowMenu.Text = "Show Main Window";
     this.contextShowMenu.Click += new System.EventHandler(this.contextShowMenu_Click);
     //
     // contextExitMenu
     //
     this.contextExitMenu.Name = "contextExitMenu";
     this.contextExitMenu.Size = new System.Drawing.Size(171, 22);
     this.contextExitMenu.Text = "Exit Skimpt";
     this.contextExitMenu.Click += new System.EventHandler(this.contextExitMenu_Click);
     //
     // main
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.AutoSize = true;
     this.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
     this.ClientSize = new System.Drawing.Size(483, 250);
     this.Controls.Add(this.tabControl1);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox = false;
     this.MinimizeBox = false;
     this.Name = "main";
     this.Opacity = 0.9;
     this.ShowIcon = false;
     this.ShowInTaskbar = false;
     this.Text = "Skimpt v 1.01";
     this.TopMost = true;
     this.Load += new System.EventHandler(this.main_Load);
     this.Shown += new System.EventHandler(this.main_Shown);
     this.Closing += new System.ComponentModel.CancelEventHandler(this.main_Closing);
     this.tabControl1.ResumeLayout(false);
     this.tabPage1.ResumeLayout(false);
     this.tabPage1.PerformLayout();
     this.tabPage2.ResumeLayout(false);
     this.tabPage2.PerformLayout();
     this.groupBox1.ResumeLayout(false);
     this.groupBox1.PerformLayout();
     this.tabPage3.ResumeLayout(false);
     this.tabPage3.PerformLayout();
     this.tabPage4.ResumeLayout(false);
     this.tabPage4.PerformLayout();
     this.groupBox2.ResumeLayout(false);
     this.notificationIconContext.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Example #30
0
        void OnShowElementMenu(object sender, AcceptElementLocationEventArgs e)
        {
            if (e.Element == null)
            {
                _emptySpaceMenu.Tag = ClientToModel(new System.Drawing.PointF(e.Position.X, e.Position.Y));
                _emptySpaceMenu.Show(e.Position);
                e.Cancel = false;
            }
            else
            if (e.Element is Node && ((Node)e.Element).Tag is ShaderProcedureNodeTag)
            {
                var tag = (ShaderProcedureNodeTag)((Node)e.Element).Tag;
                _nodeMenu.Tag = tag.Id;
                _nodeMenu.Show(e.Position);
                e.Cancel = false;
            }
            // if (e.Element is Node && ((Node)e.Element).Tag is ShaderParameterNodeTag)
            // {
            //     var tag = (ShaderParameterNodeTag)((Node)e.Element).Tag;
            //     parameterBoxMenu.Tag = tag.Id;
            //     parameterBoxMenu.Show(e.Position);
            //     e.Cancel = false;
            // }
            // else
            // if (e.Element is ShaderFragmentNodeItem)
            // {
            //     var tag = (ShaderFragmentNodeItem)e.Element;
            //     if (tag.ArchiveName != null)
            //     {
            //         ShaderParameterUtil.EditParameter(GetGraphModel(), tag.ArchiveName);
            //         e.Cancel = false;
            //     }
            // }
            else if (e.Element is NodeConnector && ((NodeConnector)e.Element).Item is ShaderFragmentNodeItem)
            {
                NodeConnector conn = (NodeConnector)e.Element;
                var           tag  = (ShaderFragmentNodeItem)conn.Item;
                if (tag.ArchiveName != null)
                {
                    // pop up a context menu for this connector
                    var menu = new ContextMenuStrip();

                    var param = conn.Item as ShaderFragmentInterfaceParameterItem;
                    if (param != null)
                    {
                        var editItem = new ToolStripMenuItem()
                        {
                            Text = "Edit parameter"
                        };
                        editItem.Click += (object o, EventArgs a) => { EditInterfaceParameter(param); };
                        menu.Items.Add(editItem);
                    }

                    if (conn == conn.Item.Input)
                    {
                        var existing = GetSimpleConnection(conn);
                        if (!string.IsNullOrEmpty(existing))
                        {
                            var editItem = new ToolStripMenuItem()
                            {
                                Text = "Edit simple connection"
                            };
                            editItem.Click += (object o, EventArgs a) => { EditSimpleConnection(conn); };
                            menu.Items.Add(editItem);
                        }
                        else
                        {
                            var addItem = new ToolStripMenuItem()
                            {
                                Text = "Add simple connection"
                            };
                            addItem.Click += (object o, EventArgs a) => { EditSimpleConnection(conn); };
                            menu.Items.Add(addItem);
                        }
                    }

                    if (conn.Node.Connections.Where(x => x.To == conn || x.From == conn).Any())
                    {
                        var removeItem = new ToolStripMenuItem()
                        {
                            Text = "Disconnect"
                        };
                        removeItem.Click += (object o, EventArgs a) => { DisconnectAll(conn); };
                        menu.Items.Add(removeItem);
                    }

                    if (menu.Items.Count > 0)
                    {
                        menu.Show(e.Position);
                        e.Cancel = false;
                    }
                }
            }
            else
            {
                // if you don't want to show a menu for this item (but perhaps show a menu for something more higher up)
                // then you can cancel the event
                e.Cancel = true;
            }
        }
Example #31
0
        public static void InitializeThreeDimensionController(
            CoordinateSystem coordinateSystem,
            bool allowRelativeOptions,
            GroupBox groupbox,
            Button buttonSquareLeft,
            Button buttonSquareRight,
            Button buttonSquareUp,
            Button buttonSquareDown,
            Button buttonSquareUpLeft,
            Button buttonSquareDownLeft,
            Button buttonSquareUpRight,
            Button buttonSquareDownRight,
            Button buttonLineUp,
            Button buttonLineDown,
            TextBox textboxSquare,
            TextBox textboxLine,
            CheckBox checkbox,
            Action <float, float, float, bool> actionMove)
        {
            Action <int, int> actionSquare = (int hSign, int vSign) =>
            {
                float value;
                if (!float.TryParse(textboxSquare.Text, out value))
                {
                    return;
                }
                actionMove(hSign * value, vSign * value, 0, checkbox?.Checked ?? false);
            };

            Action <int> actionLine = (int nSign) =>
            {
                float value;
                if (!float.TryParse(textboxLine.Text, out value))
                {
                    return;
                }
                actionMove(0, 0, nSign * value, checkbox?.Checked ?? false);
            };

            Action setEulerNames = () =>
            {
                buttonSquareLeft.Text      = "X-";
                buttonSquareRight.Text     = "X+";
                buttonSquareUp.Text        = "Z-";
                buttonSquareDown.Text      = "Z+";
                buttonSquareUpLeft.Text    = "X-Z-";
                buttonSquareDownLeft.Text  = "X-Z+";
                buttonSquareUpRight.Text   = "X+Z-";
                buttonSquareDownRight.Text = "X+Z+";
                buttonLineUp.Text          = "Y+";
                buttonLineDown.Text        = "Y-";
            };

            Action setRelativeNames = () =>
            {
                buttonSquareLeft.Text      = "L";
                buttonSquareRight.Text     = "R";
                buttonSquareUp.Text        = "F";
                buttonSquareDown.Text      = "B";
                buttonSquareUpLeft.Text    = "FL";
                buttonSquareDownLeft.Text  = "BL";
                buttonSquareUpRight.Text   = "FR";
                buttonSquareDownRight.Text = "BR";
                buttonLineUp.Text          = "U";
                buttonLineDown.Text        = "D";
            };

            Action actionCheckedChanged = () =>
            {
                if (checkbox.Checked)
                {
                    setRelativeNames();
                }
                else
                {
                    setEulerNames();
                }
            };

            buttonSquareLeft.Click      += (sender, e) => actionSquare(-1, 0);
            buttonSquareRight.Click     += (sender, e) => actionSquare(1, 0);
            buttonSquareUp.Click        += (sender, e) => actionSquare(0, 1);
            buttonSquareDown.Click      += (sender, e) => actionSquare(0, -1);
            buttonSquareUpLeft.Click    += (sender, e) => actionSquare(-1, 1);
            buttonSquareDownLeft.Click  += (sender, e) => actionSquare(-1, -1);
            buttonSquareUpRight.Click   += (sender, e) => actionSquare(1, 1);
            buttonSquareDownRight.Click += (sender, e) => actionSquare(1, -1);
            buttonLineUp.Click          += (sender, e) => actionLine(1);
            buttonLineDown.Click        += (sender, e) => actionLine(-1);
            if (coordinateSystem == CoordinateSystem.Euler && allowRelativeOptions)
            {
                checkbox.CheckedChanged += (sender, e) => actionCheckedChanged();
            }

            // Implement ToolStripMenu

            List <Button> buttonList = new List <Button>()
            {
                buttonSquareUp,
                buttonSquareUpRight,
                buttonSquareRight,
                buttonSquareDownRight,
                buttonSquareDown,
                buttonSquareDownLeft,
                buttonSquareLeft,
                buttonSquareUpLeft,
            };

            List <Point> positionList = buttonList.ConvertAll(
                button => new Point(button.Location.X, button.Location.Y));

            ToolStripMenuItem itemLeft      = new ToolStripMenuItem("Face Left");
            ToolStripMenuItem itemRight     = new ToolStripMenuItem("Face Right");
            ToolStripMenuItem itemUp        = new ToolStripMenuItem("Face Up");
            ToolStripMenuItem itemDown      = new ToolStripMenuItem("Face Down");
            ToolStripMenuItem itemUpLeft    = new ToolStripMenuItem("Face Up-Left");
            ToolStripMenuItem itemDownLeft  = new ToolStripMenuItem("Face Down-Left");
            ToolStripMenuItem itemUpRight   = new ToolStripMenuItem("Face Up-Right");
            ToolStripMenuItem itemDownRight = new ToolStripMenuItem("Face Down-Right");

            Action <FacingDirection, int> SetFacingDirection = (FacingDirection facingDirection, int direction) =>
            {
                itemLeft.Checked      = facingDirection == FacingDirection.Left;
                itemRight.Checked     = facingDirection == FacingDirection.Right;
                itemUp.Checked        = facingDirection == FacingDirection.Up;
                itemDown.Checked      = facingDirection == FacingDirection.Down;
                itemUpLeft.Checked    = facingDirection == FacingDirection.UpLeft;
                itemDownLeft.Checked  = facingDirection == FacingDirection.DownLeft;
                itemUpRight.Checked   = facingDirection == FacingDirection.UpRight;
                itemDownRight.Checked = facingDirection == FacingDirection.DownRight;

                for (int i = 0; i < buttonList.Count; i++)
                {
                    int    newDirection = (direction + i) % buttonList.Count;
                    Point  newPoint     = positionList[newDirection];
                    Button button       = buttonList[i];
                    button.Location = newPoint;
                }
            };

            itemLeft.Click      += (sender, e) => SetFacingDirection(FacingDirection.Left, 6);
            itemRight.Click     += (sender, e) => SetFacingDirection(FacingDirection.Right, 2);
            itemUp.Click        += (sender, e) => SetFacingDirection(FacingDirection.Up, 0);
            itemDown.Click      += (sender, e) => SetFacingDirection(FacingDirection.Down, 4);
            itemUpLeft.Click    += (sender, e) => SetFacingDirection(FacingDirection.UpLeft, 7);
            itemDownLeft.Click  += (sender, e) => SetFacingDirection(FacingDirection.DownLeft, 5);
            itemUpRight.Click   += (sender, e) => SetFacingDirection(FacingDirection.UpRight, 1);
            itemDownRight.Click += (sender, e) => SetFacingDirection(FacingDirection.DownRight, 3);

            ContextMenuStrip contextMenuStrip = new ContextMenuStrip();

            contextMenuStrip.Items.Add(itemLeft);
            contextMenuStrip.Items.Add(itemRight);
            contextMenuStrip.Items.Add(itemUp);
            contextMenuStrip.Items.Add(itemDown);
            contextMenuStrip.Items.Add(itemUpLeft);
            contextMenuStrip.Items.Add(itemDownLeft);
            contextMenuStrip.Items.Add(itemUpRight);
            contextMenuStrip.Items.Add(itemDownRight);
            groupbox.ContextMenuStrip = contextMenuStrip;

            AddInversionContextMenuStrip(buttonLineUp, buttonLineDown);

            itemUp.Checked = true;
        }
Example #32
0
 public BrowserForm(ContextMenuStrip cms)
 {
     InitializeComponent();
     this.TabPageContextMenuStrip = cms;
 }
Example #33
0
        private int MINMAX = 8;                                 // 8 times bigger or smaller than the ctrl

        #endregion

        #region Designer generated code

        private void InitializeComponent()
        {
            this.components               = new System.ComponentModel.Container();
            this.PicBox                   = new System.Windows.Forms.PictureBox();
            this.OuterPanel               = new System.Windows.Forms.Panel();
            this.contextMenuStrip         = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.zoomInToolStripMenuItem  = new System.Windows.Forms.ToolStripMenuItem();
            this.zoomOutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            ((System.ComponentModel.ISupportInitialize)(this.PicBox)).BeginInit();
            this.OuterPanel.SuspendLayout();
            this.contextMenuStrip.SuspendLayout();
            this.SuspendLayout();
            //
            // PicBox
            //
            this.PicBox.Location = new System.Drawing.Point(0, 0);
            this.PicBox.Name     = "PicBox";
            this.PicBox.Size     = new System.Drawing.Size(150, 140);
            this.PicBox.TabIndex = 3;
            this.PicBox.TabStop  = false;
            //
            // OuterPanel
            //
            this.OuterPanel.AutoScroll       = true;
            this.OuterPanel.ContextMenuStrip = this.contextMenuStrip;
            this.OuterPanel.Controls.Add(this.PicBox);
            this.OuterPanel.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.OuterPanel.Location = new System.Drawing.Point(0, 0);
            this.OuterPanel.Name     = "OuterPanel";
            this.OuterPanel.Size     = new System.Drawing.Size(210, 190);
            this.OuterPanel.TabIndex = 4;
            //
            // contextMenuStrip
            //
            this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.zoomInToolStripMenuItem,
                this.zoomOutToolStripMenuItem
            });
            this.contextMenuStrip.Name = "contextMenuStrip";
            this.contextMenuStrip.Size = new System.Drawing.Size(120, 48);
            //
            // zoomInToolStripMenuItem
            //
            this.zoomInToolStripMenuItem.Name   = "zoomInToolStripMenuItem";
            this.zoomInToolStripMenuItem.Size   = new System.Drawing.Size(152, 22);
            this.zoomInToolStripMenuItem.Text   = "Zoom in";
            this.zoomInToolStripMenuItem.Click += new System.EventHandler(this.zoomInToolStripMenuItem_Click);
            //
            // zoomOutToolStripMenuItem
            //
            this.zoomOutToolStripMenuItem.Name   = "zoomOutToolStripMenuItem";
            this.zoomOutToolStripMenuItem.Size   = new System.Drawing.Size(152, 22);
            this.zoomOutToolStripMenuItem.Text   = "Zoom out";
            this.zoomOutToolStripMenuItem.Click += new System.EventHandler(this.zoomOutToolStripMenuItem_Click);
            //
            // ZoomablePictureBox
            //
            this.Controls.Add(this.OuterPanel);
            this.Name = "ZoomablePictureBox";
            this.Size = new System.Drawing.Size(210, 190);
            ((System.ComponentModel.ISupportInitialize)(this.PicBox)).EndInit();
            this.OuterPanel.ResumeLayout(false);
            this.contextMenuStrip.ResumeLayout(false);
            this.ResumeLayout(false);
        }
Example #34
0
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] {
         "01",
         "2012"
     }, -1);
     this.lblIndexWidth = new System.Windows.Forms.Label();
     this.lblClockWidth = new System.Windows.Forms.Label();
     this.cmsBoostTable = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.fixInvalidClocksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.scMaxTableClock = new BoostLimit();
     this.lvClocks        = new LvClocks();
     this.columnHeader1   = new System.Windows.Forms.ColumnHeader();
     this.columnHeader2   = new System.Windows.Forms.ColumnHeader();
     this.columnHeader3   = new System.Windows.Forms.ColumnHeader();
     this.columnHeader4   = new System.Windows.Forms.ColumnHeader();
     this.columnHeader5   = new System.Windows.Forms.ColumnHeader();
     this.columnHeader6   = new System.Windows.Forms.ColumnHeader();
     this.columnHeader7   = new System.Windows.Forms.ColumnHeader();
     this.columnHeader8   = new System.Windows.Forms.ColumnHeader();
     this.columnHeader9   = new System.Windows.Forms.ColumnHeader();
     this.columnHeader10  = new System.Windows.Forms.ColumnHeader();
     this.columnHeader11  = new System.Windows.Forms.ColumnHeader();
     this.columnHeader12  = new System.Windows.Forms.ColumnHeader();
     this.cmsBoostTable.SuspendLayout();
     this.SuspendLayout();
     //
     // lblIndexWidth
     //
     this.lblIndexWidth.Location = new System.Drawing.Point(308, 115);
     this.lblIndexWidth.Name     = "lblIndexWidth";
     this.lblIndexWidth.Size     = new System.Drawing.Size(26, 23);
     this.lblIndexWidth.TabIndex = 3;
     this.lblIndexWidth.Text     = "IndexWidth";
     this.lblIndexWidth.Visible  = false;
     //
     // lblClockWidth
     //
     this.lblClockWidth.Location = new System.Drawing.Point(308, 143);
     this.lblClockWidth.Name     = "lblClockWidth";
     this.lblClockWidth.Size     = new System.Drawing.Size(54, 23);
     this.lblClockWidth.TabIndex = 4;
     this.lblClockWidth.Text     = "ClockWidth";
     this.lblClockWidth.Visible  = false;
     //
     // cmsBoostTable
     //
     this.cmsBoostTable.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.fixInvalidClocksToolStripMenuItem
     });
     this.cmsBoostTable.Name = "cmsBoostTable";
     this.cmsBoostTable.Size = new System.Drawing.Size(163, 26);
     //
     // fixInvalidClocksToolStripMenuItem
     //
     this.fixInvalidClocksToolStripMenuItem.Name   = "fixInvalidClocksToolStripMenuItem";
     this.fixInvalidClocksToolStripMenuItem.Size   = new System.Drawing.Size(162, 22);
     this.fixInvalidClocksToolStripMenuItem.Text   = "Fix invalid clocks";
     this.fixInvalidClocksToolStripMenuItem.Click += new System.EventHandler(this.fixInvalidClocksToolStripMenuItem_Click);
     //
     // scMaxTableClock
     //
     this.scMaxTableClock.Caption        = "Max Table Clock";
     this.scMaxTableClock.Location       = new System.Drawing.Point(5, 297);
     this.scMaxTableClock.Name           = "scMaxTableClock";
     this.scMaxTableClock.Size           = new System.Drawing.Size(404, 28);
     this.scMaxTableClock.SliderMaximum  = 97;
     this.scMaxTableClock.SliderPosition = 67;
     this.scMaxTableClock.TabIndex       = 1;
     this.scMaxTableClock.ValueText      = "";
     this.scMaxTableClock.ValueTextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.scMaxTableClock.OnScroll      += new System.EventHandler(this.scMaxTableClock_OnScroll);
     //
     // lvClocks
     //
     this.lvClocks.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
         this.columnHeader1,
         this.columnHeader2,
         this.columnHeader3,
         this.columnHeader4,
         this.columnHeader5,
         this.columnHeader6,
         this.columnHeader7,
         this.columnHeader8,
         this.columnHeader9,
         this.columnHeader10,
         this.columnHeader11,
         this.columnHeader12
     });
     this.lvClocks.ContextMenuStrip = this.cmsBoostTable;
     this.lvClocks.GridLines        = true;
     this.lvClocks.HeaderStyle      = System.Windows.Forms.ColumnHeaderStyle.None;
     this.lvClocks.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
         listViewItem1
     });
     this.lvClocks.Location    = new System.Drawing.Point(3, 3);
     this.lvClocks.MultiSelect = false;
     this.lvClocks.Name        = "lvClocks";
     this.lvClocks.Scrollable  = false;
     this.lvClocks.Size        = new System.Drawing.Size(410, 292);
     this.lvClocks.TabIndex    = 0;
     this.lvClocks.UseCompatibleStateImageBehavior = false;
     this.lvClocks.View = System.Windows.Forms.View.Details;
     //
     // columnHeader1
     //
     this.columnHeader1.Width = 20;
     //
     // columnHeader2
     //
     this.columnHeader2.Width = 44;
     //
     // columnHeader3
     //
     this.columnHeader3.Width = 24;
     //
     // columnHeader4
     //
     this.columnHeader4.Width = 44;
     //
     // columnHeader5
     //
     this.columnHeader5.Width = 24;
     //
     // columnHeader6
     //
     this.columnHeader6.Width = 44;
     //
     // columnHeader7
     //
     this.columnHeader7.Width = 24;
     //
     // columnHeader8
     //
     this.columnHeader8.Width = 44;
     //
     // columnHeader9
     //
     this.columnHeader9.Width = 24;
     //
     // columnHeader10
     //
     this.columnHeader10.Width = 44;
     //
     // columnHeader11
     //
     this.columnHeader11.Width = 24;
     //
     // columnHeader12
     //
     this.columnHeader12.Width = 44;
     //
     // UCBoostClocks
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.lblClockWidth);
     this.Controls.Add(this.lblIndexWidth);
     this.Controls.Add(this.scMaxTableClock);
     this.Controls.Add(this.lvClocks);
     this.Name = "UCBoostClocks";
     this.Size = new System.Drawing.Size(416, 330);
     this.cmsBoostTable.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Example #35
0
        private void FormPutLinks_Load(object sender, EventArgs e)
        {
            try
            {
                _book  = GeneralRep.ActiveBook;
                _table = dataSet1.Tables[0];
                new ToolTip().SetToolTip(ButDeleteLinks, "Удалить все ссылки из выделенной области листа");
                new ToolTip().SetToolTip(ButUndo, "Отменить последнюю установку ссылок");
                new ToolTip().SetToolTip(ButRedo, "Вернуть отмененную установку ссылок");
                new ToolTip().SetToolTip(ButUpdate, "Обновить список параметров");
                new ToolTip().SetToolTip(ButFilter, "Поиск и фильтрация списка параметров");
                new ToolTip().SetToolTip(Template, "Текущий шаблон для установки ссылок");
                new ToolTip().SetToolTip(ButSave, "Сохранить установленные ссылки и отчет");
                new ToolTip().SetToolTip(ButLinkSave, "Добавить ссылку на ячейку для сохранения в журнал отчетов");
                new ToolTip().SetToolTip(ButFindLinks, "Список всех ячеек со ссылками на выбранный параметр");
                new ToolTip().SetToolTip(ButOtmLinks, "Установить ссылки на отмеченные параметры в соответствии с текущим шаблоном");
                new ToolTip().SetToolTip(ButOtmTrue, "Отметить все");
                new ToolTip().SetToolTip(ButOtmFalse, "Снять все отметки");

                _book.SysPage.GetTemplatesList(Template);
                _book.CurTransactionNum = _book.CurTransactionNum;//Обновить доступность кнопок

                //Выпадающий список проектов
                Project.Items.Clear();
                foreach (var p in _book.Projects.Values)
                {
                    if (p.IsSystem)
                    {
                        Project.Items.Add(p.Code);
                    }
                    else if (!p.IsSave)
                    {
                        Project.Items.Add(p.CodeFinal + ":  " + p.Name);
                    }
                }
                if (Project.Items.Count > 1 && (string)Project.Items[0] == "Системные")
                {
                    Project.Text = (string)Project.Items[1];
                }
                else
                {
                    Project.Text = (string)Project.Items[0];
                }

                var menu = new ContextMenuStrip();
                menu.Items.Add(LinkField.Code.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddCode;
                menu.Items.Add(LinkField.CodeParam.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddCodeParam;
                menu.Items.Add(LinkField.CodeSubParam.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddCodeSubParam;
                menu.Items.Add(LinkField.Name.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddName;
                menu.Items.Add(LinkField.SubName.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddSubName;
                menu.Items.Add(LinkField.Units.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddUnits;
                menu.Items.Add(LinkField.Task.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddTask;
                menu.Items.Add(LinkField.Comment.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddComment;
                menu.Items.Add(LinkField.SuperProcessType.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddSuperProcess;
                menu.Items.Add(LinkField.DataType.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddDataType;
                menu.Items.Add(LinkField.Min.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddMin;
                menu.Items.Add(LinkField.Max.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddMax;
                menu.Items.Add(new ToolStripSeparator());
                menu.Items.Add("Ссылки по шаблону");
                menu.Items[menu.Items.Count - 1].Click += AddTemplateLinks;
                menu.Items.Add(LinkField.Value.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddValueLink;
                menu.Items.Add(LinkField.Time.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddTimeLink;
                menu.Items.Add(LinkField.Nd.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddNdLink;
                menu.Items.Add(LinkField.Number.ToRussian());
                menu.Items[menu.Items.Count - 1].Click += AddNumberLink;
                Params.ContextMenuStrip = menu;
            }
            catch (Exception ex)
            {
                GeneralRep.ShowError("Ошибка загрузки формы установки ссылок", ex);
            }
            try
            {
                Template.Text        = _book.SysPage.GetValue("CurTemplate");
                CellComment.Text     = _book.SysPage.GetValue("CurCellComment");
                NextCellShift.Text   = _book.SysPage.GetValue("CurNextCellShift");
                NextCellStep.Text    = _book.SysPage.GetValue("CurNextCellStep");
                NextCellStep.Enabled = NextCellShift.Text != "Нет";
            }
            catch { }
            GeneralRep.Application.CommandBars.OnUpdate += OnShapeChange;
            GeneralRep.Application.SheetSelectionChange += OnSelectionChange;
        }
        /// <summary>
        /// Populates the context menu strip, should be called after the context menu options have been set.
        /// </summary>
        private void PopulateContextMenuStrip()
        {
            ContextMenuStrip = new ContextMenuStrip();

            if (mCustomActions != null)
            {
                foreach (var item in mCustomActions)
                {
                    ContextMenuStrip.Items.Add(new ToolStripMenuItem(item.Name, null, item.OnClick, item.ShortcutKeys));
                }

                ContextMenuStrip.Items.Add(new ToolStripSeparator());
            }

            if (CommonContextMenuOptions.HasFlag(CommonContextMenuOptions.Export))
            {
                ContextMenuStrip.Items.Add(new ToolStripMenuItem("&Export", null, ExportEventHandler, Keys.Control | Keys.E));
            }

            if (CommonContextMenuOptions.HasFlag(CommonContextMenuOptions.Replace))
            {
                ContextMenuStrip.Items.Add(new ToolStripMenuItem("&Replace", null, ReplaceEventHandler, Keys.Control | Keys.R));
                if (!CommonContextMenuOptions.HasFlag(CommonContextMenuOptions.Add))
                {
                    ContextMenuStrip.Items.Add(new ToolStripSeparator());
                }
            }

            if (CommonContextMenuOptions.HasFlag(CommonContextMenuOptions.Add))
            {
                ContextMenuStrip.Items.Add(new ToolStripMenuItem("&Add", null, AddEventHandler, Keys.Control | Keys.A));
                if (CommonContextMenuOptions.HasFlag(CommonContextMenuOptions.Move))
                {
                    ContextMenuStrip.Items.Add(new ToolStripSeparator());
                }
            }

            if (CommonContextMenuOptions.HasFlag(CommonContextMenuOptions.Move))
            {
                ContextMenuStrip.Items.Add(new ToolStripMenuItem("Move &Up", null, MoveUpEventHandler, Keys.Control | Keys.Up));
                ContextMenuStrip.Items.Add(new ToolStripMenuItem("Move &Down", null, MoveDownEventHandler, Keys.Control | Keys.Down));
            }

            if (CommonContextMenuOptions.HasFlag(CommonContextMenuOptions.Rename))
            {
                ContextMenuStrip.Items.Add(new ToolStripMenuItem("Re&name", null, RenameEventHandler, Keys.Control | Keys.N));
                if (!CommonContextMenuOptions.HasFlag(CommonContextMenuOptions.Encode) && CommonContextMenuOptions.HasFlag(CommonContextMenuOptions.Delete))
                {
                    ContextMenuStrip.Items.Add(new ToolStripSeparator());
                }
            }

            if (CommonContextMenuOptions.HasFlag(CommonContextMenuOptions.Encode))
            {
                ContextMenuStrip.Items.Add(new ToolStripMenuItem("Encode", null, null, Keys.Control | Keys.N));
                if (CommonContextMenuOptions.HasFlag(CommonContextMenuOptions.Delete))
                {
                    ContextMenuStrip.Items.Add(new ToolStripSeparator());
                }
            }

            if (CommonContextMenuOptions.HasFlag(CommonContextMenuOptions.Delete))
            {
                ContextMenuStrip.Items.Add(new ToolStripMenuItem("&Delete", null, DeleteEventHandler, Keys.Control | Keys.Delete));
            }
        }
Example #37
0
 private void graphControl_ContextMenuBuilder(ZedGraphControl sender, ContextMenuStrip menuStrip, Point mousePt, ZedGraphControl.ContextMenuObjectState objState)
 {
     ZedGraphHelper.BuildContextMenu(graphControl, menuStrip, true);
 }
        private void contextMenuStripTools_Opening(object sender, CancelEventArgs e)
        {
            ContextMenuStrip menu = (ContextMenuStrip)sender;

            m_sourceControl = menu.SourceControl;
        }
Example #39
0
 private void InitializeComponent()
 {
     this.components           = new System.ComponentModel.Container();
     this.tableAdapterManager1 = new QuanLyThuVien.QuanLyThuVienDataSet4TableAdapters.TableAdapterManager();
     this.menuStrip            = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.sửaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.label1           = new System.Windows.Forms.Label();
     this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
     this.menuStrip.SuspendLayout();
     this.SuspendLayout();
     //
     // tableAdapterManager1
     //
     this.tableAdapterManager1.BackupDataSetBeforeUpdate = false;
     this.tableAdapterManager1.Connection        = null;
     this.tableAdapterManager1.UpdateOrder       = QuanLyThuVien.QuanLyThuVienDataSet4TableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete;
     this.tableAdapterManager1.ViTriTableAdapter = null;
     //
     // contextMenuStrip1
     //
     this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.sửaToolStripMenuItem
     });
     this.menuStrip.Name = "contextMenuStrip1";
     this.menuStrip.Size = new System.Drawing.Size(181, 48);
     //
     // sửaToolStripMenuItem
     //
     this.sửaToolStripMenuItem.Name   = "sửaToolStripMenuItem";
     this.sửaToolStripMenuItem.Size   = new System.Drawing.Size(180, 22);
     this.sửaToolStripMenuItem.Text   = "Sửa";
     this.sửaToolStripMenuItem.Click += new System.EventHandler(this.SửaToolStripMenuItem_Click);
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(3, 7);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(77, 13);
     this.label1.TabIndex = 1;
     this.label1.Text     = "EContextMenu";
     //
     // flowLayoutPanel1
     //
     this.flowLayoutPanel1.Location = new System.Drawing.Point(27, 23);
     this.flowLayoutPanel1.Name     = "flowLayoutPanel1";
     this.flowLayoutPanel1.Size     = new System.Drawing.Size(8, 8);
     this.flowLayoutPanel1.TabIndex = 2;
     //
     // EContextMenu
     //
     this.BackColor = System.Drawing.SystemColors.Info;
     this.Controls.Add(this.flowLayoutPanel1);
     this.Controls.Add(this.label1);
     this.Name   = "EContextMenu";
     this.Size   = new System.Drawing.Size(85, 34);
     this.Click += new System.EventHandler(this.EContextMenu_Click);
     this.menuStrip.ResumeLayout(false);
     this.ResumeLayout(false);
     this.PerformLayout();
 }
    public static void Initialize_MenuStrip()
    {
        // 栏目右键菜单
        band_Menu = new ContextMenuStrip()
        {
            ImageScalingSize = new Size(20, 20),
            Font             = system_Font
        };
        ToolStripSeparator band_Separator = new ToolStripSeparator {
            AutoSize = true
        };

        ToolStripMenuItem[] menuband_Item = new ToolStripMenuItem[3];
        Bitmap[]            menuband_img  = new Bitmap[3] {
            EzRBuild.EzResource.set_band,
            EzRBuild.EzResource.past,
            EzRBuild.EzResource.prview
        };
        string[] menuband_str = new string[3] {
            "栏目设置", "粘贴", "打印预览"
        };
        for (int i = 0; i < 3; i++)
        {
            menuband_Item[i] = new ToolStripMenuItem()
            {
                AutoSize = true,
                Image    = menuband_img[i],
                Text     = menuband_str[i],
            };
            if (i == 1)
            {
                menuband_Item[i].ShortcutKeys = Keys.Alt | Keys.V;
            }
            if (i == 2)
            {
                menuband_Item[i].ShortcutKeys = Keys.Alt | Keys.P;
            }

            menuband_Item[i].MouseDown += BandMenu_MouseDown;

            band_Menu.Items.Add(menuband_Item[i]);
            if (i == 0)
            {
                band_Menu.Items.Add(band_Separator);
            }
        }

        // 组件右键菜单
        control_Menu = new ContextMenuStrip()
        {
            ImageScalingSize = new Size(20, 20),
            Font             = system_Font
        };
        ToolStripSeparator[] menu_Separator = new ToolStripSeparator[4];/////3
        for (int i = 0; i < 4; i++)
        {
            menu_Separator[i] = new ToolStripSeparator()
            {
                AutoSize = true
            }
        }
        ;                                                                                             ////3

        ToolStripMenuItem[] menu_Item    = new ToolStripMenuItem[9];
        ToolStripMenuItem[] menu_subItem = new ToolStripMenuItem[9];

        Bitmap[] menu_img = new Bitmap[9] {
            EzRBuild.EzResource.cut,
            EzRBuild.EzResource.copy,
            EzRBuild.EzResource.past,
            EzRBuild.EzResource.del,
            EzRBuild.EzResource.cancel,
            EzRBuild.EzResource.redo,
            EzRBuild.EzResource.pgalign,
            EzRBuild.EzResource.topmose,
            EzRBuild.EzResource.botmost
        };
        Bitmap[] menu_subimg = new Bitmap[9] {
            EzRBuild.EzResource.setleft,
            EzRBuild.EzResource.setright,
            EzRBuild.EzResource.settop,
            EzRBuild.EzResource.setbot,
            EzRBuild.EzResource.a_left,
            EzRBuild.EzResource.a_center,
            EzRBuild.EzResource.a_right,
            EzRBuild.EzResource.a_top,
            EzRBuild.EzResource.a_bot
        };

        string[] menu_str = new string[9] {
            "剪切", "复制", "粘贴", "删除", "撤销", "重做", "页面对齐方式", "放置上层", "放置下层"
        };
        string[] menu_substr = new string[9] {
            "居左", "居右", "居顶", "居底", "左对齐", "垂直对齐", "右对齐", "顶对齐", "底对齐"
        };

        Keys[] menu_keys = new Keys[9] {
            Keys.Alt | Keys.X,
            Keys.Alt | Keys.C,
            Keys.Alt | Keys.V,
            Keys.Alt | Keys.Delete,
            Keys.Alt | Keys.Z,
            Keys.Alt | Keys.R,
            Keys.Control | Keys.Shift | Keys.D0,
            Keys.Alt | Keys.T,
            Keys.Alt | Keys.B
        };

        for (int i = 0; i < 9; i++)
        {
            menu_Item[i] = new ToolStripMenuItem()
            {
                AutoSize = true,
                Image    = menu_img[i],
                Text     = menu_str[i],
            };
            menu_Item[i].Click += ControlMenu_Click;
            if (i != 6)
            {
                menu_Item[i].ShortcutKeys = menu_keys[i];
            }
            if (i == 6)
            {
                for (int t = 0; t < 9; t++)
                {
                    menu_subItem[t] = new ToolStripMenuItem()
                    {
                        AutoSize = true, Text = menu_substr[t], Image = menu_subimg[t]
                    };
                    menu_subItem[t].Click += ControlMenu_Click;
                }
                menu_Item[i].DropDownItems.AddRange(menu_subItem);
                menu_Item[i].DropDownItems.Insert(4, menu_Separator[3]);
            }

            control_Menu.Items.Add(menu_Item[i]);
            if (i == 3)
            {
                control_Menu.Items.Add(menu_Separator[0]);
            }
            if (i == 5)
            {
                control_Menu.Items.Add(menu_Separator[1]);
            }
            if (i == 6)
            {
                control_Menu.Items.Add(menu_Separator[2]);
            }
        }
    }
Example #41
0
        private void InitializeComponent()
        {
            cmsHistory                    = new ContextMenuStrip();
            tsmiOpen                      = new ToolStripMenuItem();
            tsmiOpenURL                   = new ToolStripMenuItem();
            tsmiOpenShortenedURL          = new ToolStripMenuItem();
            tsmiOpenThumbnailURL          = new ToolStripMenuItem();
            tsmiOpenDeletionURL           = new ToolStripMenuItem();
            tssOpen1                      = new ToolStripSeparator();
            tsmiOpenFile                  = new ToolStripMenuItem();
            tsmiOpenFolder                = new ToolStripMenuItem();
            tsmiCopy                      = new ToolStripMenuItem();
            tsmiCopyURL                   = new ToolStripMenuItem();
            tsmiCopyShortenedURL          = new ToolStripMenuItem();
            tsmiCopyThumbnailURL          = new ToolStripMenuItem();
            tsmiCopyDeletionURL           = new ToolStripMenuItem();
            tssCopy1                      = new ToolStripSeparator();
            tsmiCopyFile                  = new ToolStripMenuItem();
            tsmiCopyImage                 = new ToolStripMenuItem();
            tsmiCopyText                  = new ToolStripMenuItem();
            tssCopy2                      = new ToolStripSeparator();
            tsmiCopyHTMLLink              = new ToolStripMenuItem();
            tsmiCopyHTMLImage             = new ToolStripMenuItem();
            tsmiCopyHTMLLinkedImage       = new ToolStripMenuItem();
            tssCopy3                      = new ToolStripSeparator();
            tsmiCopyForumLink             = new ToolStripMenuItem();
            tsmiCopyForumImage            = new ToolStripMenuItem();
            tsmiCopyForumLinkedImage      = new ToolStripMenuItem();
            tssCopy4                      = new ToolStripSeparator();
            tsmiCopyFilePath              = new ToolStripMenuItem();
            tsmiCopyFileName              = new ToolStripMenuItem();
            tsmiCopyFileNameWithExtension = new ToolStripMenuItem();
            tsmiCopyFolder                = new ToolStripMenuItem();
            tsmiShow                      = new ToolStripMenuItem();
            tsmiShowImagePreview          = new ToolStripMenuItem();
            tsmiShowMoreInfo              = new ToolStripMenuItem();
            cmsHistory.SuspendLayout();

            //
            // cmsHistory
            //
            cmsHistory.Items.AddRange(new ToolStripItem[]
            {
                tsmiOpen,
                tsmiCopy,
                tsmiShow
            });
            cmsHistory.Name            = "cmsHistory";
            cmsHistory.ShowImageMargin = false;
            cmsHistory.Size            = new Size(128, 92);
            cmsHistory.Enabled         = false;
            //
            // tsmiOpen
            //
            tsmiOpen.DropDownItems.AddRange(new ToolStripItem[]
            {
                tsmiOpenURL,
                tsmiOpenShortenedURL,
                tsmiOpenThumbnailURL,
                tsmiOpenDeletionURL,
                tssOpen1,
                tsmiOpenFile,
                tsmiOpenFolder
            });
            tsmiOpen.Name = "tsmiOpen";
            tsmiOpen.Size = new Size(127, 22);
            tsmiOpen.Text = "Open";
            //
            // tsmiOpenURL
            //
            tsmiOpenURL.Name   = "tsmiOpenURL";
            tsmiOpenURL.Size   = new Size(156, 22);
            tsmiOpenURL.Text   = "URL";
            tsmiOpenURL.Click += tsmiOpenURL_Click;
            //
            // tsmiOpenShortenedURL
            //
            tsmiOpenShortenedURL.Name   = "tsmiOpenShortenedURL";
            tsmiOpenShortenedURL.Size   = new Size(156, 22);
            tsmiOpenShortenedURL.Text   = "Shortened URL";
            tsmiOpenShortenedURL.Click += tsmiOpenShortenedURL_Click;
            //
            // tsmiOpenThumbnailURL
            //
            tsmiOpenThumbnailURL.Name   = "tsmiOpenThumbnailURL";
            tsmiOpenThumbnailURL.Size   = new Size(156, 22);
            tsmiOpenThumbnailURL.Text   = "Thumbnail URL";
            tsmiOpenThumbnailURL.Click += tsmiOpenThumbnailURL_Click;
            //
            // tsmiOpenDeletionURL
            //
            tsmiOpenDeletionURL.Name   = "tsmiOpenDeletionURL";
            tsmiOpenDeletionURL.Size   = new Size(156, 22);
            tsmiOpenDeletionURL.Text   = "Deletion URL";
            tsmiOpenDeletionURL.Click += tsmiOpenDeletionURL_Click;
            //
            // tssOpen1
            //
            tssOpen1.Name = "tssOpen1";
            tssOpen1.Size = new Size(153, 6);
            //
            // tsmiOpenFile
            //
            tsmiOpenFile.Name   = "tsmiOpenFile";
            tsmiOpenFile.Size   = new Size(156, 22);
            tsmiOpenFile.Text   = "File";
            tsmiOpenFile.Click += tsmiOpenFile_Click;
            //
            // tsmiOpenFolder
            //
            tsmiOpenFolder.Name   = "tsmiOpenFolder";
            tsmiOpenFolder.Size   = new Size(156, 22);
            tsmiOpenFolder.Text   = "Folder";
            tsmiOpenFolder.Click += tsmiOpenFolder_Click;
            //
            // tsmiCopy
            //
            tsmiCopy.DropDownItems.AddRange(new ToolStripItem[]
            {
                tsmiCopyURL,
                tsmiCopyShortenedURL,
                tsmiCopyThumbnailURL,
                tsmiCopyDeletionURL,
                tssCopy1,
                tsmiCopyFile,
                tsmiCopyImage,
                tsmiCopyText,
                tssCopy2,
                tsmiCopyHTMLLink,
                tsmiCopyHTMLImage,
                tsmiCopyHTMLLinkedImage,
                tssCopy3,
                tsmiCopyForumLink,
                tsmiCopyForumImage,
                tsmiCopyForumLinkedImage,
                tssCopy4,
                tsmiCopyFilePath,
                tsmiCopyFileName,
                tsmiCopyFileNameWithExtension,
                tsmiCopyFolder
            });
            tsmiCopy.Name = "tsmiCopy";
            tsmiCopy.Size = new Size(127, 22);
            tsmiCopy.Text = "Copy";
            //
            // tsmiCopyURL
            //
            tsmiCopyURL.Name   = "tsmiCopyURL";
            tsmiCopyURL.Size   = new Size(233, 22);
            tsmiCopyURL.Text   = "URL";
            tsmiCopyURL.Click += tsmiCopyURL_Click;
            //
            // tsmiCopyShortenedURL
            //
            tsmiCopyShortenedURL.Name   = "tsmiCopyShortenedURL";
            tsmiCopyShortenedURL.Size   = new Size(233, 22);
            tsmiCopyShortenedURL.Text   = "Shortened URL";
            tsmiCopyShortenedURL.Click += tsmiCopyShortenedURL_Click;
            //
            // tsmiCopyThumbnailURL
            //
            tsmiCopyThumbnailURL.Name   = "tsmiCopyThumbnailURL";
            tsmiCopyThumbnailURL.Size   = new Size(233, 22);
            tsmiCopyThumbnailURL.Text   = "Thumbnail URL";
            tsmiCopyThumbnailURL.Click += tsmiCopyThumbnailURL_Click;
            //
            // tsmiCopyDeletionURL
            //
            tsmiCopyDeletionURL.Name   = "tsmiCopyDeletionURL";
            tsmiCopyDeletionURL.Size   = new Size(233, 22);
            tsmiCopyDeletionURL.Text   = "Deletion URL";
            tsmiCopyDeletionURL.Click += tsmiCopyDeletionURL_Click;
            //
            // tssCopy1
            //
            tssCopy1.Name = "tssCopy1";
            tssCopy1.Size = new Size(230, 6);
            //
            // tsmiCopyFile
            //
            tsmiCopyFile.Name   = "tsmiCopyFile";
            tsmiCopyFile.Size   = new Size(233, 22);
            tsmiCopyFile.Text   = "File";
            tsmiCopyFile.Click += tsmiCopyFile_Click;
            //
            // tsmiCopyImage
            //
            tsmiCopyImage.Name   = "tsmiCopyImage";
            tsmiCopyImage.Size   = new Size(233, 22);
            tsmiCopyImage.Text   = "Image";
            tsmiCopyImage.Click += tsmiCopyImage_Click;
            //
            // tsmiCopyText
            //
            tsmiCopyText.Name   = "tsmiCopyText";
            tsmiCopyText.Size   = new Size(233, 22);
            tsmiCopyText.Text   = "Text";
            tsmiCopyText.Click += tsmiCopyText_Click;
            //
            // tssCopy2
            //
            tssCopy2.Name = "tssCopy2";
            tssCopy2.Size = new Size(230, 6);
            //
            // tsmiCopyHTMLLink
            //
            tsmiCopyHTMLLink.Name   = "tsmiCopyHTMLLink";
            tsmiCopyHTMLLink.Size   = new Size(233, 22);
            tsmiCopyHTMLLink.Text   = "HTML link";
            tsmiCopyHTMLLink.Click += tsmiCopyHTMLLink_Click;
            //
            // tsmiCopyHTMLImage
            //
            tsmiCopyHTMLImage.Name   = "tsmiCopyHTMLImage";
            tsmiCopyHTMLImage.Size   = new Size(233, 22);
            tsmiCopyHTMLImage.Text   = "HTML image";
            tsmiCopyHTMLImage.Click += tsmiCopyHTMLImage_Click;
            //
            // tsmiCopyHTMLLinkedImage
            //
            tsmiCopyHTMLLinkedImage.Name   = "tsmiCopyHTMLLinkedImage";
            tsmiCopyHTMLLinkedImage.Size   = new Size(233, 22);
            tsmiCopyHTMLLinkedImage.Text   = "HTML linked image";
            tsmiCopyHTMLLinkedImage.Click += tsmiCopyHTMLLinkedImage_Click;
            //
            // tssCopy3
            //
            tssCopy3.Name = "tssCopy3";
            tssCopy3.Size = new Size(230, 6);
            //
            // tsmiCopyForumLink
            //
            tsmiCopyForumLink.Name   = "tsmiCopyForumLink";
            tsmiCopyForumLink.Size   = new Size(233, 22);
            tsmiCopyForumLink.Text   = "Forum (BBCode) link";
            tsmiCopyForumLink.Click += tsmiCopyForumLink_Click;
            //
            // tsmiCopyForumImage
            //
            tsmiCopyForumImage.Name   = "tsmiCopyForumImage";
            tsmiCopyForumImage.Size   = new Size(233, 22);
            tsmiCopyForumImage.Text   = "Forum (BBCode) image";
            tsmiCopyForumImage.Click += tsmiCopyForumImage_Click;
            //
            // tsmiCopyForumLinkedImage
            //
            tsmiCopyForumLinkedImage.Name   = "tsmiCopyForumLinkedImage";
            tsmiCopyForumLinkedImage.Size   = new Size(233, 22);
            tsmiCopyForumLinkedImage.Text   = "Forum (BBCode) linked image";
            tsmiCopyForumLinkedImage.Click += tsmiCopyForumLinkedImage_Click;
            //
            // tssCopy4
            //
            tssCopy4.Name = "tssCopy4";
            tssCopy4.Size = new Size(230, 6);
            //
            // tsmiCopyFilePath
            //
            tsmiCopyFilePath.Name   = "tsmiCopyFilePath";
            tsmiCopyFilePath.Size   = new Size(233, 22);
            tsmiCopyFilePath.Text   = "File path";
            tsmiCopyFilePath.Click += tsmiCopyFilePath_Click;
            //
            // tsmiCopyFileName
            //
            tsmiCopyFileName.Name   = "tsmiCopyFileName";
            tsmiCopyFileName.Size   = new Size(233, 22);
            tsmiCopyFileName.Text   = "File name";
            tsmiCopyFileName.Click += tsmiCopyFileName_Click;
            //
            // tsmiCopyFileNameWithExtension
            //
            tsmiCopyFileNameWithExtension.Name   = "tsmiCopyFileNameWithExtension";
            tsmiCopyFileNameWithExtension.Size   = new Size(233, 22);
            tsmiCopyFileNameWithExtension.Text   = "File name with extension";
            tsmiCopyFileNameWithExtension.Click += tsmiCopyFileNameWithExtension_Click;
            //
            // tsmiCopyFolder
            //
            tsmiCopyFolder.Name   = "tsmiCopyFolder";
            tsmiCopyFolder.Size   = new Size(233, 22);
            tsmiCopyFolder.Text   = "Folder";
            tsmiCopyFolder.Click += tsmiCopyFolder_Click;
            //
            // tsmiShow
            //
            tsmiShow.DropDownItems.AddRange(new ToolStripItem[]
            {
                tsmiShowImagePreview,
                tsmiShowMoreInfo
            });
            tsmiShow.Name = "tsmiShow";
            tsmiShow.Size = new Size(127, 22);
            tsmiShow.Text = "Show";
            //
            // tsmiShowImagePreview
            //
            tsmiShowImagePreview.Name   = "tsmiShowImagePreview";
            tsmiShowImagePreview.Size   = new Size(127, 22);
            tsmiShowImagePreview.Text   = "Image preview";
            tsmiShowImagePreview.Click += tsmiShowImagePreview_Click;
            //
            // tsmiShowMoreInfo
            //
            tsmiShowMoreInfo.Name   = "tsmiShowMoreInfo";
            tsmiShowMoreInfo.Size   = new Size(127, 22);
            tsmiShowMoreInfo.Text   = "More info";
            tsmiShowMoreInfo.Click += tsmiShowMoreInfo_Click;

            cmsHistory.ResumeLayout(false);
        }
Example #42
0
        public static ContextMenuStrip Create <TEntry>(TextBox tb, TEntry[] ignoreList, CodeMenuItem[] extraItems) where TEntry : CodeMenuEntry
        {
            ContextMenuStrip cms = new ContextMenuStrip
            {
                Font            = new Font("Lucida Console", 8),
                AutoClose       = false,
                Opacity         = 0.9,
                ShowImageMargin = false
            };

            List <CodeMenuItem> items = new List <CodeMenuItem>();

            if (extraItems != null)
            {
                items.AddRange(extraItems);
            }

            var variables = Helpers.GetValueFields <TEntry>().Where(x => !ignoreList.Contains(x)).
                            Select(x => new CodeMenuItem(x.ToPrefixString(), x.Description, x.Category));

            items.AddRange(variables);

            foreach (var item in items)
            {
                ToolStripMenuItem tsmi = new ToolStripMenuItem {
                    Text = $"{item.Name} - {item.Description}", Tag = item.Name
                };
                tsmi.Click += (sender, e) =>
                {
                    string text = ((ToolStripMenuItem)sender).Tag.ToString();
                    tb.AppendTextToSelection(text);
                };

                if (string.IsNullOrWhiteSpace(item.Category))
                {
                    cms.Items.Add(tsmi);
                }
                else
                {
                    ToolStripMenuItem tsmiParent;
                    int index = cms.Items.IndexOfKey(item.Category);
                    if (index < 0)
                    {
                        tsmiParent = new ToolStripMenuItem {
                            Text = item.Category, Tag = item.Category, Name = item.Category
                        };
                        tsmiParent.HideImageMargin();
                        cms.Items.Add(tsmiParent);
                    }
                    else
                    {
                        tsmiParent = cms.Items[index] as ToolStripMenuItem;
                    }
                    tsmiParent.DropDownItems.Add(tsmi);
                }
            }

            cms.Items.Add(new ToolStripSeparator());

            ToolStripMenuItem tsmiClose = new ToolStripMenuItem(Resources.CodeMenu_Create_Close);

            tsmiClose.Click += (sender, e) => cms.Close();
            cms.Items.Add(tsmiClose);

            tb.MouseDown += (sender, e) =>
            {
                if (cms.Items.Count > 0)
                {
                    cms.Show(tb, new Point(tb.Width + 1, 0));
                }
            };

            tb.GotFocus += (sender, e) =>
            {
                if (cms.Items.Count > 0)
                {
                    cms.Show(tb, new Point(tb.Width + 1, 0));
                }
            };

            tb.LostFocus += (sender, e) =>
            {
                if (cms.Visible)
                {
                    cms.Close();
                }
            };

            tb.KeyDown += (sender, e) =>
            {
                if ((e.KeyCode == Keys.Enter || e.KeyCode == Keys.Escape) && cms.Visible)
                {
                    cms.Close();
                    e.SuppressKeyPress = true;
                }
            };

            tb.Disposed += (sender, e) => cms.Dispose();

            return(cms);
        }
Example #43
0
        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(GameFileAssociationView));

            this.ctrlScreenshotView            = new ScreenshotView();
            this.mnuOptions                    = new ContextMenuStrip(this.components);
            this.copyFileToolStripMenuItem     = new ToolStripMenuItem();
            this.copyAllFilesToolStripMenuItem = new ToolStripMenuItem();
            this.deleteToolStripMenuItem       = new ToolStripMenuItem();
            this.toolStripSeparator1           = new ToolStripSeparator();
            this.addFileToolStripMenuItem      = new ToolStripMenuItem();
            this.openFileToolStripMenuItem     = new ToolStripMenuItem();
            this.toolStripSeparator2           = new ToolStripSeparator();
            this.editDetailsToolStripMenuItem  = new ToolStripMenuItem();
            this.toolStripSeparator3           = new ToolStripSeparator();
            this.moveUpToolStripMenuItem       = new ToolStripMenuItem();
            this.moveDownToolStripMenuItem     = new ToolStripMenuItem();
            this.setFirstToolStripMenuItem     = new ToolStripMenuItem();
            this.tblMain             = new TableLayoutPanelDB();
            this.tabControl          = new TabControl();
            this.tabPageDemos        = new TabPage();
            this.ctrlDemoView        = new GenericFileView();
            this.tabPageSaveGames    = new TabPage();
            this.ctrlSaveGameView    = new GenericFileView();
            this.tabPageStatistics   = new TabPage();
            this.ctrlViewStats       = new StatisticsView();
            this.toolStrip1          = new ToolStrip();
            this.btnCopy             = new ToolStripButton();
            this.btnCopyAll          = new ToolStripButton();
            this.btnDelete           = new ToolStripButton();
            this.toolStripSeparator7 = new ToolStripSeparator();
            this.btnAddFile          = new ToolStripButton();
            this.btnOpenFile         = new ToolStripButton();
            this.toolStripSeparator4 = new ToolStripSeparator();
            this.btnEdit             = new ToolStripButton();
            this.toolStripSeparator5 = new ToolStripSeparator();
            this.btnMoveUp           = new ToolStripButton();
            this.btnMoveDown         = new ToolStripButton();
            this.btnSetFirst         = new ToolStripButton();
            TabPage page = new TabPage();

            page.SuspendLayout();
            this.mnuOptions.SuspendLayout();
            this.tblMain.SuspendLayout();
            this.tabControl.SuspendLayout();
            this.tabPageDemos.SuspendLayout();
            this.tabPageSaveGames.SuspendLayout();
            this.tabPageStatistics.SuspendLayout();
            this.toolStrip1.SuspendLayout();
            base.SuspendLayout();
            page.Controls.Add(this.ctrlScreenshotView);
            page.Location = new Point(4, 0x16);
            page.Name     = "tabPageScreenshots";
            page.Padding  = new Padding(3);
            page.Size     = new Size(0x2aa, 0xce);
            page.TabIndex = 0;
            page.Text     = "Screenshots";
            page.UseVisualStyleBackColor              = true;
            this.ctrlScreenshotView.DataDirectory     = null;
            this.ctrlScreenshotView.DataSourceAdapter = null;
            this.ctrlScreenshotView.Dock              = DockStyle.Fill;
            this.ctrlScreenshotView.FileType          = FileType.Unknown;
            this.ctrlScreenshotView.GameFile          = null;
            this.ctrlScreenshotView.Location          = new Point(3, 3);
            this.ctrlScreenshotView.Name              = "ctrlScreenshotView";
            this.ctrlScreenshotView.Size              = new Size(0x2a4, 200);
            this.ctrlScreenshotView.TabIndex          = 0;
            ToolStripItem[] toolStripItems = new ToolStripItem[] { this.copyFileToolStripMenuItem, this.copyAllFilesToolStripMenuItem, this.deleteToolStripMenuItem, this.toolStripSeparator1, this.addFileToolStripMenuItem, this.openFileToolStripMenuItem, this.toolStripSeparator2, this.editDetailsToolStripMenuItem, this.toolStripSeparator3, this.moveUpToolStripMenuItem, this.moveDownToolStripMenuItem, this.setFirstToolStripMenuItem };
            this.mnuOptions.Items.AddRange(toolStripItems);
            this.mnuOptions.Name = "mnuOptions";
            this.mnuOptions.Size = new Size(0x92, 220);
            this.copyFileToolStripMenuItem.Name       = "copyFileToolStripMenuItem";
            this.copyFileToolStripMenuItem.Size       = new Size(0x91, 0x16);
            this.copyFileToolStripMenuItem.Text       = "Copy File";
            this.copyFileToolStripMenuItem.Click     += new EventHandler(this.copyFileToolStripMenuItem_Click);
            this.copyAllFilesToolStripMenuItem.Name   = "copyAllFilesToolStripMenuItem";
            this.copyAllFilesToolStripMenuItem.Size   = new Size(0x91, 0x16);
            this.copyAllFilesToolStripMenuItem.Text   = "Copy All Files";
            this.copyAllFilesToolStripMenuItem.Click += new EventHandler(this.copyAllFilesToolStripMenuItem_Click);
            this.deleteToolStripMenuItem.Name         = "deleteToolStripMenuItem";
            this.deleteToolStripMenuItem.Size         = new Size(0x91, 0x16);
            this.deleteToolStripMenuItem.Text         = "Delete";
            this.deleteToolStripMenuItem.Click       += new EventHandler(this.deleteToolStripMenuItem_Click);
            this.toolStripSeparator1.Name             = "toolStripSeparator1";
            this.toolStripSeparator1.Size             = new Size(0x8e, 6);
            this.addFileToolStripMenuItem.Name        = "addFileToolStripMenuItem";
            this.addFileToolStripMenuItem.Size        = new Size(0x91, 0x16);
            this.addFileToolStripMenuItem.Text        = "Add File...";
            this.addFileToolStripMenuItem.Click      += new EventHandler(this.addFileToolStripMenuItem_Click);
            this.openFileToolStripMenuItem.Name       = "openFileToolStripMenuItem";
            this.openFileToolStripMenuItem.Size       = new Size(0x91, 0x16);
            this.openFileToolStripMenuItem.Text       = "Open File...";
            this.openFileToolStripMenuItem.Click     += new EventHandler(this.openFileToolStripMenuItem_Click);
            this.toolStripSeparator2.Name             = "toolStripSeparator2";
            this.toolStripSeparator2.Size             = new Size(0x8e, 6);
            this.editDetailsToolStripMenuItem.Name    = "editDetailsToolStripMenuItem";
            this.editDetailsToolStripMenuItem.Size    = new Size(0x91, 0x16);
            this.editDetailsToolStripMenuItem.Text    = "Edit Details...";
            this.editDetailsToolStripMenuItem.Click  += new EventHandler(this.editDetailsToolStripMenuItem_Click);
            this.toolStripSeparator3.Name             = "toolStripSeparator3";
            this.toolStripSeparator3.Size             = new Size(0x8e, 6);
            this.moveUpToolStripMenuItem.Name         = "moveUpToolStripMenuItem";
            this.moveUpToolStripMenuItem.Size         = new Size(0x91, 0x16);
            this.moveUpToolStripMenuItem.Text         = "Move Up";
            this.moveUpToolStripMenuItem.Click       += new EventHandler(this.moveUpToolStripMenuItem_Click);
            this.moveDownToolStripMenuItem.Name       = "moveDownToolStripMenuItem";
            this.moveDownToolStripMenuItem.Size       = new Size(0x91, 0x16);
            this.moveDownToolStripMenuItem.Text       = "Move Down";
            this.moveDownToolStripMenuItem.Click     += new EventHandler(this.moveDownToolStripMenuItem_Click);
            this.setFirstToolStripMenuItem.Name       = "setFirstToolStripMenuItem";
            this.setFirstToolStripMenuItem.Size       = new Size(0x91, 0x16);
            this.setFirstToolStripMenuItem.Text       = "Set First";
            this.setFirstToolStripMenuItem.Click     += new EventHandler(this.setFirstToolStripMenuItem_Click);
            this.tblMain.ColumnCount = 1;
            this.tblMain.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
            this.tblMain.Controls.Add(this.tabControl, 0, 1);
            this.tblMain.Controls.Add(this.toolStrip1, 0, 0);
            this.tblMain.Dock     = DockStyle.Fill;
            this.tblMain.Location = new Point(0, 0);
            this.tblMain.Name     = "tblMain";
            this.tblMain.RowCount = 2;
            this.tblMain.RowStyles.Add(new RowStyle(SizeType.Absolute, 24f));
            this.tblMain.RowStyles.Add(new RowStyle(SizeType.Percent, 100f));
            this.tblMain.Size     = new Size(0x2b8, 0x106);
            this.tblMain.TabIndex = 1;
            this.tabControl.Controls.Add(page);
            this.tabControl.Controls.Add(this.tabPageDemos);
            this.tabControl.Controls.Add(this.tabPageSaveGames);
            this.tabControl.Controls.Add(this.tabPageStatistics);
            this.tabControl.Dock          = DockStyle.Fill;
            this.tabControl.Location      = new Point(3, 0x1b);
            this.tabControl.Name          = "tabControl";
            this.tabControl.SelectedIndex = 0;
            this.tabControl.Size          = new Size(690, 0xe8);
            this.tabControl.TabIndex      = 0;
            this.tabPageDemos.Controls.Add(this.ctrlDemoView);
            this.tabPageDemos.Location = new Point(4, 0x16);
            this.tabPageDemos.Name     = "tabPageDemos";
            this.tabPageDemos.Size     = new Size(0x2aa, 0xce);
            this.tabPageDemos.TabIndex = 1;
            this.tabPageDemos.Text     = "Demos";
            this.tabPageDemos.UseVisualStyleBackColor = true;
            this.ctrlDemoView.DataDirectory           = null;
            this.ctrlDemoView.DataSourceAdapter       = null;
            this.ctrlDemoView.Dock     = DockStyle.Fill;
            this.ctrlDemoView.FileType = FileType.Unknown;
            this.ctrlDemoView.GameFile = null;
            this.ctrlDemoView.Location = new Point(0, 0);
            this.ctrlDemoView.Name     = "ctrlDemoView";
            this.ctrlDemoView.Size     = new Size(0x2aa, 0xce);
            this.ctrlDemoView.TabIndex = 0;
            this.tabPageSaveGames.Controls.Add(this.ctrlSaveGameView);
            this.tabPageSaveGames.Location = new Point(4, 0x16);
            this.tabPageSaveGames.Margin   = new Padding(0);
            this.tabPageSaveGames.Name     = "tabPageSaveGames";
            this.tabPageSaveGames.Size     = new Size(0x2aa, 0xce);
            this.tabPageSaveGames.TabIndex = 2;
            this.tabPageSaveGames.Text     = "Save Games";
            this.tabPageSaveGames.UseVisualStyleBackColor = true;
            this.ctrlSaveGameView.DataDirectory           = null;
            this.ctrlSaveGameView.DataSourceAdapter       = null;
            this.ctrlSaveGameView.Dock     = DockStyle.Fill;
            this.ctrlSaveGameView.FileType = FileType.Unknown;
            this.ctrlSaveGameView.GameFile = null;
            this.ctrlSaveGameView.Location = new Point(0, 0);
            this.ctrlSaveGameView.Name     = "ctrlSaveGameView";
            this.ctrlSaveGameView.Size     = new Size(0x2aa, 0xce);
            this.ctrlSaveGameView.TabIndex = 1;
            this.tabPageStatistics.Controls.Add(this.ctrlViewStats);
            this.tabPageStatistics.Location = new Point(4, 0x16);
            this.tabPageStatistics.Name     = "tabPageStatistics";
            this.tabPageStatistics.Size     = new Size(0x2aa, 0xce);
            this.tabPageStatistics.TabIndex = 3;
            this.tabPageStatistics.Text     = "Statistics";
            this.tabPageStatistics.UseVisualStyleBackColor = true;
            this.ctrlViewStats.DataSourceAdapter           = null;
            this.ctrlViewStats.Dock     = DockStyle.Fill;
            this.ctrlViewStats.GameFile = null;
            this.ctrlViewStats.Location = new Point(0, 0);
            this.ctrlViewStats.Name     = "ctrlViewStats";
            this.ctrlViewStats.Size     = new Size(0x2aa, 0xce);
            this.ctrlViewStats.TabIndex = 0;
            this.toolStrip1.Dock        = DockStyle.None;
            ToolStripItem[] itemArray2 = new ToolStripItem[] { this.btnCopy, this.btnCopyAll, this.btnDelete, this.toolStripSeparator7, this.btnAddFile, this.btnOpenFile, this.toolStripSeparator4, this.btnEdit, this.toolStripSeparator5, this.btnMoveUp, this.btnMoveDown, this.btnSetFirst };
            this.toolStrip1.Items.AddRange(itemArray2);
            this.toolStrip1.Location           = new Point(0, 0);
            this.toolStrip1.Name               = "toolStrip1";
            this.toolStrip1.Size               = new Size(0x10c, 0x18);
            this.toolStrip1.TabIndex           = 1;
            this.toolStrip1.Text               = "toolStrip1";
            this.btnCopy.DisplayStyle          = ToolStripItemDisplayStyle.Image;
            this.btnCopy.Image                 = (Image)manager.GetObject("btnCopy.Image");
            this.btnCopy.ImageTransparentColor = Color.Magenta;
            this.btnCopy.Name                      = "btnCopy";
            this.btnCopy.Size                      = new Size(0x17, 0x15);
            this.btnCopy.Text                      = "Copy to Clipboard";
            this.btnCopy.Click                    += new EventHandler(this.btnCopy_Click);
            this.btnCopyAll.DisplayStyle           = ToolStripItemDisplayStyle.Image;
            this.btnCopyAll.Image                  = (Image)manager.GetObject("btnCopyAll.Image");
            this.btnCopyAll.ImageTransparentColor  = Color.Magenta;
            this.btnCopyAll.Name                   = "btnCopyAll";
            this.btnCopyAll.Size                   = new Size(0x17, 0x15);
            this.btnCopyAll.Text                   = "Copy All to Clipboard";
            this.btnCopyAll.Click                 += new EventHandler(this.btnCopyAll_Click);
            this.btnDelete.DisplayStyle            = ToolStripItemDisplayStyle.Image;
            this.btnDelete.Image                   = (Image)manager.GetObject("btnDelete.Image");
            this.btnDelete.ImageTransparentColor   = Color.Magenta;
            this.btnDelete.Name                    = "btnDelete";
            this.btnDelete.Size                    = new Size(0x17, 0x15);
            this.btnDelete.Text                    = "Delete";
            this.btnDelete.Click                  += new EventHandler(this.btnDelete_Click);
            this.toolStripSeparator7.Name          = "toolStripSeparator7";
            this.toolStripSeparator7.Size          = new Size(6, 0x18);
            this.btnAddFile.DisplayStyle           = ToolStripItemDisplayStyle.Image;
            this.btnAddFile.Image                  = (Image)manager.GetObject("btnAddFile.Image");
            this.btnAddFile.ImageTransparentColor  = Color.Magenta;
            this.btnAddFile.Name                   = "btnAddFile";
            this.btnAddFile.Size                   = new Size(0x17, 0x15);
            this.btnAddFile.Text                   = "Add File";
            this.btnAddFile.Click                 += new EventHandler(this.btnAddFile_Click);
            this.btnOpenFile.DisplayStyle          = ToolStripItemDisplayStyle.Image;
            this.btnOpenFile.Image                 = (Image)manager.GetObject("btnOpenFile.Image");
            this.btnOpenFile.ImageTransparentColor = Color.Magenta;
            this.btnOpenFile.Name                  = "btnOpenFile";
            this.btnOpenFile.Size                  = new Size(0x17, 0x15);
            this.btnOpenFile.Text                  = "Open File";
            this.btnOpenFile.Click                += new EventHandler(this.btnOpenFile_Click);
            this.toolStripSeparator4.Name          = "toolStripSeparator4";
            this.toolStripSeparator4.Size          = new Size(6, 0x18);
            this.btnEdit.DisplayStyle              = ToolStripItemDisplayStyle.Image;
            this.btnEdit.Image                     = (Image)manager.GetObject("btnEdit.Image");
            this.btnEdit.ImageTransparentColor     = Color.Magenta;
            this.btnEdit.Name                      = "btnEdit";
            this.btnEdit.Size                      = new Size(0x17, 0x15);
            this.btnEdit.Text                      = "Edit Details";
            this.btnEdit.Click                    += new EventHandler(this.btnEdit_Click);
            this.toolStripSeparator5.Name          = "toolStripSeparator5";
            this.toolStripSeparator5.Size          = new Size(6, 0x18);
            this.btnMoveUp.DisplayStyle            = ToolStripItemDisplayStyle.Image;
            this.btnMoveUp.Image                   = (Image)manager.GetObject("btnMoveUp.Image");
            this.btnMoveUp.ImageTransparentColor   = Color.Magenta;
            this.btnMoveUp.Name                    = "btnMoveUp";
            this.btnMoveUp.Size                    = new Size(0x17, 0x15);
            this.btnMoveUp.Text                    = "Move Up";
            this.btnMoveUp.Click                  += new EventHandler(this.btnMoveUp_Click);
            this.btnMoveDown.DisplayStyle          = ToolStripItemDisplayStyle.Image;
            this.btnMoveDown.Image                 = (Image)manager.GetObject("btnMoveDown.Image");
            this.btnMoveDown.ImageTransparentColor = Color.Magenta;
            this.btnMoveDown.Name                  = "btnMoveDown";
            this.btnMoveDown.Size                  = new Size(0x17, 0x15);
            this.btnMoveDown.Text                  = "Move Down";
            this.btnMoveDown.Click                += new EventHandler(this.btnMoveDown_Click);
            this.btnSetFirst.DisplayStyle          = ToolStripItemDisplayStyle.Image;
            this.btnSetFirst.Image                 = (Image)manager.GetObject("btnSetFirst.Image");
            this.btnSetFirst.ImageTransparentColor = Color.Magenta;
            this.btnSetFirst.Name                  = "btnSetFirst";
            this.btnSetFirst.Size                  = new Size(0x17, 0x15);
            this.btnSetFirst.Text                  = "Set First";
            this.btnSetFirst.TextAlign             = ContentAlignment.MiddleRight;
            this.btnSetFirst.Click                += new EventHandler(this.btnSetFirst_Click);
            base.AutoScaleDimensions               = new SizeF(6f, 13f);
            base.AutoScaleMode                     = AutoScaleMode.Font;
            base.Controls.Add(this.tblMain);
            base.Name = "GameFileAssociationView";
            base.Size = new Size(0x2b8, 0x106);
            page.ResumeLayout(false);
            this.mnuOptions.ResumeLayout(false);
            this.tblMain.ResumeLayout(false);
            this.tblMain.PerformLayout();
            this.tabControl.ResumeLayout(false);
            this.tabPageDemos.ResumeLayout(false);
            this.tabPageSaveGames.ResumeLayout(false);
            this.tabPageStatistics.ResumeLayout(false);
            this.toolStrip1.ResumeLayout(false);
            this.toolStrip1.PerformLayout();
            base.ResumeLayout(false);
        }
Example #44
0
 public void SetContextMenu(ContextMenuStrip menuStrip)
 {
     this.ContextMenuStrip = menuStrip;
 }
Example #45
0
        public void ContextMenuStrip_ClickOnCalculateAllItem_ScheduleAllCalculationsAndNotifyObservers()
        {
            // Setup
            const string locationName1 = "1";
            const string locationName2 = "2";

            using (var treeViewControl = new TreeViewControl())
            {
                var duneLocationCalculationsForTargetProbability = new DuneLocationCalculationsForTargetProbability(0.01)
                {
                    DuneLocationCalculations =
                    {
                        new DuneLocationCalculation(new DuneLocation(1300001, locationName1, new Point2D(0, 0), new DuneLocation.ConstructionProperties
                        {
                            CoastalAreaId = 0,
                            Offset        = 0,
                            Orientation   = 0,
                            D50           = 0.000007
                        })),
                        new DuneLocationCalculation(new DuneLocation(1300002, locationName2, new Point2D(0, 0), new DuneLocation.ConstructionProperties
                        {
                            CoastalAreaId = 0,
                            Offset        = 0,
                            Orientation   = 0,
                            D50           = 0.000007
                        }))
                    }
                };

                var failureMechanism = new DuneErosionFailureMechanism();
                failureMechanism.DuneLocationCalculationsForUserDefinedTargetProbabilities.Add(duneLocationCalculationsForTargetProbability);

                var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
                {
                    FilePath = validFilePath
                };
                HydraulicBoundaryDatabaseTestHelper.SetHydraulicBoundaryLocationConfigurationSettings(hydraulicBoundaryDatabase);

                var assessmentSection = mocks.Stub <IAssessmentSection>();
                assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase);
                assessmentSection.Stub(a => a.Id).Return("13-1");
                assessmentSection.Stub(a => a.GetFailureMechanisms()).Return(new[]
                {
                    failureMechanism
                });
                assessmentSection.Stub(a => a.FailureMechanismContribution)
                .Return(FailureMechanismContributionTestFactory.CreateFailureMechanismContribution());

                var context = new DuneLocationCalculationsForUserDefinedTargetProbabilityContext(duneLocationCalculationsForTargetProbability,
                                                                                                 failureMechanism,
                                                                                                 assessmentSection);

                var builder = new CustomItemsOnlyContextMenuBuilder();

                IMainWindow mainWindow = MainWindowTestHelper.CreateMainWindowStub(mocks);

                var gui = mocks.Stub <IGui>();
                gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(builder);
                gui.Stub(g => g.MainWindow).Return(mainWindow);
                gui.Stub(g => g.ViewHost).Return(mocks.Stub <IViewHost>());
                var calculationObserver = mocks.StrictMock <IObserver>();
                calculationObserver.Expect(o => o.UpdateObserver()).Repeat.Times(2);
                var calculationsObserver = mocks.StrictMock <IObserver>();

                var calculatorFactory = mocks.Stub <IHydraRingCalculatorFactory>();
                calculatorFactory.Expect(cf => cf.CreateDunesBoundaryConditionsCalculator(null))
                .IgnoreArguments()
                .Return(new TestDunesBoundaryConditionsCalculator())
                .Repeat
                .Times(2);
                mocks.ReplayAll();

                duneLocationCalculationsForTargetProbability.DuneLocationCalculations.Attach(calculationsObserver);
                duneLocationCalculationsForTargetProbability.DuneLocationCalculations.ForEachElementDo(location => location.Attach(calculationObserver));

                plugin.Gui = gui;
                plugin.Activate();

                using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl))
                    using (new HydraRingCalculatorFactoryConfig(calculatorFactory))
                    {
                        // Call
                        TestHelper.AssertLogMessages(() => contextMenu.Items[contextMenuCalculateAllIndex].PerformClick(), messages =>
                        {
                            List <string> messageList = messages.ToList();

                            // Assert
                            Assert.AreEqual(16, messageList.Count);
                            Assert.AreEqual($"Hydraulische belastingen berekenen voor locatie '{locationName1}' (1/100) is gestart.", messageList[0]);
                            CalculationServiceTestHelper.AssertValidationStartMessage(messageList[1]);
                            CalculationServiceTestHelper.AssertValidationEndMessage(messageList[2]);
                            CalculationServiceTestHelper.AssertCalculationStartMessage(messageList[3]);
                            Assert.AreEqual($"Hydraulische belastingenberekening voor locatie '{locationName1}' (1/100) is niet geconvergeerd.", messageList[4]);
                            StringAssert.StartsWith("Hydraulische belastingenberekening is uitgevoerd op de tijdelijke locatie", messageList[5]);
                            CalculationServiceTestHelper.AssertCalculationEndMessage(messageList[6]);
                            Assert.AreEqual($"Hydraulische belastingen berekenen voor locatie '{locationName1}' (1/100) is gelukt.", messageList[7]);

                            Assert.AreEqual($"Hydraulische belastingen berekenen voor locatie '{locationName2}' (1/100) is gestart.", messageList[8]);
                            CalculationServiceTestHelper.AssertValidationStartMessage(messageList[9]);
                            CalculationServiceTestHelper.AssertValidationEndMessage(messageList[10]);
                            CalculationServiceTestHelper.AssertCalculationStartMessage(messageList[11]);
                            Assert.AreEqual($"Hydraulische belastingenberekening voor locatie '{locationName2}' (1/100) is niet geconvergeerd.", messageList[12]);
                            StringAssert.StartsWith("Hydraulische belastingenberekening is uitgevoerd op de tijdelijke locatie", messageList[13]);
                            CalculationServiceTestHelper.AssertCalculationEndMessage(messageList[14]);
                            Assert.AreEqual($"Hydraulische belastingen berekenen voor locatie '{locationName2}' (1/100) is gelukt.", messageList[15]);
                        });
                    }
            }
        }
Example #46
0
    void PrepareContextMenu()
    {
        // Create the context menu and it's items
        _contextMenu = new ContextMenuStrip();
        _showAbout = new ToolStripMenuItem();
        _exitApp = new ToolStripMenuItem();
        _openFirewall = new ToolStripMenuItem();
        _runOnStartup = new ToolStripMenuItem();
        _settingsItem = new ToolStripMenuItem();
        _checkForUpdatesItem = new ToolStripMenuItem();

        // Attach the menu to the notify icon
        _notifyIcon.ContextMenuStrip = _contextMenu;

        // Setup the items and add them to the menu strip, adding handlers to be created later
        _showAbout.Text = "About";
        _showAbout.Click += new EventHandler(mDisplayForm_Click);
        _contextMenu.Items.Add(_showAbout);

        _settingsItem.Text = "Settings";
        _settingsItem.Click += new EventHandler(mSettings_Click);
        _contextMenu.Items.Add(_settingsItem);

        _checkForUpdatesItem.Text = "Check for updates";
        _checkForUpdatesItem.Click += new EventHandler(mCheckForUpdates_Click);
        _contextMenu.Items.Add(_checkForUpdatesItem);

        _exitApp.Text = "Exit";
        _exitApp.Click += new EventHandler(mExitApplication_Click);
        _contextMenu.Items.Add(_exitApp);
    }
Example #47
0
        public void PerformDuneLocationCalculationsFromContextMenu_HydraulicBoundaryDatabaseWithUsePreprocessorFalse_SendsRightInputToCalculationService()
        {
            // Setup
            var duneLocationCalculationsForTargetProbability = new DuneLocationCalculationsForTargetProbability(0.01)
            {
                DuneLocationCalculations =
                {
                    new DuneLocationCalculation(new DuneLocation(1300001, "A", new Point2D(0, 0), new DuneLocation.ConstructionProperties
                    {
                        CoastalAreaId = 0,
                        Offset        = 0,
                        Orientation   = 0,
                        D50           = 0.000007
                    }))
                }
            };

            var failureMechanism = new DuneErosionFailureMechanism();

            failureMechanism.DuneLocationCalculationsForUserDefinedTargetProbabilities.Add(duneLocationCalculationsForTargetProbability);

            var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
            {
                FilePath = validFilePath,
                HydraulicLocationConfigurationSettings =
                {
                    CanUsePreprocessor    = true,
                    UsePreprocessor       = false,
                    PreprocessorDirectory = "InvalidPreprocessorDirectory"
                }
            };

            HydraulicBoundaryDatabaseTestHelper.SetHydraulicBoundaryLocationConfigurationSettings(hydraulicBoundaryDatabase);

            var assessmentSection = mocks.Stub <IAssessmentSection>();

            assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase);
            assessmentSection.Stub(a => a.Id).Return("13-1");
            assessmentSection.Stub(a => a.GetFailureMechanisms()).Return(new[]
            {
                failureMechanism
            });
            assessmentSection.Stub(a => a.FailureMechanismContribution)
            .Return(FailureMechanismContributionTestFactory.CreateFailureMechanismContribution());

            var context = new DuneLocationCalculationsForUserDefinedTargetProbabilityContext(duneLocationCalculationsForTargetProbability,
                                                                                             failureMechanism,
                                                                                             assessmentSection);

            using (var treeViewControl = new TreeViewControl())
            {
                IMainWindow mainWindow = MainWindowTestHelper.CreateMainWindowStub(mocks);

                var gui = mocks.Stub <IGui>();
                gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder());
                gui.Stub(g => g.MainWindow).Return(mainWindow);
                gui.Stub(g => g.ViewHost).Return(mocks.Stub <IViewHost>());

                var dunesBoundaryConditionsCalculator = new TestDunesBoundaryConditionsCalculator();
                var calculatorFactory = mocks.Stub <IHydraRingCalculatorFactory>();
                calculatorFactory.Expect(cf => cf.CreateDunesBoundaryConditionsCalculator(Arg <HydraRingCalculationSettings> .Is.NotNull))
                .WhenCalled(invocation =>
                {
                    HydraRingCalculationSettingsTestHelper.AssertHydraRingCalculationSettings(
                        HydraulicBoundaryCalculationSettingsFactory.CreateSettings(hydraulicBoundaryDatabase),
                        (HydraRingCalculationSettings)invocation.Arguments[0]);
                })
                .Return(dunesBoundaryConditionsCalculator);

                mocks.ReplayAll();

                plugin.Gui = gui;
                plugin.Activate();

                using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl))
                    using (new HydraRingCalculatorFactoryConfig(calculatorFactory))
                    {
                        // Call
                        contextMenu.Items[contextMenuCalculateAllIndex].PerformClick();

                        // Assert
                        DunesBoundaryConditionsCalculationInput dunesBoundaryConditionsCalculationInput = dunesBoundaryConditionsCalculator.ReceivedInputs.First();

                        Assert.AreEqual(duneLocationCalculationsForTargetProbability.DuneLocationCalculations[0].DuneLocation.Id,
                                        dunesBoundaryConditionsCalculationInput.HydraulicBoundaryLocationId);
                        Assert.AreEqual(StatisticsConverter.ProbabilityToReliability(duneLocationCalculationsForTargetProbability.TargetProbability),
                                        dunesBoundaryConditionsCalculationInput.Beta);
                    }
            }
        }
Example #48
0
 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();
 }
Example #49
0
        private void m_pFilters_MouseUp(object sender, MouseEventArgs e)
        {
            // We want right click only.
            if (e.Button != MouseButtons.Right)
            {
                return;
            }

            ContextMenuStrip menu = new ContextMenuStrip();

            menu.ItemClicked += new ToolStripItemClickedEventHandler(m_pFilters_ContextMenuItem_Clicked);
            //--- MenuItem Add
            ToolStripMenuItem menuItem_Add = new ToolStripMenuItem("Add");

            menuItem_Add.Image = ResManager.GetIcon("add.ico").ToBitmap();
            menuItem_Add.Tag   = "add";
            menu.Items.Add(menuItem_Add);
            //--- MenuItem Edit
            ToolStripMenuItem menuItem_Edit = new ToolStripMenuItem("Edit");

            menuItem_Edit.Enabled = m_pFilters.SelectedItems.Count > 0;
            menuItem_Edit.Tag     = "edit";
            menuItem_Edit.Image   = ResManager.GetIcon("edit.ico").ToBitmap();
            menu.Items.Add(menuItem_Edit);
            //--- MenuItem Delete
            ToolStripMenuItem menuItem_Delete = new ToolStripMenuItem("Delete");

            menuItem_Delete.Enabled = m_pFilters.SelectedItems.Count > 0;
            menuItem_Delete.Tag     = "delete";
            menuItem_Delete.Image   = ResManager.GetIcon("delete.ico").ToBitmap();
            menu.Items.Add(menuItem_Delete);
            //--- Separator
            menu.Items.Add(new ToolStripSeparator());
            //--- MenuItem Refresh
            ToolStripMenuItem menuItem_Refresh = new ToolStripMenuItem("Refresh");

            menuItem_Refresh.Image = ResManager.GetIcon("refresh.ico").ToBitmap();
            menuItem_Refresh.Tag   = "refresh";
            menu.Items.Add(menuItem_Refresh);
            //--- Separator
            menu.Items.Add(new ToolStripSeparator());
            //--- MenuItem Up
            ToolStripMenuItem menuItem_Up = new ToolStripMenuItem("Move Up");

            if (!(m_pFilters.SelectedItems.Count > 0 && m_pFilters.SelectedItems[0].Index > 0))
            {
                menuItem_Up.Enabled = false;
            }
            menuItem_Up.Image = ResManager.GetIcon("up.ico").ToBitmap();
            menuItem_Up.Tag   = "up";
            menu.Items.Add(menuItem_Up);
            //--- MenuItem Down
            ToolStripMenuItem menuItem_Down = new ToolStripMenuItem("Move Down");

            if (!(m_pFilters.SelectedItems.Count > 0 && m_pFilters.SelectedItems[0].Index < (m_pFilters.Items.Count - 1)))
            {
                menuItem_Down.Enabled = false;
            }
            menuItem_Down.Image = ResManager.GetIcon("down.ico").ToBitmap();
            menuItem_Down.Tag   = "down";
            menu.Items.Add(menuItem_Down);
            //---
            menu.Show(Control.MousePosition);
        }
 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);
 }
Example #51
0
        void setupNotificationsPopup()
        {
            commentsMenuItem = new ToolStripMenuItem
            {
                Image = Resources.IconComments
            };
            itemsSeparator = new ToolStripSeparator();
            itemsMenuItem  = new ToolStripMenuItem
            {
                Image = Resources.IconItems
            };
            invitesSeparator = new ToolStripSeparator();
            invitesMenuItem  = new ToolStripMenuItem
            {
                Image = Resources.IconInvites
            };
            giftsSeparator = new ToolStripSeparator();
            giftsMenuItem  = new ToolStripMenuItem
            {
                Image = Resources.IconGifts
            };
            offlineMessagesSeparator = new ToolStripSeparator();
            offlineMessagesMenuItem  = new ToolStripMenuItem
            {
                Image = Resources.IconOfflineMessages,
            };
            tradeOffersSeparator = new ToolStripSeparator();
            tradeOffersMenuItem  = new ToolStripMenuItem
            {
                Image = Resources.IconTradeOffers,
            };
            asyncGameMenuSeparator = new ToolStripSeparator();
            asyncGameMenuItem      = new ToolStripMenuItem
            {
                Image = Resources.IconAsyncGames,
            };
            moderatorMessageSeparator = new ToolStripSeparator();
            moderatorMessageMenuItem  = new ToolStripMenuItem
            {
                Image = Resources.IconModeratorMessages,
            };
            helpRequestReplySeparator = new ToolStripSeparator();
            helpRequestReplyMenuItem  = new ToolStripMenuItem
            {
                Image = Resources.IconModeratorMessages,
            };
            accountAlertReplySeparator = new ToolStripSeparator();
            accountAlertReplyMenuItem  = new ToolStripMenuItem
            {
                Image = Resources.IconAccountAlerts,
            };
            renderer = new NotificationsMenuRenderer();
            notificationsContextMenu          = new ContextMenuStrip();
            notificationsContextMenu.Renderer = renderer;
            notificationsContextMenu.Items.AddRange(new ToolStripItem[] {
                commentsMenuItem,
                itemsSeparator,
                itemsMenuItem,
                invitesSeparator,
                invitesMenuItem,
                giftsSeparator,
                giftsMenuItem,
                offlineMessagesSeparator,
                offlineMessagesMenuItem,
                tradeOffersSeparator,
                tradeOffersMenuItem,
                asyncGameMenuSeparator,
                asyncGameMenuItem,
                moderatorMessageSeparator,
                moderatorMessageMenuItem,
                helpRequestReplySeparator,
                helpRequestReplyMenuItem,
                accountAlertReplySeparator,
                accountAlertReplyMenuItem,
            });

            updatePopupColors();
            updatePopupCounts(new NotificationCounts());

            commentsMenuItem.Click          += commentsMenuItem_Click;
            itemsMenuItem.Click             += itemsMenuItem_Click;
            invitesMenuItem.Click           += invitesMenuItem_Click;
            giftsMenuItem.Click             += giftsMenuItem_Click;
            offlineMessagesMenuItem.Click   += offlineMessagesMenuItem_Click;
            tradeOffersMenuItem.Click       += tradeOffersMenuItem_Click;
            asyncGameMenuItem.Click         += asyncGameMenuItem_Click;
            moderatorMessageMenuItem.Click  += moderatorMessageMenuItem_Click;
            helpRequestReplyMenuItem.Click  += helpRequestReplyMenuItem_Click;
            accountAlertReplyMenuItem.Click += accountAlertReplyMenuItem_Click;
        }
        /// <summary>
        /// Enable Zoom and Pan Controls.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="selectionChanged">Selection changed callabck. Triggered when user select a point with selec tool.</param>
        /// <param name="cursorMoved">Cursor moved callabck. Triggered when user move the mouse in chart area.</param>
        /// <param name="zoomChanged">Callback triggered when chart has 
        /// zoomed in or out (and on first painting of the chart).</param>
        /// <remarks>Callback are optional (pass in null to ignore).</remarks>
        public static void EnableZoomAndPanControls(this Chart sender,
            CursorPositionChanged selectionChanged,
            CursorPositionChanged cursorMoved,
            ZoomChanged zoomChanged = null)
        {
            if (!ChartTool.ContainsKey(sender))
            {
                ChartTool[sender] = new ChartData(sender);
                ChartData ptrChartData = ChartTool[sender];
                ptrChartData.Backup();
                ptrChartData.SelectionChangedCallback = selectionChanged;
                ptrChartData.CursorMovedCallback = cursorMoved;
                ptrChartData.ZoomChangedCallback = zoomChanged;

                //Populate Context menu
                Chart ptrChart = sender;
                if (ptrChart.ContextMenuStrip == null)
                {
                    //Context menu is empty, use ChartContextMenuStrip directly
                    ptrChart.ContextMenuStrip = new ContextMenuStrip();
                    ptrChart.ContextMenuStrip.Items.AddRange(ChartTool[ptrChart].MenuItems.ToArray());
                }
                else
                {
                    //User assigned context menu to chart. Merge current menu with ChartContextMenuStrip.
                    ContextMenuStrip newMenu = new ContextMenuStrip();
                    newMenu.Items.AddRange(ChartTool[sender].MenuItems.ToArray());

                    foreach (object ptrItem in ChartTool[sender].ContextMenuStrip.Items)
                    {
                        if (ptrItem is ToolStripMenuItem) newMenu.Items.Add(((ToolStripMenuItem)ptrItem).Clone());
                        else if (ptrItem is ToolStripSeparator) newMenu.Items.Add(new ToolStripSeparator());
                    }
                    newMenu.Items.Add(new ToolStripSeparator());
                    ptrChart.ContextMenuStrip = newMenu;
                    ptrChart.ContextMenuStrip.AddHandlers(ChartTool[sender].ContextMenuStrip);
                }
                ptrChart.ContextMenuStrip.Opening += ChartContext_Opening;
                ptrChart.ContextMenuStrip.ItemClicked += ChartContext_ItemClicked;
                ptrChart.MouseDown += ChartControl_MouseDown;
                ptrChart.MouseMove += ChartControl_MouseMove;
                ptrChart.MouseUp += ChartControl_MouseUp;
                ptrChart.PostPaint += ChartOnPostPaint; // Necessary to kickstart ZoomChanged callback

                // The following is for testing out the built-in events.
                //  They don't seem to be as reliable as just handling mouse up/move/down
                //ptrChart.CursorPositionChanging += (sender1, e) =>
                //    {
                //        // Changed event isn't triggered with any zoom or select operations! From looking at the Cursor.cs code, it seems to be a bug.
                //        // Changing event is raised twice, once for each cursor (X, Y)
                //        var axis = e.Axis;
                //    };
                //ptrChart.SelectionRangeChanging += (o, args) =>
                //    {
                //        // Changed event isn't triggered with any zoom or select operations!
                //        // Neither is changed event... odd
                //        Console.WriteLine("SelectionRangeChanging raised " + args.ToString());
                //        var axis = args.Axis;
                //        var chartArea = args.ChartArea;
                //    };

                //Override settings.
                ChartArea ptrChartArea = ptrChart.ChartAreas[0];
                ptrChartArea.CursorX.AutoScroll = false;
                ptrChartArea.CursorX.Interval = 1e-06;
                ptrChartArea.CursorY.AutoScroll = false;
                ptrChartArea.CursorY.Interval = 1e-06;

                ptrChartArea.AxisX.ScrollBar.Enabled = false;
                ptrChartArea.AxisX2.ScrollBar.Enabled = false;
                ptrChartArea.AxisY.ScrollBar.Enabled = false;
                ptrChartArea.AxisY2.ScrollBar.Enabled = false;

                SetChartControlState(sender, MSChartExtensionToolState.Select);
            }
        }
Example #53
0
        /// <summary>
        /// 初始化报表菜单
        /// </summary>
        private void CreateMenu()
        {
            //初始化报表类型
            conn.Open();
            dtReport = new DataTable();
            dtReport.Load(new SqlCommand("SELECT * FROM sysReport WHERE ReportGUID='" + rpGUID + "' ORDER BY ReportName", conn).ExecuteReader());
            tsmChooseDetail = new ToolStripMenuItem[dtReport.Rows.Count];
            for (int i = 0; i < dtReport.Rows.Count; i++)
            {
                if (Convert.ToBoolean(dtReport.Rows[i]["IsDefault"]))
                {
                    tsmChooseDetail.SetValue(new ToolStripMenuItem(dtReport.Rows[i]["ReportName"].ToString() + "(默认)"),i);
                    tsmChooseDetail[i].Name = dtReport.Rows[i]["ID"].ToString();
                    tsmChooseDetail[i].Checked = true;
                    iDefaultChecked = i;
                    iOldID = i;
                    bt = (byte[])dtReport.Rows[i]["Report"];
                }
                else
                {
                    tsmChooseDetail.SetValue(new ToolStripMenuItem(dtReport.Rows[i]["ReportName"].ToString()), i);
                    tsmChooseDetail[i].Name = dtReport.Rows[i]["ID"].ToString();

                }
            }
            conn.Close();
            menubtnPrint = new ContextMenuStrip();
            tsmPrintReport = new ToolStripMenuItem("打印");
            tsmChooseReport = new ToolStripMenuItem("选择报表");
            tsmDesginReport = new ToolStripMenuItem("设计报表");
            tsmAddReport = new ToolStripMenuItem("新增报表");
            tsmPreviewReport = new ToolStripMenuItem("打印预览");
            ToolStripSeparator tss1 = new ToolStripSeparator();
            ToolStripSeparator tss2 = new ToolStripSeparator();
            tsmChooseReport.DropDownItems.AddRange(tsmChooseDetail);
            menubtnPrint.Items.Add(tsmPrintReport);
            menubtnPrint.Items.Add(tss1);
            menubtnPrint.Items.Add(tsmChooseReport);
            //权限控制,只有管理员才拥有设计报表和新增报表权限
            if (sAuth == "admin")
            {
                menubtnPrint.Items.Add(tsmDesginReport);
                menubtnPrint.Items.Add(tsmAddReport);
            }
            menubtnPrint.Items.Add(tss2);
            menubtnPrint.Items.Add(tsmPreviewReport);
            //代理打印预览事件
            tsmPreviewReport.Click += new EventHandler(tsmPreviewReport_Click);
            //代理报表设计事件
            tsmDesginReport.Click += new EventHandler(tsmDesginReport_Click);
            //代理选择报表事件
            tsmChooseReport.DropDown.ItemClicked += new ToolStripItemClickedEventHandler(DropDown_ItemClicked);
            //代理打印事件
            tsmPrintReport.Click += new EventHandler(tsmPrintReport_Click);
            //代理新增事件
            tsmAddReport.Click += new EventHandler(tsmAddReport_Click);
        }