Exemple #1
0
        public static NeuralNetwork<Matrix> Create(IDataSet<Matrix, Vector> dataSet)
        {
            var count  = 5;

            var a = new ISingleLayer<Matrix, Matrix>[count];
            for (var i = 0; i < count; ++i)
                a[i] = new MatrixConvolutor(28, 28, 24, 24, new Tanh());

            var b = new ISingleLayer<Matrix, Matrix>[count];
            for (var i = 0; i < count; ++i)
                b[i] = new MatrixSubsampler(24, 24, 12, 12, new Tanh());

            var c = new ISingleLayer<Matrix, Matrix>[count];
            for (var i = 0; i < count; ++i)
                c[i] = new MatrixConvolutor(12, 12, 8, 8, new Tanh());

            var d = new ISingleLayer<Matrix, Matrix>[count];
            for (var i = 0; i < count; ++i)
                d[i] = new MatrixSubsampler(8, 8, 4, 4, new Tanh());

            var splitter    = new Splitter<Matrix, Matrix>(a);
            var applicator1 = new Applicator<Matrix, Matrix>(b);
            var applicator2 = new Applicator<Matrix, Matrix>(c);
            var merger      = new MatrixMerger<Matrix>(d);

            var classif  = new FullyConnectedLayer(16 * count, 10, new Tanh());

            var comp = CompositeLayer<Vector, Vector[], Vector>.Compose(splitter,
                                                                        applicator1,
                                                                        applicator2,
                                                                        merger,
                                                                        classif);

            return new NeuralNetwork<Matrix>(comp);
        }
Exemple #2
0
	public MainForm ()
	{
		// 
		// _splitter
		// 
		_splitter = new Splitter ();
		_splitter.BorderStyle = BorderStyle.FixedSingle;
		_splitter.Dock = DockStyle.Bottom;
		Controls.Add (_splitter);
		// 
		// _panel
		// 
		_panel = new Panel ();
		_panel.Dock = DockStyle.Bottom;
		_panel.Height = 75;
		_panel.BackColor = SystemColors.Control;
		Controls.Add (_panel);
		// 
		// _label
		// 
		_label = new Label ();
		_label.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom;
		_label.Height = 75;
		_label.Width = _panel.Width - 4;
		_panel.Controls.Add (_label);
		// 
		// MainForm
		// 
		BackColor = Color.White;
		ClientSize = new Size (300, 150);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #338966";
		Load += new EventHandler (MainForm_Load);
	}
 /// <summary>
 /// Initializes a new instance of the <see cref="MainForm"/> class.
 /// </summary>
 public MainForm()
 {
     this.InitializeComponent();
     this.splitter = new Splitter();
     this.splitter.FileProcessedEvent += new FileProcessedHandler(this.Splitter_FileProcessedEvent);
     this.splitter.FileWrittenEvent += new FileWrittenHandler(this.Splitter_FileWrittenEvent);
     this.splitter.FileCompleteEvent += new FileCompleteHandler(this.Splitter_FileCompleteEvent);
 }
        public SplitterPaneFactory(Splitter container, ViewContext viewContext)
        {
            Guard.IsNotNull(container, "container");
            Guard.IsNotNull(viewContext, "viewContext");

            this.container = container;
            this.viewContext = viewContext;
        }
    bool state = false; // Splitter 이벤트 상태

    #endregion Fields

    #region Constructors

    public SplitterExam()
    {
        split = new Splitter();
        split.Parent = this;
        split.Dock = DockStyle.Left;
        split.LocationChanged += new EventHandler(split_Resize);

        panel = new Panel();
        panel.Parent = this;
        panel.Dock = DockStyle.Left;
        panel.BackColor = Color.Red;

        this.BackColor = Color.Blue;
    }
Exemple #6
0
        public SplitterTest ()
        {
		DockStyle teststyle;

		treeView1 = new TreeView ();
		label = new Label ();
		label2 = new Label ();

		teststyle = DockStyle.Left;

                splitter = new Splitter ();
                splitter.Dock = teststyle;
                splitter.MinExtra = 0;
                splitter.MinSize = 0;
		splitter.BorderStyle = BorderStyle.Fixed3D;
		splitter.BackColor = Color.Red;
		splitter.SplitterMoving += new SplitterEventHandler(splithandler);
		splitter.SplitterMoved += new SplitterEventHandler(splittermoved);
		splitter.MouseUp += new MouseEventHandler(mouseup);

                treeView1.Dock = teststyle;
		treeView1.BorderStyle = BorderStyle.Fixed3D;
                label.Dock = teststyle;
                treeView1.Nodes.Add ("TreeView Node");
                label.Text = "Click to trigger resize of TreeView Node";
		label.Click += new EventHandler(clickhandler);

                label2.Dock = DockStyle.Fill;
		label2.Text = "Filler";

                Controls.AddRange (new Control [] { label2, label, splitter, treeView1});

		this.ClientSize = new Size(500, 500);
		this.CreateControl();

		#if not
                Console.WriteLine ("treeview right:   " + treeView1.Right + "Width: " + treeView1.Width);
                Console.WriteLine ("splitter right:   " + splitter.Right + "Width: " + splitter.Width);
                Console.WriteLine ("listView left:    " + label.Left + "Width: " + label.Width);
                Console.WriteLine ("filler left:    " + label2.Left + "Width: " + label2.Width);

		Console.WriteLine("treeView child index: {0}", Controls.GetChildIndex(treeView1));
		Console.WriteLine("Splitter child index: {0}", Controls.GetChildIndex(splitter));
		Console.WriteLine("ListView child index: {0}", Controls.GetChildIndex(label));
		Console.WriteLine("filler child index: {0}", Controls.GetChildIndex(label2));
		#endif

	}
 /// <summary>
 /// Initializes a new instance of the ExtraTreeRegressor class.
 /// </summary>
 /// <param name="criterion"> The function to measure the quality of a split. The only supported
 /// criterion is <see cref="Criterion.Mse"/> for the mean squared error.</param>
 /// <param name="splitter">The strategy used to choose the split at each node. Supported
 /// strategies are <see cref="Splitter.Best"/> to choose the best split and <see cref="Splitter.Random"/> to choose
 /// the best random split.</param>
 /// <param name="maxDepth">The maximum depth of the tree. If <c>null</c>, then nodes are expanded until
 /// all leaves are pure or until all leaves contain less than
 /// <paramref name="minSamplesSplit"/> samples.</param>
 /// <param name="minSamplesSplit">The minimum number of samples required to split an internal node.</param>
 /// <param name="minSamplesLeaf">The minimum number of samples required to be at a leaf node.</param>
 /// <param name="maxFeatures">Number of features to consider when looking for the best split. If null - 
 /// then all features will be considered.</param>
 /// <param name="random">random number generator</param>
 public ExtraTreeRegressor(
     Criterion criterion = Criterion.Mse,
     Splitter splitter = Splitter.Random,
     int? maxDepth = null,
     int minSamplesSplit = 2,
     int minSamplesLeaf = 1,
     MaxFeaturesChoice maxFeatures = null,
     Random random = null) : base(criterion,
                                  splitter,
                                  maxDepth,
                                  minSamplesSplit,
                                  minSamplesLeaf,
                                  maxFeatures ?? MaxFeaturesChoice.Auto(),
                                  random)
 {
 }
        public static Splitter CreateSplitter()
        {
            Mock<HttpContextBase> httpContext = TestHelper.CreateMockedHttpContext();

            httpContext.Setup(c => c.Request.Browser.CreateHtmlTextWriter(It.IsAny<TextWriter>())).Returns(new HtmlTextWriter(TextWriter.Null));

            Mock<IClientSideObjectWriterFactory> clientSideObjectWriterFactory = new Mock<IClientSideObjectWriterFactory>();
            clientSideObjectWriter = new Mock<IClientSideObjectWriter>();

            viewContext = TestHelper.CreateViewContext();

            clientSideObjectWriterFactory.Setup(c => c.Create(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<TextWriter>())).Returns(clientSideObjectWriter.Object);

            Splitter splitter = new Splitter(viewContext, clientSideObjectWriterFactory.Object);

            return splitter;
        }
Exemple #9
0
    public ExplorerLike()
    {
        BackColor = SystemColors.Window;
        ForeColor = SystemColors.WindowText;

        filelist = new FileListView();
        filelist.Parent = this;
        filelist.Dock = DockStyle.Fill;

        Splitter split = new Splitter();
        split.Parent = this;
        split.Dock = DockStyle.Left;
        split.BackColor = SystemColors.Control;

        Menu = new MainMenu();
        Menu.MenuItems.Add("&View");

        string[] astrView = { "Lar&ge Icons", "S&mall Icons",
                                "&List", "&Details" };
        View[] aview = { View.LargeIcon, View.SmallIcon,
                           View.List, View.Details };
        EventHandler eh = new EventHandler(MenuOnView);

        for (int i = 0; i < 4; i++) {
            MenuItemView miv = new MenuItemView();
            miv.Text = astrView[i];
            miv.View = aview[i];
            miv.RadioCheck = true;
            miv.Click += eh;

            if (i == 3)         // Default == View.Details
               {
                mivChecked = miv;
                mivChecked.Checked = true;
                filelist.View = mivChecked.View;
            }
            Menu.MenuItems[0].MenuItems.Add(miv);
        }
        Menu.MenuItems[0].MenuItems.Add("-");

        MenuItem mi = new MenuItem("&Refresh",
                            new EventHandler(MenuOnRefresh), Shortcut.F5);
        Menu.MenuItems[0].MenuItems.Add(mi);
    }
Exemple #10
0
        private NProf()
        {
            WindowState = FormWindowState.Maximized;
            Icon        = new Icon(this.GetType().Assembly.GetManifestResourceStream("NProf.Resources.app-icon.ico"));
            Text        = Title;
            profiler    = new Profiler();

            Menu = new MainMenu(new MenuItem[] {
                new MenuItem(
                    "File",
                    new MenuItem[] {
                    new MenuItem("E&xit", delegate { Close(); })
                })
            });

            Splitter methodSplitter = new Splitter();

            methodSplitter.Dock = DockStyle.Bottom;

            Splitter leftSplitter = new Splitter();

            leftSplitter.Dock = DockStyle.Bottom;


            mainPanel.AutoSize = true;
            application        = new TextBox();
            application.Width  = 200;
            application.Dock   = DockStyle.Fill;
            arguments          = new TextBox();
            arguments.Width    = 200;
            directory          = new TextBox();
            start        = new Button();
            start.Text   = "";
            start.Click += delegate
            {
                StartRun();
            };
            start.Text   = "Start";
            start.Anchor = AnchorStyles.Right;
            start.Height = application.Height;
            start.BackgroundImageLayout = ImageLayout.Zoom;
            directory.Width             = 200;
            start.Width             = start.PreferredSize.Width;
            mainPanel.Height        = 100;
            mainPanel.AutoSize      = true;
            mainPanel.Dock          = DockStyle.Top;
            start.TextImageRelation = TextImageRelation.TextAboveImage;


            Button browse = new Button();

            browse.Anchor = AnchorStyles.Top;
            browse.Text   = "Browse...";
            browse.Focus();
            browse.Height    = application.Height;
            browse.TextAlign = ContentAlignment.MiddleCenter;
            browse.Click    += delegate
            {
                OpenFileDialog dialog = new OpenFileDialog();
                dialog.FileName = application.Text;
                dialog.Filter   = "Executable files (*.exe)|*.exe";
                DialogResult dr = dialog.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    application.Text = dialog.FileName;
                    application.Focus();
                    application.SelectAll();
                }
            };
            Button directoryBrowse = new Button();

            directoryBrowse.Text   = "Browse...";
            directoryBrowse.Width  = 20;
            directoryBrowse.Width  = directoryBrowse.PreferredSize.Width;
            directoryBrowse.Height = directory.Height;

            directoryBrowse.Click += delegate
            {
                FolderBrowserDialog dialog = new FolderBrowserDialog();
                dialog.SelectedPath = directory.Text;
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    directory.Text = dialog.SelectedPath;
                }
            };
            mainPanel.Controls.Add(MakeLabel("Application:"));
            mainPanel.Controls.Add(application);
            mainPanel.Controls.Add(browse);
            mainPanel.Controls.Add(MakeLabel("Arguments:"));
            mainPanel.Controls.Add(arguments);
            mainPanel.Controls.Add(MakeLabel("Working directory:"));
            mainPanel.Controls.Add(directory);
            mainPanel.Controls.Add(directoryBrowse);
            mainPanel.Controls.Add(start);

            mainPanel.Padding = new Padding(3);
            tabs           = new TabControl();
            tabs.Dock      = DockStyle.Fill;
            help.Dock      = DockStyle.Fill;
            help.TextAlign = ContentAlignment.MiddleCenter;
            help.AutoSize  = false;
            Controls.AddRange(new Control[] { help, mainPanel });

            application.TextChanged += delegate
            {
                string fileName = Path.GetFileName(application.Text);
                Text = fileName + " - " + Title;
            };
        }
Exemple #11
0
        Control MainContent()
        {
            contentContainer = new Panel();

            // set focus when the form is shown
            Shown += delegate
            {
                SectionList.Focus();
            };
            SectionList.SelectedItemChanged += (sender, e) =>
            {
                Control content = null;
                var     item    = SectionList.SelectedItem;

                try
                {
                    content = item?.CreateContent();
                }
                catch (Exception ex)
                {
                    Log.Write(this, "Error loading section: {0}", ex.GetBaseException());
                    contentContainer.Content = null;
                }
                finally
                {
                    if (navigation != null)
                    {
                        if (content != null)
                        {
                            navigation.Push(content, item?.Text);
                        }
                    }
                    else
                    {
                        contentContainer.Content = content;
                    }
                }

#if DEBUG
                GC.Collect();
                GC.WaitForPendingFinalizers();
#endif
            };

            if (Splitter.IsSupported)
            {
                var splitter = new Splitter
                {
                    Position          = 200,
                    FixedPanel        = SplitterFixedPanel.Panel1,
                    Panel1            = SectionList.Control,
                    Panel1MinimumSize = 150,
                    Panel2MinimumSize = 300,
                    // for now, don't show log in mobile
                    Panel2 = Platform.IsMobile ? contentContainer : RightPane()
                };

                return(splitter);
            }
            if (Navigation.IsSupported)
            {
                navigation = new Navigation(SectionList.Control, "Eto.Test");
                return(navigation);
            }
            throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Platform must support splitter or navigation"));
        }
Exemple #12
0
        void f_main_Init()
        {
            #region [ BROWSER ]

            ui_browser = new ChromiumWebBrowser(URL);

            ui_browser.Dock = DockStyle.Fill;
            //ui_browser.PropertyChanged += f_browserPropertyChanged;
            //ui_browser.ConsoleMessage += f_browserConsoleMessage;
            //ui_browser.BeforeResourceLoadHandler = this;
            ui_browser.RenderProcessMessageHandler = new RenderProcessMessageHandler();
            this.Controls.Add(ui_browser);

            #endregion

            #region [ SETTING ]

            ui_setting                 = new ChromiumWebBrowser(URL_SETTING);
            ui_setting.Width           = SETTING_WIDTH;
            ui_setting.Dock            = DockStyle.Left;
            ui_setting.ConsoleMessage += f_settingConsoleMessage;
            this.Controls.Add(ui_setting);

            var spliter = new Splitter()
            {
                Dock     = DockStyle.Left,
                MinExtra = 0,
                MinSize  = 0,
                Width    = _CONST.APP_SPLITER_WIDTH,
            };
            spliter.SplitterMoved += (se, ev) =>
            {
                f_main_updateAppInfo();
            };

            this.Controls.AddRange(new Control[] { spliter, ui_setting });

            #endregion

            #region [ HEADER ]

            ui_header = new Panel()
            {
                Dock      = DockStyle.Top,
                BackColor = SystemColors.ControlLight,
                Height    = 15,
            };
            this.Controls.Add(ui_header);
            ui_backLabel = new Label()
            {
                Text  = " < ",
                Width = 24,
                Dock  = DockStyle.Right
            };
            ui_nextLabel = new Label()
            {
                Text  = " > ",
                Width = 24,
                Dock  = DockStyle.Right
            };
            var lblMin = new Label()
            {
                Text  = "[ - ]",
                Width = 24,
                Dock  = DockStyle.Right
            };
            var lblExit = new Label()
            {
                Text  = "[ x ]",
                Width = 24,
                Dock  = DockStyle.Right
            };

            lblMin.Click  += (se, ev) => { this.WindowState = FormWindowState.Minimized; };
            lblExit.Click += (se, ev) => { this.Close(); };

            ui_urlLabel = new Label()
            {
                Dock = DockStyle.Fill,
                Text = URL,
                //BackColor = Color.OrangeRed,
                TextAlign = ContentAlignment.TopLeft,
                ForeColor = Color.Gray,
            };
            ui_urlLabel.MouseMove   += f_form_move_MouseDown;
            ui_urlLabel.DoubleClick += (se, ev) =>
            {
                if (this.Width == Screen.PrimaryScreen.WorkingArea.Width)
                {
                    this.Width  = 1024;
                    this.Height = 768;
                    this.Left   = (Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2;
                    this.Top    = (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2;
                }
                else
                {
                    this.Left   = 0;
                    this.Top    = 0;
                    this.Width  = Screen.PrimaryScreen.WorkingArea.Width;
                    this.Height = Screen.PrimaryScreen.WorkingArea.Height;
                }

                f_main_updateAppInfo();
            };

            ui_urlLabel.Click += (se, ev) =>
            {
                ui_urlTextBox.Focus();
                ui_urlTextBox.Select(ui_urlTextBox.TextLength, 0);
            };

            ui_header.Controls.AddRange(new Control[] {
                ui_urlLabel,
                new Label()
                {
                    Text = "", Dock = DockStyle.Left, Width = 5
                },
                ui_backLabel, ui_nextLabel, lblMin, lblExit
            });

            ui_backLabel.Click += (se, ev) => f_browserBackPage();
            ui_nextLabel.Click += (se, ev) => f_browserNextPage();

            #endregion

            #region [ FOOTER ]

            ui_footer = new Panel()
            {
                Dock      = DockStyle.Bottom,
                BackColor = SystemColors.ControlLight,
                Height    = 14,
            };
            this.Controls.Add(ui_footer);

            var menu = new Label()
            {
                Text      = "[ = ]",
                Width     = 28,
                Dock      = DockStyle.Left,
                TextAlign = ContentAlignment.TopCenter,
            };

            ui_statusLabel = new Label()
            {
                Dock = DockStyle.Left,
                Text = string.Empty,
                //BackColor = Color.DodgerBlue,
                Width = 200,
            };
            ui_statusLabel.MouseMove += f_form_move_MouseDown;


            ui_urlTextBox = new TextBox()
            {
                Dock = DockStyle.Fill,
                //BackColor = Color.Blue,
                Text        = URL,
                BorderStyle = BorderStyle.None,
                BackColor   = SystemColors.ControlLight,
                TextAlign   = HorizontalAlignment.Right,
                ForeColor   = Color.Gray,
            };
            ui_urlTextBox.DoubleClick += (se, ev) => { ui_urlTextBox.Text = ""; };

            ui_resize = new Label()
            {
                Dock  = DockStyle.Right,
                Text  = string.Empty,
                Width = 14,
            };
            ui_footer.Controls.AddRange(new Control[] {
                ui_urlTextBox,
                ui_statusLabel,
                menu,
                ui_resize
            });

            ui_resize.MouseDown += (se, ev) => { f_hook_mouse_Open(); m_resizing = true; };
            ui_resize.MouseUp   += (se, ev) =>
            {
                m_resizing = false;
                f_hook_mouse_Close();
                //Debug.WriteLine("RESIZE: ok ");
            };

            menu.Click += (se, ev) => f_settingToggle();

            #endregion
        }
Exemple #13
0
        public EntityLine(EntitiesControl container)
        {
            this.Container = container;

            label_color        = new Label();
            label_color.Dock   = DockStyle.Fill;
            label_color.Size   = new Size(6, 23);
            label_color.Margin = new Padding(0, 0, 0, 0);

            //label_color.ImageList = this.Container.ImageListIcons;
            //label_color.ImageIndex = -1;

#if NO
            splitter = new MySplitter();
            // splitter.Dock = DockStyle.Fill;
            splitter.Size      = new Size(8, 23);
            splitter.Width     = 8;
            splitter.Margin    = new Padding(0, 0, 0, 0);
            splitter.BackColor = Color.Transparent;
#endif

            // barcode
            this.textBox_barcode        = new TextBox();
            textBox_barcode.BorderStyle = BorderStyle.None;
            textBox_barcode.Dock        = DockStyle.Fill;
            textBox_barcode.MinimumSize = new Size(20, 21); // 23
            textBox_barcode.Size        = new Size(20, 21); // 23
            textBox_barcode.Margin      = new Padding(8, 4, 0, 0);

            // location
            this.comboBox_location           = new ComboBox();
            comboBox_location.DropDownStyle  = ComboBoxStyle.DropDown;
            comboBox_location.FlatStyle      = FlatStyle.Flat;
            comboBox_location.Dock           = DockStyle.Fill;
            comboBox_location.MaximumSize    = new Size(150, 28);
            comboBox_location.Size           = new Size(100, 28);
            comboBox_location.MinimumSize    = new Size(50, 28);
            comboBox_location.DropDownHeight = 300;
            comboBox_location.DropDownWidth  = 300;
            comboBox_location.ForeColor      = this.Container.TableLayoutPanel.ForeColor;
            comboBox_location.Text           = "";
            comboBox_location.Margin         = new Padding(6, 6, 6, 0);

            // bookType
            this.comboBox_bookType           = new ComboBox();
            comboBox_bookType.DropDownStyle  = ComboBoxStyle.DropDown;
            comboBox_bookType.FlatStyle      = FlatStyle.Flat;
            comboBox_bookType.Dock           = DockStyle.Fill;
            comboBox_bookType.MaximumSize    = new Size(150, 28);
            comboBox_bookType.Size           = new Size(100, 28);
            comboBox_bookType.MinimumSize    = new Size(50, 28);
            comboBox_bookType.DropDownHeight = 300;
            comboBox_bookType.DropDownWidth  = 300;
            comboBox_bookType.ForeColor      = this.Container.TableLayoutPanel.ForeColor;
            comboBox_bookType.Text           = "";
            comboBox_bookType.Margin         = new Padding(6, 6, 6, 0);

            // accessNo
            this.textBox_accessNo        = new TextBox();
            textBox_accessNo.BorderStyle = BorderStyle.None;
            textBox_accessNo.Dock        = DockStyle.Fill;
            textBox_accessNo.MinimumSize = new Size(20, 21); // 23
            textBox_accessNo.Size        = new Size(20, 21); // 23
            textBox_accessNo.Margin      = new Padding(8, 4, 0, 0);

            // price
            this.textBox_price        = new TextBox();
            textBox_price.BorderStyle = BorderStyle.None;
            textBox_price.Dock        = DockStyle.Fill;
            textBox_price.MinimumSize = new Size(20, 21); // 23
            textBox_price.Size        = new Size(20, 21); // 23
            textBox_price.Margin      = new Padding(8, 4, 0, 0);

            // refID
            label_refID          = new Label();
            label_refID.Dock     = DockStyle.Fill;
            label_refID.Size     = new Size(6, 23);
            label_refID.AutoSize = true;
            label_refID.Margin   = new Padding(4, 2, 4, 0);
            // label_caption.BackColor = SystemColors.Control;

            // batchNo
            this.label_batchNo     = new Label();
            label_batchNo.Dock     = DockStyle.Fill;
            label_batchNo.Size     = new Size(6, 23);
            label_batchNo.AutoSize = true;
            label_batchNo.Margin   = new Padding(4, 2, 4, 0);
            // label_caption.BackColor = SystemColors.Control;
        }
        // FIXME: GTKize
        public void Split()
        {
            if (secondaryTextArea == null) {
                secondaryTextArea = new TextAreaControl(this);
                secondaryTextArea.Dock = DockStyle.Bottom;
                secondaryTextArea.Height = Height / 2;
                textAreaSplitter =  new Splitter();
                textAreaSplitter.BorderStyle = BorderStyle.FixedSingle ;
                textAreaSplitter.Height = 8;
                textAreaSplitter.Dock = DockStyle.Bottom;
                Controls.Add(textAreaSplitter);
                Controls.Add(secondaryTextArea);
                InitializeTextAreaControl(secondaryTextArea);
                secondaryTextArea.OptionsChanged();
            } else {
                Controls.Remove(secondaryTextArea);
                Controls.Remove(textAreaSplitter);

                secondaryTextArea.Dispose();
                textAreaSplitter.Dispose();
                secondaryTextArea = null;
                textAreaSplitter  = null;
            }
        }
Exemple #15
0
 public ListTransformer(Splitter splitter, Builder builder)
 {
     this.splitter = splitter;
       this.builder = builder;
 }
Exemple #16
0
	public MainForm ()
	{
		_panel = new Panel ();
		_panel.SuspendLayout ();
		SuspendLayout ();
		// 
		// _splitterLeft
		// 
		_splitterLeft = new Splitter ();
		_splitterLeft.BorderStyle = BorderStyle.Fixed3D;
		_splitterLeft.Location = new Point (184, 0);
		_splitterLeft.Size = new Size (3, 390);
		_splitterLeft.TabStop = false;
		// 
		// _splitterRight
		// 
		_splitterRight = new Splitter ();
		_splitterRight.BorderStyle = BorderStyle.Fixed3D;
		_splitterRight.Location = new Point (323, 0);
		_splitterRight.Size = new Size (3, 390);
		_splitterRight.TabStop = false;
		// 
		// _propertyGrid
		// 
		_propertyGrid = new PropertyGrid ();
		_propertyGrid.Dock = DockStyle.Left;
		_propertyGrid.SelectedObject = new Config ();
		_propertyGrid.Size = new Size (184, 390);
		// 
		// _checkedListBox
		// 
		_checkedListBox = new CheckedListBox ();
		_checkedListBox.Anchor = (((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right);
		_checkedListBox.CheckOnClick = true;
		_checkedListBox.Size = new Size (136, 349);
		// 
		// _setAllButton
		// 
		_setAllButton = new Button ();
		_setAllButton.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
		_setAllButton.Location = new Point (72, 360);
		_setAllButton.Size = new Size (56, 24);
		_setAllButton.TabIndex = 10;
		_setAllButton.Text = "Set All";
		// 
		// _clearAllButton
		// 
		_clearAllButton = new Button ();
		_clearAllButton.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
		_clearAllButton.Location = new Point(8, 360);
		_clearAllButton.Size = new Size(56, 24);
		_clearAllButton.TabIndex = 9;
		_clearAllButton.Text = "Clear All";
		// 
		// _panel
		// 
		_panel.Controls.AddRange (new Control [] { _checkedListBox, _setAllButton, _clearAllButton });
		_panel.Dock = DockStyle.Left;
		_panel.Location = new Point (187, 0);
		_panel.Size = new Size (136, 390);
		_panel.TabIndex = 11;
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. The CheckedListBox fills the width of the center panel.{0}{0}" +
			"2. The \"Clear All\" and \"Set All\" and buttons are displayed " +
			"at the bottom of the center panel in that order.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// _bugDescriptionText2
		// 
		_bugDescriptionText2 = new TextBox ();
		_bugDescriptionText2.Multiline = true;
		_bugDescriptionText2.Dock = DockStyle.Fill;
		_bugDescriptionText2.Text = string.Format (CultureInfo.InvariantCulture,
			"Steps to execute:{0}{0}" +
			"1. Resize the height of the form from extremely small to very " +
			"large.{0}{0}" +
			"2. Repeat this several times.{0}{0}" +
			"Expected result:{0}{0}" +
			"1. The CheckedListBox continues to fill almost the full height of " +
			"the form, leaving room only for the two buttons.",
			Environment.NewLine);
		// 
		// _tabPage2
		// 
		_tabPage2 = new TabPage ();
		_tabPage2.Text = "#2";
		_tabPage2.Controls.Add (_bugDescriptionText2);
		_tabControl.Controls.Add (_tabPage2);
		// 
		// MainForm
		// 
		ClientSize = new Size (752, 390);
		Controls.Add (_splitterRight);
		Controls.Add (_panel);
		Controls.Add (_splitterLeft);
		Controls.Add (_propertyGrid);
		StartPosition = FormStartPosition.CenterScreen;
		Text = "bug #80394";
		Load += new EventHandler (MainForm_Load);
		_panel.ResumeLayout (false);
		ResumeLayout (false);
	}
 private void InitializeComponent()
 {
     this.icontainer_0 = new Container();
     this.toolStrip1 = new ToolStrip();
     this.btnState = new ToolStripDropDownButton();
     this.监听消息ToolStripMenuItem = new ToolStripMenuItem();
     this.停止监听ToolStripMenuItem = new ToolStripMenuItem();
     this.btnExport = new ToolStripDropDownButton();
     this.btnExportText = new ToolStripMenuItem();
     this.btnExportXml = new ToolStripMenuItem();
     this.toolStripMenuItem1 = new ToolStripSeparator();
     this.btnImportXml = new ToolStripMenuItem();
     this.btnDelete = new ToolStripDropDownButton();
     this.删除选定项ToolStripMenuItem = new ToolStripMenuItem();
     this.删除全部ToolStripMenuItem = new ToolStripMenuItem();
     this.toolStripSeparator2 = new ToolStripSeparator();
     this.btnTopMost = new ToolStripButton();
     this.toolStripSeparator1 = new ToolStripSeparator();
     this.btnExit = new ToolStripButton();
     this.txtExecuteInfo = new TextBox();
     this.splitter1 = new Splitter();
     this.listView1 = new ListView();
     this.columnHeader_5 = new ColumnHeader();
     this.columnHeader_0 = new ColumnHeader();
     this.columnHeader_1 = new ColumnHeader();
     this.columnHeader_2 = new ColumnHeader();
     this.columnHeader_3 = new ColumnHeader();
     this.columnHeader_4 = new ColumnHeader();
     this.imageList_0 = new ImageList(this.icontainer_0);
     this.toolStrip1.SuspendLayout();
     base.SuspendLayout();
     this.toolStrip1.Items.AddRange(new ToolStripItem[]
     {
         this.btnState,
         this.btnExport,
         this.btnDelete,
         this.toolStripSeparator2,
         this.btnTopMost,
         this.toolStripSeparator1,
         this.btnExit
     });
     this.toolStrip1.Location = new Point(0, 0);
     this.toolStrip1.Name = "toolStrip1";
     this.toolStrip1.Size = new Size(881, 25);
     this.toolStrip1.TabIndex = 0;
     this.toolStrip1.Text = "toolStrip1";
     this.btnState.DropDownItems.AddRange(new ToolStripItem[]
     {
         this.监听消息ToolStripMenuItem,
         this.停止监听ToolStripMenuItem
     });
     //this.btnState.Image = Resources.ball3;
     this.btnState.Name = "btnState";
     this.btnState.Size = new Size(84, 22);
     this.btnState.Text = "监听消息";
     //this.监听消息ToolStripMenuItem.Image = Resources.ball3;
     this.监听消息ToolStripMenuItem.Name = "监听消息ToolStripMenuItem";
     this.监听消息ToolStripMenuItem.Size = new Size(122, 22);
     this.监听消息ToolStripMenuItem.Text = "监听消息";
     this.监听消息ToolStripMenuItem.Click += new EventHandler(this.监听消息ToolStripMenuItem_Click);
     //this.停止监听ToolStripMenuItem.Image = Resources.ball2;
     this.停止监听ToolStripMenuItem.Name = "停止监听ToolStripMenuItem";
     this.停止监听ToolStripMenuItem.Size = new Size(122, 22);
     this.停止监听ToolStripMenuItem.Text = "停止监听";
     this.停止监听ToolStripMenuItem.Click += new EventHandler(this.停止监听ToolStripMenuItem_Click);
     this.btnExport.DropDownItems.AddRange(new ToolStripItem[]
     {
         this.btnExportText,
         this.btnExportXml,
         this.toolStripMenuItem1,
         this.btnImportXml
     });
     //this.btnExport.Image = Resources.grid7;
     this.btnExport.Name = "btnExport";
     this.btnExport.Size = new Size(108, 22);
     this.btnExport.Text = "消息导入导出";
     this.btnExportText.Name = "btnExportText";
     this.btnExportText.Size = new Size(182, 22);
     this.btnExportText.Text = "以普通文本格式导出";
     this.btnExportText.Click += new EventHandler(this.btnExportText_Click);
     this.btnExportXml.Name = "btnExportXml";
     this.btnExportXml.Size = new Size(182, 22);
     this.btnExportXml.Text = "以XML格式导出";
     this.btnExportXml.Click += new EventHandler(this.btnExportXml_Click);
     this.toolStripMenuItem1.Name = "toolStripMenuItem1";
     this.toolStripMenuItem1.Size = new Size(179, 6);
     this.btnImportXml.Name = "btnImportXml";
     this.btnImportXml.Size = new Size(182, 22);
     this.btnImportXml.Text = "导入XML格式消息";
     this.btnImportXml.Click += new EventHandler(this.btnImportXml_Click);
     this.btnDelete.DropDownItems.AddRange(new ToolStripItem[]
     {
         this.删除选定项ToolStripMenuItem,
         this.删除全部ToolStripMenuItem
     });
     //this.btnDelete.Image = Resources.dele2;
     this.btnDelete.Name = "btnDelete";
     this.btnDelete.Size = new Size(84, 22);
     this.btnDelete.Text = "删除消息";
     this.删除选定项ToolStripMenuItem.Name = "删除选定项ToolStripMenuItem";
     this.删除选定项ToolStripMenuItem.Size = new Size(158, 22);
     this.删除选定项ToolStripMenuItem.Text = "删除选定项";
     this.删除选定项ToolStripMenuItem.Click += new EventHandler(this.删除选定项ToolStripMenuItem_Click);
     this.删除全部ToolStripMenuItem.Name = "删除全部ToolStripMenuItem";
     this.删除全部ToolStripMenuItem.Size = new Size(158, 22);
     this.删除全部ToolStripMenuItem.Text = "删除全部列表项";
     this.删除全部ToolStripMenuItem.Click += new EventHandler(this.删除全部ToolStripMenuItem_Click);
     this.toolStripSeparator2.Name = "toolStripSeparator2";
     this.toolStripSeparator2.Size = new Size(6, 25);
     this.btnTopMost.CheckOnClick = true;
     //this.btnTopMost.Image = Resources.unlockWnd;
     this.btnTopMost.Name = "btnTopMost";
     this.btnTopMost.Size = new Size(75, 22);
     this.btnTopMost.Text = "窗口置顶";
     this.btnTopMost.CheckStateChanged += new EventHandler(this.btnTopMost_CheckStateChanged);
     this.toolStripSeparator1.Name = "toolStripSeparator1";
     this.toolStripSeparator1.Size = new Size(6, 25);
     //this.btnExit.Image = Resources.exit2;
     this.btnExit.Name = "btnExit";
     this.btnExit.Size = new Size(75, 22);
     this.btnExit.Text = "退出程序";
     this.btnExit.Click += new EventHandler(this.btnExit_Click);
     this.txtExecuteInfo.AcceptsReturn = true;
     this.txtExecuteInfo.Dock = DockStyle.Bottom;
     this.txtExecuteInfo.Font = new Font("Courier New", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.txtExecuteInfo.Location = new Point(0, 303);
     this.txtExecuteInfo.Multiline = true;
     this.txtExecuteInfo.Name = "txtExecuteInfo";
     this.txtExecuteInfo.ReadOnly = true;
     this.txtExecuteInfo.ScrollBars = ScrollBars.Both;
     this.txtExecuteInfo.Size = new Size(881, 201);
     this.txtExecuteInfo.TabIndex = 1;
     this.txtExecuteInfo.WordWrap = false;
     this.splitter1.Dock = DockStyle.Bottom;
     this.splitter1.Location = new Point(0, 296);
     this.splitter1.Name = "splitter1";
     this.splitter1.Size = new Size(881, 7);
     this.splitter1.TabIndex = 2;
     this.splitter1.TabStop = false;
     this.listView1.Columns.AddRange(new ColumnHeader[]
     {
         this.columnHeader_5,
         this.columnHeader_0,
         this.columnHeader_1,
         this.columnHeader_2,
         this.columnHeader_3,
         this.columnHeader_4
     });
     this.listView1.Dock = DockStyle.Fill;
     this.listView1.FullRowSelect = true;
     this.listView1.HideSelection = false;
     this.listView1.Location = new Point(0, 25);
     this.listView1.Name = "listView1";
     this.listView1.Size = new Size(881, 271);
     this.listView1.SmallImageList = this.imageList_0;
     this.listView1.TabIndex = 3;
     this.listView1.UseCompatibleStateImageBehavior = false;
     this.listView1.View = View.Details;
     this.listView1.SelectedIndexChanged += new EventHandler(this.listView1_SelectedIndexChanged);
     this.columnHeader_5.Text = "序号";
     this.columnHeader_5.Width = 54;
     this.columnHeader_0.Text = "命令文本";
     this.columnHeader_0.Width = 196;
     this.columnHeader_1.Text = "命令参数";
     this.columnHeader_1.Width = 210;
     this.columnHeader_2.Text = "开始时间";
     this.columnHeader_2.Width = 115;
     this.columnHeader_3.Text = "完成时间";
     this.columnHeader_3.Width = 168;
     this.columnHeader_4.Text = "应用程序标识";
     this.columnHeader_4.Width = 110;
     this.imageList_0.ColorDepth = ColorDepth.Depth8Bit;
     this.imageList_0.ImageSize = new Size(16, 16);
     this.imageList_0.TransparentColor = Color.Transparent;
     base.AutoScaleDimensions = new SizeF(6f, 12f);
     base.AutoScaleMode = AutoScaleMode.Font;
     base.ClientSize = new Size(881, 504);
     base.Controls.Add(this.listView1);
     base.Controls.Add(this.splitter1);
     base.Controls.Add(this.txtExecuteInfo);
     base.Controls.Add(this.toolStrip1);
     base.Name = "SQLProfilerForm";
     this.Text = "FastDBEngineSQLProfiler";
     base.Load += new EventHandler(this.SQLProfilerForm_Load);
     base.Shown += new EventHandler(this.SQLProfilerForm_Shown);
     base.FormClosing += new FormClosingEventHandler(this.SQLProfilerForm_FormClosing);
     this.toolStrip1.ResumeLayout(false);
     this.toolStrip1.PerformLayout();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
Exemple #18
0
        private void InitializeComponent()
        {
            this.components = new Container();
            ResourceManager manager = new ResourceManager(typeof(InstanceTracker));

            this.DetailMenu     = new ContextMenu();
            this.DetailMenuItem = new MenuItem();
            this.statusBar      = new StatusBar();
            this.mainMenu       = new MainMenu();
            this.menuItem1      = new MenuItem();
            this.saveAsMenuItem = new MenuItem();
            this.menuItem8      = new MenuItem();
            this.gcMenuItem     = new MenuItem();
            this.fullGcMenuItem = new MenuItem();
            this.menuItem4      = new MenuItem();
            this.enableInstanceTrackingMenuItem = new MenuItem();
            this.menuItem3                = new MenuItem();
            this.closeMenuItem            = new MenuItem();
            this.menuItem2                = new MenuItem();
            this.showExceptionsMenuItem   = new MenuItem();
            this.showWarningsMenuItem     = new MenuItem();
            this.showInformationMenuItem  = new MenuItem();
            this.showAuditMenuItem        = new MenuItem();
            this.menuItem5                = new MenuItem();
            this.haltOnExceptionsMenuItem = new MenuItem();
            this.menuItem6                = new MenuItem();
            this.ClearEventMenuItem       = new MenuItem();
            this.tabControl1              = new TabControl();
            this.tabPage2                           = new TabPage();
            this.EventText                          = new TextBox();
            this.splitter1                          = new Splitter();
            this.EventListView                      = new ListView();
            this.columnHeader4                      = new ColumnHeader();
            this.columnHeader3                      = new ColumnHeader();
            this.iconImageList                      = new ImageList(this.components);
            this.tabPage1                           = new TabPage();
            this.instanceListView                   = new ListView();
            this.columnHeader1                      = new ColumnHeader();
            this.columnHeader2                      = new ColumnHeader();
            this.ToolsIconList                      = new ImageList(this.components);
            this.eventToolBar                       = new ToolBar();
            this.toolBarButton3                     = new ToolBarButton();
            this.showExceptionsToolBarButton        = new ToolBarButton();
            this.showWarningEventsToolBarButton     = new ToolBarButton();
            this.showInformationEventsToolBarButton = new ToolBarButton();
            this.showAuditEventsToolBarButton       = new ToolBarButton();
            this.toolBarButton1                     = new ToolBarButton();
            this.clearEventLogToolBarButton         = new ToolBarButton();
            this.toolBarButton2                     = new ToolBarButton();
            this.gcToolBarButton                    = new ToolBarButton();
            this.saveLogFileDialog                  = new SaveFileDialog();
            this.tabControl1.SuspendLayout();
            this.tabPage2.SuspendLayout();
            this.tabPage1.SuspendLayout();
            base.SuspendLayout();
            this.DetailMenu.MenuItems.AddRange(new MenuItem[] { this.DetailMenuItem });
            this.DetailMenuItem.Index  = 0;
            this.DetailMenuItem.Text   = "Details";
            this.DetailMenuItem.Click += new System.EventHandler(this.DetailMenuItem_Click);
            this.statusBar.Location    = new Point(0, 0x1b9);
            this.statusBar.Name        = "statusBar";
            this.statusBar.Size        = new Size(480, 0x10);
            this.statusBar.TabIndex    = 1;
            this.mainMenu.MenuItems.AddRange(new MenuItem[] { this.menuItem1, this.menuItem2 });
            this.menuItem1.Index = 0;
            this.menuItem1.MenuItems.AddRange(new MenuItem[] { this.saveAsMenuItem, this.menuItem8, this.gcMenuItem, this.fullGcMenuItem, this.menuItem4, this.enableInstanceTrackingMenuItem, this.menuItem3, this.closeMenuItem });
            this.menuItem1.Text        = "&File";
            this.saveAsMenuItem.Index  = 0;
            this.saveAsMenuItem.Text   = "Save As...";
            this.saveAsMenuItem.Click += new System.EventHandler(this.saveAsMenuItem_Click);
            this.menuItem8.Index       = 1;
            this.menuItem8.Text        = "-";
            this.gcMenuItem.Index      = 2;
            this.gcMenuItem.Text       = "&Garbage Collect";
            this.gcMenuItem.Click     += new System.EventHandler(this.gcMenuItem_Click);
            this.fullGcMenuItem.Index  = 3;
            this.fullGcMenuItem.Text   = "&Full Garbage Collect";
            this.fullGcMenuItem.Click += new System.EventHandler(this.fullGcMenuItem_Click);
            this.menuItem4.Index       = 4;
            this.menuItem4.Text        = "-";
            this.enableInstanceTrackingMenuItem.Index  = 5;
            this.enableInstanceTrackingMenuItem.Text   = "&Enable Object Tracking";
            this.enableInstanceTrackingMenuItem.Click += new System.EventHandler(this.enableInstanceTrackingMenuItem_Click);
            this.menuItem3.Index      = 6;
            this.menuItem3.Text       = "-";
            this.closeMenuItem.Index  = 7;
            this.closeMenuItem.Text   = "&Close";
            this.closeMenuItem.Click += new System.EventHandler(this.closeMenuItem_Click);
            this.menuItem2.Index      = 1;
            this.menuItem2.MenuItems.AddRange(new MenuItem[] { this.showExceptionsMenuItem, this.showWarningsMenuItem, this.showInformationMenuItem, this.showAuditMenuItem, this.menuItem5, this.haltOnExceptionsMenuItem, this.menuItem6, this.ClearEventMenuItem });
            this.menuItem2.Text = "Events";
            this.showExceptionsMenuItem.Index   = 0;
            this.showExceptionsMenuItem.Text    = "Show &Exception Messages";
            this.showExceptionsMenuItem.Click  += new System.EventHandler(this.showExceptionsMenuItem_Click);
            this.showWarningsMenuItem.Index     = 1;
            this.showWarningsMenuItem.Text      = "Show &Warning Messages";
            this.showWarningsMenuItem.Click    += new System.EventHandler(this.showWarningsMenuItem_Click);
            this.showInformationMenuItem.Index  = 2;
            this.showInformationMenuItem.Text   = "Show &Information Messages";
            this.showInformationMenuItem.Click += new System.EventHandler(this.showInformationMenuItem_Click);
            this.showAuditMenuItem.Index        = 3;
            this.showAuditMenuItem.Text         = "Show &Audit Messages";
            this.showAuditMenuItem.Click       += new System.EventHandler(this.showAuditMenuItem_Click);
            this.menuItem5.Index = 4;
            this.menuItem5.Text  = "-";
            this.haltOnExceptionsMenuItem.Index  = 5;
            this.haltOnExceptionsMenuItem.Text   = "&Halt On Exceptions";
            this.haltOnExceptionsMenuItem.Click += new System.EventHandler(this.haltOnExceptionsMenuItem_Click);
            this.menuItem6.Index           = 6;
            this.menuItem6.Text            = "-";
            this.ClearEventMenuItem.Index  = 7;
            this.ClearEventMenuItem.Text   = "&Clear Event Log";
            this.ClearEventMenuItem.Click += new System.EventHandler(this.ClearEventMenuItem_Click);
            this.tabControl1.Alignment     = TabAlignment.Bottom;
            this.tabControl1.Controls.AddRange(new Control[] { this.tabPage2, this.tabPage1 });
            this.tabControl1.Dock          = DockStyle.Fill;
            this.tabControl1.Location      = new Point(0, 0x19);
            this.tabControl1.Name          = "tabControl1";
            this.tabControl1.SelectedIndex = 0;
            this.tabControl1.Size          = new Size(480, 0x1a0);
            this.tabControl1.TabIndex      = 2;
            this.tabPage2.Controls.AddRange(new Control[] { this.EventText, this.splitter1, this.EventListView });
            this.tabPage2.Location         = new Point(4, 4);
            this.tabPage2.Name             = "tabPage2";
            this.tabPage2.Size             = new Size(0x1d8, 390);
            this.tabPage2.TabIndex         = 1;
            this.tabPage2.Text             = "Events";
            this.EventText.BorderStyle     = BorderStyle.None;
            this.EventText.Dock            = DockStyle.Fill;
            this.EventText.Location        = new Point(0, 0xb3);
            this.EventText.Multiline       = true;
            this.EventText.Name            = "EventText";
            this.EventText.ReadOnly        = true;
            this.EventText.ScrollBars      = ScrollBars.Vertical;
            this.EventText.Size            = new Size(0x1d8, 0xd3);
            this.EventText.TabIndex        = 1;
            this.EventText.TabStop         = false;
            this.EventText.Text            = "";
            this.splitter1.BackColor       = SystemColors.ControlDark;
            this.splitter1.Dock            = DockStyle.Top;
            this.splitter1.Location        = new Point(0, 0xb0);
            this.splitter1.Name            = "splitter1";
            this.splitter1.Size            = new Size(0x1d8, 3);
            this.splitter1.TabIndex        = 2;
            this.splitter1.TabStop         = false;
            this.EventListView.BorderStyle = BorderStyle.None;
            this.EventListView.Columns.AddRange(new ColumnHeader[] { this.columnHeader4, this.columnHeader3 });
            this.EventListView.Dock                  = DockStyle.Top;
            this.EventListView.FullRowSelect         = true;
            this.EventListView.HeaderStyle           = ColumnHeaderStyle.Nonclickable;
            this.EventListView.LargeImageList        = this.iconImageList;
            this.EventListView.MultiSelect           = false;
            this.EventListView.Name                  = "EventListView";
            this.EventListView.Size                  = new Size(0x1d8, 0xb0);
            this.EventListView.SmallImageList        = this.iconImageList;
            this.EventListView.TabIndex              = 0;
            this.EventListView.View                  = View.Details;
            this.EventListView.SelectedIndexChanged += new System.EventHandler(this.EventListView_SelectedIndexChanged);
            this.columnHeader4.Text                  = "Origin";
            this.columnHeader4.Width                 = 150;
            this.columnHeader3.Text                  = "Message";
            this.columnHeader3.Width                 = 300;
            this.iconImageList.ColorDepth            = ColorDepth.Depth8Bit;
            this.iconImageList.ImageSize             = new Size(0x10, 0x10);
            this.iconImageList.ImageStream           = (ImageListStreamer)manager.GetObject("iconImageList.ImageStream");
            this.iconImageList.TransparentColor      = Color.Transparent;
            this.tabPage1.Controls.AddRange(new Control[] { this.instanceListView });
            this.tabPage1.Location            = new Point(4, 4);
            this.tabPage1.Name                = "tabPage1";
            this.tabPage1.Size                = new Size(0x1d8, 390);
            this.tabPage1.TabIndex            = 0;
            this.tabPage1.Text                = "Instances";
            this.instanceListView.BorderStyle = BorderStyle.None;
            this.instanceListView.Columns.AddRange(new ColumnHeader[] { this.columnHeader1, this.columnHeader2 });
            this.instanceListView.ContextMenu   = this.DetailMenu;
            this.instanceListView.Dock          = DockStyle.Fill;
            this.instanceListView.FullRowSelect = true;
            this.instanceListView.HeaderStyle   = ColumnHeaderStyle.Nonclickable;
            this.instanceListView.MultiSelect   = false;
            this.instanceListView.Name          = "instanceListView";
            this.instanceListView.Size          = new Size(0x1d8, 390);
            this.instanceListView.Sorting       = SortOrder.Ascending;
            this.instanceListView.TabIndex      = 1;
            this.instanceListView.View          = View.Details;
            this.columnHeader1.Text             = "Count";
            this.columnHeader1.Width            = 0x51;
            this.columnHeader2.Text             = "Object";
            this.columnHeader2.Width            = 370;
            this.ToolsIconList.ColorDepth       = ColorDepth.Depth8Bit;
            this.ToolsIconList.ImageSize        = new Size(0x10, 0x10);
            this.ToolsIconList.ImageStream      = (ImageListStreamer)manager.GetObject("ToolsIconList.ImageStream");
            this.ToolsIconList.TransparentColor = Color.Transparent;
            this.eventToolBar.Appearance        = ToolBarAppearance.Flat;
            this.eventToolBar.Buttons.AddRange(new ToolBarButton[] { this.toolBarButton3, this.showExceptionsToolBarButton, this.showWarningEventsToolBarButton, this.showInformationEventsToolBarButton, this.showAuditEventsToolBarButton, this.toolBarButton1, this.clearEventLogToolBarButton, this.toolBarButton2, this.gcToolBarButton });
            this.eventToolBar.DropDownArrows                    = true;
            this.eventToolBar.ImageList                         = this.ToolsIconList;
            this.eventToolBar.Name                              = "eventToolBar";
            this.eventToolBar.ShowToolTips                      = true;
            this.eventToolBar.Size                              = new Size(480, 0x19);
            this.eventToolBar.TabIndex                          = 4;
            this.eventToolBar.ButtonClick                      += new ToolBarButtonClickEventHandler(this.eventToolBar_ButtonClick);
            this.toolBarButton3.Style                           = ToolBarButtonStyle.Separator;
            this.showExceptionsToolBarButton.ImageIndex         = 3;
            this.showExceptionsToolBarButton.Style              = ToolBarButtonStyle.ToggleButton;
            this.showExceptionsToolBarButton.ToolTipText        = "Show Exception Messages";
            this.showWarningEventsToolBarButton.ImageIndex      = 2;
            this.showWarningEventsToolBarButton.Style           = ToolBarButtonStyle.ToggleButton;
            this.showWarningEventsToolBarButton.ToolTipText     = "Show Warnings Messages";
            this.showInformationEventsToolBarButton.ImageIndex  = 1;
            this.showInformationEventsToolBarButton.Style       = ToolBarButtonStyle.ToggleButton;
            this.showInformationEventsToolBarButton.ToolTipText = "Show Information Messages";
            this.showAuditEventsToolBarButton.ImageIndex        = 6;
            this.showAuditEventsToolBarButton.Style             = ToolBarButtonStyle.ToggleButton;
            this.showAuditEventsToolBarButton.ToolTipText       = "Show Audit Messages";
            this.toolBarButton1.Style                           = ToolBarButtonStyle.Separator;
            this.clearEventLogToolBarButton.ImageIndex          = 4;
            this.clearEventLogToolBarButton.ToolTipText         = "Clear Event Log";
            this.toolBarButton2.ImageIndex                      = 5;
            this.toolBarButton2.Style                           = ToolBarButtonStyle.Separator;
            this.gcToolBarButton.ImageIndex                     = 5;
            this.gcToolBarButton.ToolTipText                    = "Force Garbage Collection";
            this.saveLogFileDialog.DefaultExt                   = "log";
            this.saveLogFileDialog.FileName                     = "DebugInformation.log";
            this.saveLogFileDialog.Filter                       = "Log Files|*.log";
            this.saveLogFileDialog.Title                        = "Save Debug Information Log";
            this.AutoScaleBaseSize                              = new Size(5, 13);
            base.ClientSize = new Size(480, 0x1c9);
            base.Controls.AddRange(new Control[] { this.tabControl1, this.eventToolBar, this.statusBar });
            base.Icon          = (Icon)manager.GetObject("$this.Icon");
            base.Menu          = this.mainMenu;
            base.Name          = "InstanceTracker";
            base.StartPosition = FormStartPosition.CenterParent;
            this.Text          = "Debug Information";
            base.Load         += new System.EventHandler(this.InstanceTracker_Load);
            base.Closed       += new System.EventHandler(this.InstanceTracker_Closed);
            this.tabControl1.ResumeLayout(false);
            this.tabPage2.ResumeLayout(false);
            this.tabPage1.ResumeLayout(false);
            base.ResumeLayout(false);
        }
        [Fact]
        public void Add_adds_pane_to_splitter()
        {
            factory.Add();
 public SplitterHtmlBuilder(Splitter component)
 {
     this.component = component;
 }
 private void InitializeComponent()
 {
     components = new System.ComponentModel.Container();
     new System.ComponentModel.ComponentResourceManager(typeof(Microsoft.Tools.ServiceModel.TraceViewer.CreateCustomFilterByTemplateDialog));
     leftPanel                   = new System.Windows.Forms.Panel();
     treeView                    = new System.Windows.Forms.TreeView();
     toolStrip1                  = new System.Windows.Forms.ToolStrip();
     btnAddCriteria              = new System.Windows.Forms.ToolStripButton();
     splitter                    = new System.Windows.Forms.Splitter();
     rightPanel                  = new System.Windows.Forms.Panel();
     logicGrid                   = new System.Windows.Forms.DataGridView();
     dataGridViewTextBoxColumn1  = new System.Windows.Forms.DataGridViewTextBoxColumn();
     dataGridViewComboBoxColumn2 = new System.Windows.Forms.DataGridViewComboBoxColumn();
     dataGridViewCheckBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
     dataGridViewComboBoxColumn3 = new System.Windows.Forms.DataGridViewComboBoxColumn();
     splitter1                   = new System.Windows.Forms.Splitter();
     xpathPanel                  = new System.Windows.Forms.Panel();
     filterDescription           = new System.Windows.Forms.TextBox();
     lblDescription              = new System.Windows.Forms.Label();
     filterName                  = new System.Windows.Forms.TextBox();
     lblName         = new System.Windows.Forms.Label();
     btnOk           = new System.Windows.Forms.Button();
     btnCancel       = new System.Windows.Forms.Button();
     lblXPath        = new System.Windows.Forms.Label();
     xpathExpression = new System.Windows.Forms.TextBox();
     leftPanel.SuspendLayout();
     toolStrip1.SuspendLayout();
     rightPanel.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)logicGrid).BeginInit();
     xpathPanel.SuspendLayout();
     SuspendLayout();
     leftPanel.Controls.Add(treeView);
     leftPanel.Controls.Add(toolStrip1);
     leftPanel.Dock                 = System.Windows.Forms.DockStyle.Left;
     leftPanel.Location             = new System.Drawing.Point(0, 0);
     leftPanel.Name                 = "leftPanel";
     leftPanel.Size                 = new System.Drawing.Size(275, 541);
     leftPanel.TabStop              = false;
     leftPanel.MinimumSize          = new System.Drawing.Size(275, 0);
     leftPanel.MaximumSize          = new System.Drawing.Size(350, 0);
     treeView.Dock                  = System.Windows.Forms.DockStyle.Fill;
     treeView.FullRowSelect         = true;
     treeView.Location              = new System.Drawing.Point(0, 25);
     treeView.Name                  = "treeView";
     treeView.HideSelection         = false;
     treeView.ShowNodeToolTips      = true;
     treeView.Size                  = new System.Drawing.Size(284, 516);
     treeView.TabIndex              = 0;
     treeView.AfterSelect          += new System.Windows.Forms.TreeViewEventHandler(treeView_AfterSelect);
     treeView.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(treeView_NodeMouseDoubleClick);
     treeView.KeyUp                += new System.Windows.Forms.KeyEventHandler(treeView_KeyUp);
     treeView.TabIndex              = 2;
     toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[1]
     {
         btnAddCriteria
     });
     toolStrip1.Location         = new System.Drawing.Point(0, 0);
     toolStrip1.Name             = "toolStrip1";
     toolStrip1.Size             = new System.Drawing.Size(284, 25);
     toolStrip1.TabIndex         = 1;
     btnAddCriteria.Enabled      = false;
     btnAddCriteria.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     btnAddCriteria.Name         = "btnAddCriteria";
     btnAddCriteria.Text         = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("CF_AFC");
     btnAddCriteria.Click       += new System.EventHandler(btnAddCriteria_Click);
     splitter.Location           = new System.Drawing.Point(284, 0);
     splitter.Name    = "splitter";
     splitter.Size    = new System.Drawing.Size(3, 541);
     splitter.TabStop = false;
     splitter.Enabled = false;
     rightPanel.Controls.Add(logicGrid);
     rightPanel.Dock              = System.Windows.Forms.DockStyle.Top;
     rightPanel.Location          = new System.Drawing.Point(287, 0);
     rightPanel.Name              = "rightPanel";
     rightPanel.Size              = new System.Drawing.Size(435, 283);
     rightPanel.TabStop           = false;
     logicGrid.AllowUserToAddRows = false;
     logicGrid.Columns.Add(dataGridViewTextBoxColumn1);
     logicGrid.Columns.Add(dataGridViewComboBoxColumn2);
     logicGrid.Columns.Add(dataGridViewCheckBoxColumn2);
     logicGrid.Columns.Add(dataGridViewComboBoxColumn3);
     logicGrid.Dock                         = System.Windows.Forms.DockStyle.Fill;
     logicGrid.Location                     = new System.Drawing.Point(0, 0);
     logicGrid.MultiSelect                  = false;
     logicGrid.Name                         = "logicGrid";
     logicGrid.ShowEditingIcon              = false;
     logicGrid.Size                         = new System.Drawing.Size(435, 283);
     logicGrid.TabIndex                     = 3;
     logicGrid.CellValidating              += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(logicGrid_CellValidating);
     logicGrid.RowValidating               += new System.Windows.Forms.DataGridViewCellCancelEventHandler(logicGrid_RowValidating);
     logicGrid.RowsAdded                   += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(logicGrid_RowsAdded);
     logicGrid.RowsRemoved                 += new System.Windows.Forms.DataGridViewRowsRemovedEventHandler(logicGrid_RowsRemoved);
     logicGrid.ColumnWidthChanged          += new System.Windows.Forms.DataGridViewColumnEventHandler(logicGrid_ColumnWidthChanged);
     dataGridViewTextBoxColumn1.HeaderText  = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("CF_ExpressionHeader");
     dataGridViewTextBoxColumn1.Name        = "xpathHeader";
     dataGridViewTextBoxColumn1.ReadOnly    = true;
     dataGridViewTextBoxColumn1.Width       = 100;
     dataGridViewComboBoxColumn2.HeaderText = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("CF_OperationHeader");
     dataGridViewComboBoxColumn2.Name       = "operationHeader";
     dataGridViewComboBoxColumn2.Width      = 100;
     dataGridViewCheckBoxColumn2.HeaderText = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("CF_ValueHeader");
     dataGridViewCheckBoxColumn2.Name       = "defaultValueHeader";
     dataGridViewCheckBoxColumn2.Width      = 100;
     dataGridViewComboBoxColumn3.HeaderText = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("CF_ParameterHeader");
     dataGridViewComboBoxColumn3.Name       = "paramHeader";
     dataGridViewComboBoxColumn3.Width      = 100;
     splitter1.Dock                         = System.Windows.Forms.DockStyle.Top;
     splitter1.Location                     = new System.Drawing.Point(287, 283);
     splitter1.Name                         = "splitter1";
     splitter1.Size                         = new System.Drawing.Size(435, 3);
     splitter1.TabStop                      = false;
     xpathPanel.Controls.Add(filterDescription);
     xpathPanel.Controls.Add(lblDescription);
     xpathPanel.Controls.Add(filterName);
     xpathPanel.Controls.Add(lblName);
     xpathPanel.Controls.Add(btnOk);
     xpathPanel.Controls.Add(btnCancel);
     xpathPanel.Controls.Add(lblXPath);
     xpathPanel.Controls.Add(xpathExpression);
     xpathPanel.Dock              = System.Windows.Forms.DockStyle.Fill;
     xpathPanel.Location          = new System.Drawing.Point(287, 286);
     xpathPanel.Name              = "xpathPanel";
     xpathPanel.Size              = new System.Drawing.Size(435, 255);
     xpathPanel.TabStop           = false;
     filterDescription.Location   = new System.Drawing.Point(127, 59);
     filterDescription.MaxLength  = 512;
     filterDescription.Multiline  = true;
     filterDescription.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
     filterDescription.Name       = "filterDescription";
     filterDescription.Size       = new System.Drawing.Size(306, 50);
     filterDescription.TabIndex   = 7;
     lblDescription.AutoSize      = true;
     lblDescription.Location      = new System.Drawing.Point(8, 59);
     lblDescription.Name          = "lblDescription";
     lblDescription.Size          = new System.Drawing.Size(0, 0);
     lblDescription.Text          = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("CF_FD");
     lblDescription.TabIndex      = 6;
     filterName.Location          = new System.Drawing.Point(127, 16);
     filterName.MaxLength         = 255;
     filterName.Name              = "filterName";
     filterName.Size              = new System.Drawing.Size(306, 20);
     filterName.TabIndex          = 5;
     lblName.AutoSize             = true;
     lblName.Location             = new System.Drawing.Point(8, 16);
     lblName.Name               = "lblName";
     lblName.Size               = new System.Drawing.Size(0, 0);
     lblName.Text               = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("CF_FN");
     lblName.TabIndex           = 4;
     btnOk.Location             = new System.Drawing.Point(278, 225);
     btnOk.Name                 = "btnOk";
     btnOk.Size                 = new System.Drawing.Size(75, 23);
     btnOk.TabIndex             = 0;
     btnOk.Text                 = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("Btn_OK");
     btnOk.Click               += new System.EventHandler(btnOk_Click);
     btnCancel.CausesValidation = false;
     btnCancel.DialogResult     = System.Windows.Forms.DialogResult.Cancel;
     btnCancel.Location         = new System.Drawing.Point(359, 225);
     btnCancel.Name             = "btnCancel";
     btnCancel.Size             = new System.Drawing.Size(75, 23);
     btnCancel.Text             = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("Btn_Cancel");
     btnCancel.TabIndex         = 1;
     lblXPath.AutoSize          = true;
     lblXPath.Location          = new System.Drawing.Point(8, 131);
     lblXPath.Name              = "lblXPath";
     lblXPath.Size              = new System.Drawing.Size(0, 0);
     lblXPath.Text              = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("CF_XPathExpression2");
     lblXPath.TabStop           = false;
     xpathExpression.ReadOnly   = true;
     xpathExpression.Location   = new System.Drawing.Point(127, 131);
     xpathExpression.Multiline  = true;
     xpathExpression.MaxLength  = 5120;
     xpathExpression.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
     xpathExpression.Name       = "xpathExpression";
     xpathExpression.Size       = new System.Drawing.Size(306, 83);
     xpathExpression.TabStop    = false;
     base.AutoScaleDimensions   = new System.Drawing.SizeF(6f, 13f);
     base.AutoScaleMode         = System.Windows.Forms.AutoScaleMode.Font;
     base.CancelButton          = btnCancel;
     base.ClientSize            = new System.Drawing.Size(722, 541);
     base.Controls.Add(xpathPanel);
     base.Controls.Add(splitter1);
     base.Controls.Add(rightPanel);
     base.Controls.Add(splitter);
     base.Controls.Add(leftPanel);
     Text = Microsoft.Tools.ServiceModel.TraceViewer.SR.GetString("CF_NewCustomFilterDlgName");
     base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     base.MaximizeBox     = false;
     base.MinimizeBox     = false;
     base.Name            = "CreateCustomFilterByTemplateDialog";
     base.ShowInTaskbar   = false;
     base.StartPosition   = System.Windows.Forms.FormStartPosition.CenterParent;
     leftPanel.ResumeLayout(performLayout: false);
     leftPanel.PerformLayout();
     toolStrip1.ResumeLayout(performLayout: false);
     rightPanel.ResumeLayout(performLayout: false);
     ((System.ComponentModel.ISupportInitialize)logicGrid).EndInit();
     xpathPanel.ResumeLayout(performLayout: false);
     xpathPanel.PerformLayout();
     ResumeLayout(performLayout: false);
 }
Exemple #22
0
        /// <summary>
        /// </summary>
        /// <param name="container"></param>
        /// <param name="layoutEventArgs"></param>
        /// <returns></returns>
        public override bool Layout(object composite, LayoutEventArgs layoutEventArgs)
        {
            /// <summary> layout the MgSplitContainer and all his children</summary>
            //protected internal void layout(Composite composite, bool flushCache)
            //{
            MgSplitContainer mgSplitContainer = (MgSplitContainer)composite;

            //Sometime we need to ignore the layout, when we doing move to control
            if (mgSplitContainer.IgnoreLayout)
            {
                return(true);
            }

            double[] ratios       = null;
            int      totalOrgSize = 0;

            Rectangle clientArea = mgSplitContainer.ClientRectangle;

            if (clientArea.Width <= 1 || clientArea.Height <= 1)
            {
                return(false);
            }

            // get the controls on the mgSplitContainer (without the splitter, and only the visible)
            Control[] controls = mgSplitContainer.getControls(false);
            if (controls.Length == 0)
            {
                return(false);
            }
            //      if (allControlsHaveBounds(controls) == false)
            //         return;

            // check the splitter controls
            // checkSplitterControls(MgSplitContainer, controls);

            // check the direction shell was reduce or increased
            bool      parentReduced  = false;
            Rectangle lastClientArea = mgSplitContainer.LastClientArea;

            if (clientArea.Width < lastClientArea.Width || clientArea.Height < lastClientArea.Height)
            {
                parentReduced = true;
            }
            ((TagData)mgSplitContainer.Tag).RepaintRect = lastClientArea;

            // save the last client Area, for the next time
            mgSplitContainer.LastClientArea = GuiUtils.copyRect(clientArea);

            // get the array to the splitter controls
            Splitter[] splitters = new Splitter[mgSplitContainer.Splitters.Count];
            for (int i = 0; i < mgSplitContainer.Splitters.Count; i++)
            {
                Splitter s = mgSplitContainer.Splitters[i];
                splitters[i] = s;
            }

            //MOVE TO mgSplitContainer!!!
            // for the out most MgSplitContainer form we need to change the client rect, not to include the offset
            if (GuiUtils.isOutmostMgSplitContainer(mgSplitContainer))
            {
                clientArea.X      += (MgSplitContainer.SPLITTER_WIDTH / 2);
                clientArea.Y      += (MgSplitContainer.SPLITTER_WIDTH / 2);
                clientArea.Width  -= MgSplitContainer.SPLITTER_WIDTH;
                clientArea.Height -= MgSplitContainer.SPLITTER_WIDTH;
            }

            // check if we need to update the original size at the end of the method?
            bool saveSizeAtTheEnd = ratiosWillChange(parentReduced, mgSplitContainer.getOrientation(), controls);

            bool checkPlacement   = true;
            bool checkMinimumSize = parentReduced;
            bool calcByMinSize    = true;

            // get the dynamic client area by checking the placement & minimum size(only when we decrease)
            int areaS = calcAreaS(mgSplitContainer, clientArea, controls, splitters, checkPlacement, checkMinimumSize, false);

            // get the total minimum size by checking the placement & minimum size(only when we decrease)
            int totalMinimumSize = getTotalSizeOfControls(controls, mgSplitContainer.getOrientation(), true, calcByMinSize, checkPlacement, checkMinimumSize);

            // flag to set if we ignore the minimum size: Minimum size is ignored when
            // 1. increasing the size
            // or
            // 2. reducing the size and the total minimum size is greater than the dynamic client area
            //    and when we not on outmost MgSplitContainer
            bool ignoreMinSize = false;

            if (!GuiUtils.isOutmostMgSplitContainer(mgSplitContainer) && !GuiUtils.isDirectChildOfOutmostMgSplitContainer(mgSplitContainer))
            {
                ignoreMinSize = true;
            }

            checkPlacement   = false;
            checkMinimumSize = false;
            calcByMinSize    = false;
            if (areaS > 0)
            {
                if (!parentReduced)
                {
                    output(mgSplitContainer.getOrientation(), "Area ", "1");
                    // Check the placement property and ignore the minimum size
                    ignoreMinSize    = true;
                    checkPlacement   = true;
                    checkMinimumSize = false;
                }
                else if (areaS < totalMinimumSize)
                // parentReduced is true
                {
                    output(mgSplitContainer.getOrientation(), "Area ", "2");
                    // when reduce and the dynamic client area is > total minimum size we need to ignore also the
                    // placement and the minimum size, all the controls will be in the resize
                    ignoreMinSize    = true;
                    checkPlacement   = false;
                    checkMinimumSize = false;
                }
                else
                {
                    output(mgSplitContainer.getOrientation(), "Area ", "3");
                    // when parentReduced && areaS > totalMinimumSize, check the placement and minimum size
                    checkPlacement   = true;
                    checkMinimumSize = true;
                }
            }
            // If the dynamic client area is little than or equal to zero then
            // if (areaS <= 0)
            else
            {
                output(mgSplitContainer.getOrientation(), "Area ", "<0");
                output(mgSplitContainer.getOrientation(), "areaS < totalMinimumSize? ", " " + (areaS < totalMinimumSize));

                // when we on outmost MgSplitContainer :use the minimum sizes as the weights.
                if (GuiUtils.isOutmostMgSplitContainer(mgSplitContainer))
                {
                    Debug.Assert(false);
                    // output(mgSplitContainer.getOrientation(), "calByMinSize ", " " + calcByMinSize);
                    // checkPlacement = false;
                    // checkMinimumSize = false;
                    // calcByMinSize = true;
                }
                // when we not in outmost MgSplitContainer :save the size in the org size and cal with ignore all the
                // placemetn & min size
                // if (!GuiUtils.isOutmostMgSplitContainer(mgSplitContainer))
                else
                {
                    output(mgSplitContainer.getOrientation(), "calByMinSize ", " " + calcByMinSize);
                    checkPlacement   = false;
                    checkMinimumSize = false;
                    calcByMinSize    = false;
                }
            }

            // get the dynamic client area according to the init members
            areaS = calcAreaS(mgSplitContainer, clientArea, controls, splitters, checkPlacement, checkMinimumSize, calcByMinSize);
            // get the total size according to the init members
            totalOrgSize = getTotalSizeOfControls(controls, mgSplitContainer.getOrientation(), true, calcByMinSize, checkPlacement, checkMinimumSize);
            // get the ratios according to the init members
            ratios = calcRatios(controls, mgSplitContainer.getOrientation(), totalOrgSize, checkPlacement, checkMinimumSize, calcByMinSize, areaS, ref saveSizeAtTheEnd);

            output(mgSplitContainer.getOrientation(), "areaS ", " " + areaS);

            // 6. order the controls and splitters
            //TODOR: border is all the time 0 // int splitterWidth = splitters.Length > 0 ? MgSplitContainer.SPLITTER_WIDTH + splitters[0].getBorderWidth() * 2 : MgSplitContainer.SPLITTER_WIDTH;
            int splitterWidth = MgSplitContainer.SPLITTER_WIDTH;

            if (mgSplitContainer.getOrientation() == MgSplitContainer.SPLITTER_STYLE_HORIZONTAL)
            {
                int width = ratios[0] != -1 ? (int)(areaS * ratios[0]) : getOrgSize(controls[0]).X;
                if (!ignoreMinSize)
                {
                    width = Math.Max(width, getMinimunSize(controls[0]).X);
                }
                int x = clientArea.X;

                // fixed bug #:293109, while the user is do resize we need to save te bound
                GuiUtils.controlSetBounds(controls[0], x, clientArea.Y, (int)width, clientArea.Height);
                SetNewSaveBound(controls[0], x, clientArea.Y, (int)width, clientArea.Height);

                x += width;

                if (controls.Length > 1)
                {
                    ((TagData)splitters[splitters.Length - 1].Tag).RepaintRect = splitters[splitters.Length - 1].Bounds;
                    GuiUtils.controlSetBounds(splitters[splitters.Length - 1], x, clientArea.Y, splitterWidth, clientArea.Height);
                    x    += splitterWidth;
                    width = clientArea.Width - (x - clientArea.X);
                    if (!ignoreMinSize)
                    {
                        width = Math.Max(width, getMinimunSize(controls[controls.Length - 1]).X);
                    }

                    GuiUtils.controlSetBounds(controls[controls.Length - 1], x, clientArea.Y, width, clientArea.Height);
                    SetNewSaveBound(controls[controls.Length - 1], x, clientArea.Y, width, clientArea.Height);
                }
            }
            else if (mgSplitContainer.getOrientation() == MgSplitContainer.SPLITTER_STYLE_VERTICAL)
            {
                int height = ratios[0] != -1 ? (int)(areaS * ratios[0]) : getOrgSize(controls[0]).Y;
                if (!ignoreMinSize)
                {
                    height = Math.Max(height, getMinimunSize(controls[0]).Y);
                }

                int y = clientArea.Y;
                GuiUtils.controlSetBounds(controls[0], clientArea.X, clientArea.Y, clientArea.Width, height);
                SetNewSaveBound(controls[0], clientArea.X, clientArea.Y, clientArea.Width, height);
                y += height;

                if (controls.Length > 1)
                {
                    ((TagData)splitters[splitters.Length - 1].Tag).RepaintRect = splitters[splitters.Length - 1].Bounds;
                    GuiUtils.controlSetBounds(splitters[splitters.Length - 1], clientArea.X, y, clientArea.Width, splitterWidth);
                    SetNewSaveBound(splitters[splitters.Length - 1], clientArea.X, y, clientArea.Width, splitterWidth);

                    y     += splitterWidth;
                    height = clientArea.Height - (y - clientArea.Y);
                    if (!ignoreMinSize)
                    {
                        height = Math.Max(height, getMinimunSize(controls[controls.Length - 1]).Y);
                    }
                    GuiUtils.controlSetBounds(controls[controls.Length - 1], clientArea.X, y, clientArea.Width, height);
                    SetNewSaveBound(controls[controls.Length - 1], clientArea.X, y, clientArea.Width, height);
                }
            }

            if (saveSizeAtTheEnd)
            {
                for (int k = 0; k < controls.Length; k++)
                {
                    Rectangle rect = controls[k].Bounds;
                    setOrgSizeBy(controls[k], rect.Width, rect.Height);
                }
            }

            return(true);
        }
Exemple #23
0
        public void MASTER_TABLE_READ(string _TARIFE_KODU, string _FILITRE_TEXT, string _TARIFE_ID, string _BASLIKLAR, string _MECRA_TURU)
        {
            try
            {
                string TAB_VARMI = "YOK";
                int    TabCount  = 0;
                for (int i = 0; i < xtraTabControl_MASTER_MNG_DETAY.TabPages.Count; i++)
                {
                    if (xtraTabControl_MASTER_MNG_DETAY.TabPages[i].Name == _TARIFE_KODU)
                    {
                        TAB_VARMI = "VAR"; TabCount = i;
                        break;
                    }
                }
                if (TAB_VARMI == "YOK")
                {
                    if (_TARIFE_KODU != null)
                    {
                        grdCntrl_ = new DevExpress.XtraGrid.GridControl();
                        gridView_ = new DevExpress.XtraGrid.Views.Grid.GridView();
                        ds        = new DataSet();
                        using (SqlConnection conn = new SqlConnection(_GLOBAL_PARAMETRELER._CONNECTION_STRING.ToString()))
                        {
                            SqlDataAdapter adapter = new SqlDataAdapter()
                            {
                                SelectCommand = new SqlCommand(string.Format("SELECT  CAST('' as nvarchar ) NEW, * FROM  dbo.__MAS_EDT_{0}_{1}", _TARIFE_ID, _TARIFE_KODU), conn)
                            };
                            adapter.Fill(ds, "TRF_MASTER");
                            DataViewManager dvManager      = new DataViewManager(ds);
                            DataView        DW_LIST_TARIFE = dvManager.CreateDataView(ds.Tables[0]);
                            grdCntrl_.DataSource = DW_LIST_TARIFE;
                        }
                    }


                    System.Windows.Forms.ToolStripStatusLabel TOOL_FILITRE        = new ToolStripStatusLabel();
                    System.Windows.Forms.ToolStripProgressBar TOOL_PROGRESS       = new ToolStripProgressBar();
                    System.Windows.Forms.ToolStripStatusLabel TOOL_ID             = new ToolStripStatusLabel();
                    System.Windows.Forms.ToolStripStatusLabel TOOL_FILE_NAME      = new ToolStripStatusLabel();
                    System.Windows.Forms.ToolStripStatusLabel TOOL_TXT_MECRA_TURU = new ToolStripStatusLabel();


                    TARIFE_KODU              = _TARIFE_KODU;
                    TOOL_FILITRE.Text        = _FILITRE_TEXT;
                    TOOL_ID.Text             = _TARIFE_ID;
                    TOOL_FILE_NAME.Text      = _TARIFE_KODU;
                    TOOL_TXT_MECRA_TURU.Text = _MECRA_TURU;

                    System.Windows.Forms.StatusStrip statusStrips = new StatusStrip();
                    statusStrips.Items.Add(TOOL_ID);
                    statusStrips.Items.Add(TOOL_FILITRE);
                    statusStrips.Items.Add(TOOL_FILE_NAME);
                    statusStrips.Items.Add(TOOL_TXT_MECRA_TURU);
                    statusStrips.Items.Add(TOOL_PROGRESS);
                    statusStrips.SendToBack();


                    xtraTabControl_MASTER_MNG_DETAY.TabPages.Add("");
                    xtraTabControl_MASTER_MNG_DETAY.TabPages[xtraTabControl_MASTER_MNG_DETAY.TabPages.Count - 1].Controls.Add(grdCntrl_);
                    xtraTabControl_MASTER_MNG_DETAY.TabPages[xtraTabControl_MASTER_MNG_DETAY.TabPages.Count - 1].Name             = TOOL_FILE_NAME.Text;
                    xtraTabControl_MASTER_MNG_DETAY.TabPages[xtraTabControl_MASTER_MNG_DETAY.TabPages.Count - 1].Text             = TOOL_FILE_NAME.Text;
                    xtraTabControl_MASTER_MNG_DETAY.TabPages[xtraTabControl_MASTER_MNG_DETAY.TabPages.Count - 1].Tag              = _TARIFE_ID;
                    xtraTabControl_MASTER_MNG_DETAY.TabPages[xtraTabControl_MASTER_MNG_DETAY.TabPages.Count - 1].ContextMenuStrip = CNMN_TARIFE;
                    //
                    // grdCntrl_List
                    //
                    grdCntrl_.Dock             = DockStyle.Fill;
                    grdCntrl_.Location         = new System.Drawing.Point(0, 0);
                    grdCntrl_.MainView         = gridView_;
                    grdCntrl_.ContextMenuStrip = CNMN_TARIFE;
                    grdCntrl_.Name             = TARIFE_KODU;
                    grdCntrl_.Tag      = _TARIFE_ID;
                    grdCntrl_.Size     = new System.Drawing.Size(699, 368);
                    grdCntrl_.TabIndex = 1;
                    grdCntrl_.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridView_ });
                    //
                    // gridView_List
                    //
                    // gridView_.ColumnPanelRowHeight = 40;
                    gridView_.GridControl = grdCntrl_;
                    gridView_.Name        = TARIFE_KODU;
                    gridView_.Tag         = _TARIFE_ID;
                    gridView_.OptionsView.ShowGroupPanel = false;
                    //gridView_.OptionsBehavior.Editable = false;
                    gridView_.OptionsView.ColumnAutoWidth      = true;
                    gridView_.OptionsSelection.MultiSelect     = true;
                    gridView_.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
                    if (_BASLIKLAR != null)
                    {
                        _BASLIKLAR = "NEW;ID;" + _BASLIKLAR;
                        string[] Onesz = _BASLIKLAR.Split(';');
                        for (int i = 0; i < Onesz.Length - 1; i++)
                        {
                            gridView_.Columns[i].Caption = Onesz[i].Trim();
                            gridView_.Columns[i].OptionsFilter.FilterPopupMode = DevExpress.XtraGrid.Columns.FilterPopupMode.CheckedList;
                        }
                    }

                    Splitter sp = new Splitter();
                    sp.Dock   = DockStyle.Bottom;
                    sp.Height = 7;
                    xtraTabControl_MASTER_MNG_DETAY.TabPages[xtraTabControl_MASTER_MNG_DETAY.TabPages.Count - 1].Controls.Add(sp);

                    if (_TARIFE_KODU != null)
                    {
                        grdCntrlVER_ = new DevExpress.XtraGrid.GridControl();
                        gridViewVER_ = new DevExpress.XtraGrid.Views.Grid.GridView();
                        DataSet dsVER = new DataSet();
                        using (SqlConnection conn = new SqlConnection(_GLOBAL_PARAMETRELER._CONNECTION_STRING.ToString()))
                        {
                            SqlDataAdapter adapter = new SqlDataAdapter()
                            {
                                SelectCommand = new SqlCommand(string.Format("SELECT  * FROM  dbo.__MAS_EDT_GENEL_VERSION ", _TARIFE_ID, _TARIFE_KODU), conn)
                            };
                            adapter.Fill(dsVER, "TRF_MASTER");
                            DataViewManager dvManager        = new DataViewManager(dsVER);
                            DataView        DW_LIST_VERSIYON = dvManager.CreateDataView(dsVER.Tables[0]);
                            grdCntrlVER_.DataSource = DW_LIST_VERSIYON;
                        }
                    }
                    xtraTabControl_MASTER_MNG_DETAY.TabPages[xtraTabControl_MASTER_MNG_DETAY.TabPages.Count - 1].Controls.Add(grdCntrlVER_);
                    //
                    // grdCntrl_List
                    //

                    grdCntrlVER_.Dock     = DockStyle.Bottom;
                    grdCntrlVER_.Location = new System.Drawing.Point(0, 0);
                    grdCntrlVER_.MainView = gridViewVER_;
                    //  grdCntrlVER_.ContextMenuStrip = CNMN_TARIFE;
                    grdCntrlVER_.Name     = TARIFE_KODU;
                    grdCntrlVER_.Tag      = _TARIFE_ID;
                    grdCntrlVER_.Size     = new System.Drawing.Size(699, 368);
                    grdCntrlVER_.TabIndex = 1;
                    grdCntrlVER_.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { gridViewVER_ });
                    //
                    // gridView_List
                    //
                    // gridView_.ColumnPanelRowHeight = 40;
                    gridViewVER_.GridControl = grdCntrlVER_;
                    gridViewVER_.Name        = TARIFE_KODU;
                    gridViewVER_.Tag         = _TARIFE_ID;
                    gridViewVER_.OptionsView.ShowGroupPanel = false;
                    //gridView_.OptionsBehavior.Editable = false;
                    gridViewVER_.OptionsView.ColumnAutoWidth      = true;
                    gridViewVER_.OptionsSelection.MultiSelect     = true;
                    gridViewVER_.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CellSelect;
                    //if (tmp._BASLIKLAR != null)
                    //{
                    //    tmp._BASLIKLAR = "ID;" + tmp._BASLIKLAR;
                    //    string[] Onesz = tmp._BASLIKLAR.Split(';');
                    //    for (int i = 0; i < Onesz.Length - 1; i++)
                    //    {
                    //        gridView_.Columns[i].Caption = Onesz[i].Trim();
                    //        gridView_.Columns[i].OptionsFilter.FilterPopupMode = DevExpress.XtraGrid.Columns.FilterPopupMode.CheckedList;
                    //    }
                    //}

                    //System.Windows.Forms.StatusStrip statusStrips = new StatusStrip();
                    //statusStrips.Items.Add(TOOL_ID);
                    //statusStrips.Items.Add(TOOL_FILITRE);
                    //statusStrips.Items.Add(TOOL_FILE_NAME);
                    //statusStrips.Items.Add(TOOL_PROGRESS);
                    //statusStrips.SendToBack();
                    xtraTabControl_MASTER_MNG_DETAY.TabPages[xtraTabControl_MASTER_MNG_DETAY.TabPages.Count - 1].Controls.Add(statusStrips);
                    grdCntrlVER_.Height = 120;


                    gridView_.RowStyle += GridView__RowStyle;
                }
                else
                {
                    grdCntrl_ = new DevExpress.XtraGrid.GridControl();
                    var status = xtraTabControl_MASTER_MNG_DETAY.TabPages[TabCount].Controls[1];
                    //System.Windows.Forms.StatusStrip strtp = new StatusStrip();
                    //strtp = (System.Windows.Forms.StatusStrip)status;
                    //strtp.Items[0].Text = tmp._TARIFE_ID;
                    //strtp.Items[1].Text = tmp._FILITRE_TEXT;
                    //strtp.Items[2].Text = tmp._TARIFE_KODU;
                    //strtp.Items[3].Text = "";
                    var rtb = xtraTabControl_MASTER_MNG_DETAY.TabPages[TabCount].Controls[0];
                    grdCntrl_ = (DevExpress.XtraGrid.GridControl)rtb;
                    gridView_ = (DevExpress.XtraGrid.Views.Grid.GridView)grdCntrl_.DefaultView;
                    DataSet ds = new DataSet();
                    using (SqlConnection conn = new SqlConnection(_GLOBAL_PARAMETRELER._CONNECTION_STRING.ToString()))
                    {
                        SqlDataAdapter adapter = new SqlDataAdapter()
                        {
                            SelectCommand = new SqlCommand(string.Format("SELECT * FROM     dbo.__MAS_EDT_{0}_{1}", _TARIFE_ID, _TARIFE_KODU), conn)
                        };
                        adapter.Fill(ds, "TRF_MASTER");
                        DataViewManager dvManager      = new DataViewManager(ds);
                        DataView        DW_LIST_TARIFE = dvManager.CreateDataView(ds.Tables[0]);
                        grdCntrl_.DataSource = DW_LIST_TARIFE;
                    }

                    grdCntrlVER_ = new DevExpress.XtraGrid.GridControl();
                    var rtbver = xtraTabControl_MASTER_MNG_DETAY.TabPages[TabCount].Controls[2];
                    grdCntrlVER_ = (DevExpress.XtraGrid.GridControl)rtbver;
                    gridViewVER_ = (DevExpress.XtraGrid.Views.Grid.GridView)grdCntrlVER_.DefaultView;
                    DataSet dsVer = new DataSet();
                    using (SqlConnection conn = new SqlConnection(_GLOBAL_PARAMETRELER._CONNECTION_STRING.ToString()))
                    {
                        SqlDataAdapter adapter = new SqlDataAdapter()
                        {
                            SelectCommand = new SqlCommand(string.Format("SELECT  * FROM  dbo.__MAS_EDT_GENEL_VERSION ", _TARIFE_ID, _TARIFE_KODU), conn)
                        };
                        adapter.Fill(dsVer, "TRF_MASTER_VER");
                        DataViewManager dvManager   = new DataViewManager(dsVer);
                        DataView        DW_LIST_VER = dvManager.CreateDataView(dsVer.Tables[0]);
                        grdCntrlVER_.DataSource = DW_LIST_VER;
                    }
                }



                if (gridView_.Columns["ID"] != null)
                {
                    gridView_.Columns["ID"].Visible = false;
                }
                if (gridView_.Columns["GUID"] != null)
                {
                    gridView_.Columns["GUID"].Visible = false;
                }
                if (gridView_.Columns["NEW"] != null)
                {
                    gridView_.Columns["NEW"].Visible = false;
                }
                if (gridView_.Columns["DAHIL_HARIC"] != null)
                {
                    gridView_.Columns["DAHIL_HARIC"].Width = 40;
                }
                if (gridView_.Columns["ALT"] != null)
                {
                    gridView_.Columns["ALT"].Width = 20;
                }


                if (gridViewVER_.Columns["ID"] != null)
                {
                    gridViewVER_.Columns["ID"].Visible = false;
                }
                if (gridViewVER_.Columns["GUID"] != null)
                {
                    gridViewVER_.Columns["GUID"].Visible = false;
                }
                if (gridViewVER_.Columns["RAPOR_KODU"] != null)
                {
                    gridViewVER_.Columns["RAPOR_KODU"].Visible = false;
                }
                if (gridViewVER_.Columns["RAPOR_ID"] != null)
                {
                    gridViewVER_.Columns["RAPOR_ID"].Visible = false;
                }
                if (gridViewVER_.Columns["SIRKET_KODU"] != null)
                {
                    gridViewVER_.Columns["SIRKET_KODU"].Visible = false;
                }
                if (gridViewVER_.Columns["DAHIL_HARIC"] != null)
                {
                    gridViewVER_.Columns["DAHIL_HARIC"].Width = 40;
                }
            }
            catch (Exception EX)
            { MessageBox.Show(EX.Data.ToString()); }
        }
Exemple #24
0
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SpinView));
     this.objectView     = new System.Windows.Forms.TreeView();
     this.hexView        = new System.Windows.Forms.Panel();
     this.toolStrip1     = new System.Windows.Forms.ToolStrip();
     this.analizeButton  = new System.Windows.Forms.ToolStripButton();
     this.scrollPosition = new System.Windows.Forms.VScrollBar();
     this.splitter1      = new System.Windows.Forms.Splitter();
     this.toolStrip1.SuspendLayout();
     this.SuspendLayout();
     //
     // objectView
     //
     this.objectView.Dock         = System.Windows.Forms.DockStyle.Left;
     this.objectView.Indent       = 15;
     this.objectView.Location     = new System.Drawing.Point(0, 25);
     this.objectView.Name         = "objectView";
     this.objectView.Size         = new System.Drawing.Size(193, 424);
     this.objectView.TabIndex     = 0;
     this.objectView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.SelectChanged);
     //
     // hexView
     //
     this.hexView.Dock         = System.Windows.Forms.DockStyle.Fill;
     this.hexView.Location     = new System.Drawing.Point(193, 25);
     this.hexView.Name         = "hexView";
     this.hexView.Size         = new System.Drawing.Size(415, 424);
     this.hexView.TabIndex     = 1;
     this.hexView.MouseClick  += new System.Windows.Forms.MouseEventHandler(this.hexView_MouseClick);
     this.hexView.Paint       += new System.Windows.Forms.PaintEventHandler(this.OnPaint);
     this.hexView.SizeChanged += new System.EventHandler(this.OnSize);
     //
     // toolStrip1
     //
     this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.analizeButton
     });
     this.toolStrip1.Location = new System.Drawing.Point(0, 0);
     this.toolStrip1.Name     = "toolStrip1";
     this.toolStrip1.Size     = new System.Drawing.Size(625, 25);
     this.toolStrip1.TabIndex = 0;
     this.toolStrip1.Text     = "toolStrip1";
     //
     // analizeButton
     //
     this.analizeButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     this.analizeButton.Image                 = ((System.Drawing.Image)(resources.GetObject("analizeButton.Image")));
     this.analizeButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.analizeButton.Name   = "analizeButton";
     this.analizeButton.Size   = new System.Drawing.Size(57, 22);
     this.analizeButton.Text   = "Reanalize";
     this.analizeButton.Click += new System.EventHandler(this.analizeButton_Click);
     //
     // scrollPosition
     //
     this.scrollPosition.Dock        = System.Windows.Forms.DockStyle.Right;
     this.scrollPosition.LargeChange = 16;
     this.scrollPosition.Location    = new System.Drawing.Point(608, 25);
     this.scrollPosition.Maximum     = 65535;
     this.scrollPosition.Name        = "scrollPosition";
     this.scrollPosition.Size        = new System.Drawing.Size(17, 424);
     this.scrollPosition.TabIndex    = 0;
     this.scrollPosition.TabStop     = true;
     this.scrollPosition.Scroll     += new System.Windows.Forms.ScrollEventHandler(this.OnScroll);
     //
     // splitter1
     //
     this.splitter1.Location = new System.Drawing.Point(193, 25);
     this.splitter1.Name     = "splitter1";
     this.splitter1.Size     = new System.Drawing.Size(3, 424);
     this.splitter1.TabIndex = 2;
     this.splitter1.TabStop  = false;
     //
     // SpinView
     //
     this.Controls.Add(this.splitter1);
     this.Controls.Add(this.hexView);
     this.Controls.Add(this.objectView);
     this.Controls.Add(this.scrollPosition);
     this.Controls.Add(this.toolStrip1);
     this.Name = "SpinView";
     this.Size = new System.Drawing.Size(625, 449);
     this.toolStrip1.ResumeLayout(false);
     this.toolStrip1.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
 /// <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.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(DxMain));
     this.imageList1 = new System.Windows.Forms.ImageList(this.components);
     this.listView1 = new System.Windows.Forms.ListView();
     this.imageList2 = new System.Windows.Forms.ImageList(this.components);
     this.treeView1 = new System.Windows.Forms.TreeView();
     this.splitter1 = new System.Windows.Forms.Splitter();
     this.mainMenu1 = new System.Windows.Forms.MainMenu();
     this.menuItem1 = new System.Windows.Forms.MenuItem();
     this.menuItem3 = new System.Windows.Forms.MenuItem();
     this.menuItem9 = new System.Windows.Forms.MenuItem();
     this.menuItem10 = new System.Windows.Forms.MenuItem();
     this.menuItem11 = new System.Windows.Forms.MenuItem();
     this.menuItem13 = new System.Windows.Forms.MenuItem();
     this.menuItem5 = new System.Windows.Forms.MenuItem();
     this.menuItem12 = new System.Windows.Forms.MenuItem();
     this.menuItem4 = new System.Windows.Forms.MenuItem();
     this.menuItem8 = new System.Windows.Forms.MenuItem();
     this.status = new System.Windows.Forms.StatusBar();
     this.timer1 = new System.Windows.Forms.Timer(this.components);
     this.SuspendLayout();
     //
     // imageList1
     //
     this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
     this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
     this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
     //
     // listView1
     //
     this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.listView1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.listView1.FullRowSelect = true;
     this.listView1.LabelEdit = true;
     this.listView1.LargeImageList = this.imageList2;
     this.listView1.Location = new System.Drawing.Point(216, 0);
     this.listView1.Name = "listView1";
     this.listView1.Size = new System.Drawing.Size(352, 324);
     this.listView1.TabIndex = 5;
     this.listView1.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.listView1_AfterLabelEdit);
     this.listView1.BeforeLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.listView1_BeforeLabelEdit);
     this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
     //
     // imageList2
     //
     this.imageList2.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     this.imageList2.ImageSize = new System.Drawing.Size(16, 16);
     this.imageList2.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList2.ImageStream")));
     this.imageList2.TransparentColor = System.Drawing.Color.Transparent;
     //
     // treeView1
     //
     this.treeView1.Dock = System.Windows.Forms.DockStyle.Left;
     this.treeView1.FullRowSelect = true;
     this.treeView1.ImageList = this.imageList1;
     this.treeView1.Name = "treeView1";
     this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
                                                                             new System.Windows.Forms.TreeNode("System")});
     this.treeView1.ShowPlusMinus = false;
     this.treeView1.ShowRootLines = false;
     this.treeView1.Size = new System.Drawing.Size(216, 324);
     this.treeView1.TabIndex = 4;
     this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
     //
     // splitter1
     //
     this.splitter1.Location = new System.Drawing.Point(216, 0);
     this.splitter1.Name = "splitter1";
     this.splitter1.Size = new System.Drawing.Size(3, 324);
     this.splitter1.TabIndex = 6;
     this.splitter1.TabStop = false;
     //
     // mainMenu1
     //
     this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                                 this.menuItem1,
                                                                                 this.menuItem9,
                                                                                 this.menuItem4});
     //
     // menuItem1
     //
     this.menuItem1.Index = 0;
     this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                                 this.menuItem3});
     this.menuItem1.Text = "Explorer";
     //
     // menuItem3
     //
     this.menuItem3.Index = 0;
     this.menuItem3.Shortcut = System.Windows.Forms.Shortcut.CtrlX;
     this.menuItem3.Text = "Close";
     this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
     //
     // menuItem9
     //
     this.menuItem9.Index = 1;
     this.menuItem9.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                                 this.menuItem10,
                                                                                 this.menuItem11,
                                                                                 this.menuItem13,
                                                                                 this.menuItem5,
                                                                                 this.menuItem12});
     this.menuItem9.Text = "Edit";
     //
     // menuItem10
     //
     this.menuItem10.Index = 0;
     this.menuItem10.Shortcut = System.Windows.Forms.Shortcut.CtrlC;
     this.menuItem10.Text = "Copy";
     this.menuItem10.Click += new System.EventHandler(this.menuItem10_Click);
     //
     // menuItem11
     //
     this.menuItem11.Index = 1;
     this.menuItem11.Shortcut = System.Windows.Forms.Shortcut.CtrlV;
     this.menuItem11.Text = "Paste";
     this.menuItem11.Click += new System.EventHandler(this.menuItem11_Click);
     //
     // menuItem13
     //
     this.menuItem13.Index = 2;
     this.menuItem13.Shortcut = System.Windows.Forms.Shortcut.CtrlR;
     this.menuItem13.Text = "Rename";
     //
     // menuItem5
     //
     this.menuItem5.Index = 3;
     this.menuItem5.Shortcut = System.Windows.Forms.Shortcut.Del;
     this.menuItem5.Text = "Delete";
     this.menuItem5.Click += new System.EventHandler(this.menuItem5_Click);
     //
     // menuItem12
     //
     this.menuItem12.Index = 4;
     this.menuItem12.Shortcut = System.Windows.Forms.Shortcut.CtrlD;
     this.menuItem12.Text = "Find";
     this.menuItem12.Click += new System.EventHandler(this.menuItem12_Click);
     //
     // menuItem4
     //
     this.menuItem4.Index = 2;
     this.menuItem4.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                                 this.menuItem8});
     this.menuItem4.Text = "Help";
     //
     // menuItem8
     //
     this.menuItem8.Index = 0;
     this.menuItem8.Text = "About";
     this.menuItem8.Click += new System.EventHandler(this.menuItem8_Click);
     //
     // status
     //
     this.status.Location = new System.Drawing.Point(219, 302);
     this.status.Name = "status";
     this.status.Size = new System.Drawing.Size(349, 22);
     this.status.TabIndex = 7;
     //
     // timer1
     //
     this.timer1.Tick += new System.EventHandler(TimerEventProcessor);
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(568, 324);
     this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                     this.status,
                                                                     this.splitter1,
                                                                     this.listView1,
                                                                     this.treeView1});
     this.Menu = this.mainMenu1;
     this.Name = "Form1";
     this.Text = "dX - Discover and Explore";
     this.Load += new System.EventHandler(this.Form1_Load);
     this.ResumeLayout(false);
 }
Exemple #26
0
        void Init()
        {
            var leftcontainer  = new TableLayout();
            var rightcontainer = new TableLayout();

            var ti1 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "New Script", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-new.png", this.GetType().Assembly)).WithSize(16, 16)
            };
            var ti2 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Update Selected", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-approve_and_update.png", this.GetType().Assembly)).WithSize(16, 16)
            };
            var ti3 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Print", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-print.png", this.GetType().Assembly)).WithSize(16, 16)
            };
            var ti3a = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Remove Selected", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-filled_trash.png", this.GetType().Assembly)).WithSize(16, 16)
            };

            var ti4 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Cut", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-cut.png", this.GetType().Assembly)).WithSize(16, 16)
            };
            var ti5 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Copy", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-copy.png", this.GetType().Assembly)).WithSize(16, 16)
            };
            var ti6 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Paste", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-paste.png", this.GetType().Assembly)).WithSize(16, 16)
            };

            var ti7 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Undo", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-undo.png", this.GetType().Assembly)).WithSize(16, 16)
            };
            var ti8 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Redo", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-redo.png", this.GetType().Assembly)).WithSize(16, 16)
            };

            var ti9 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, Text = "", ToolTip = "Toggle Comment/Uncomment Selected Lines", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-code.png", this.GetType().Assembly)).WithSize(16, 16)
            };

            var ti10 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Indent Right", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "indent-right.png", this.GetType().Assembly)).WithSize(16, 16)
            };
            var ti11 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Indent Left", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "left-indentation-option.png", this.GetType().Assembly)).WithSize(16, 16)
            };

            var ti12 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Decrease Font Size", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-decrease_font.png", this.GetType().Assembly)).WithSize(16, 16)
            };
            var ti13 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Increase Font Size", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-increase_font.png", this.GetType().Assembly)).WithSize(16, 16)
            };

            var ti14 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, Text = "", ToolTip = "Insert Snippet", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "code.png", this.GetType().Assembly)).WithSize(16, 16)
            };

            var ti15 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Run Script", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-play.png", this.GetType().Assembly)).WithSize(16, 16)
            };
            var ti16 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, ToolTip = "Run Script (Async)", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-circled_play.png", this.GetType().Assembly)).WithSize(16, 16)
            };

            var ti17 = new Button()
            {
                ImagePosition = ButtonImagePosition.Overlay, Height = 24, Width = 24, Text = "", ToolTip = "Help", Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-help.png", this.GetType().Assembly)).WithSize(16, 16)
            };

            var l1 = new Label()
            {
                VerticalAlignment = VerticalAlignment.Bottom, Text = "Rename", Font = new Font(SystemFont.Default, UI.Shared.Common.GetEditorFontSize())
            };

            var t1 = new TextBox {
                Width = 250
            };

            lbScripts = new ListBox();

            ScriptEditor = new ScriptItem(Flowsheet);

            leftcontainer.Rows.Add(new Label {
                Text = "Script List", Font = new Font(SystemFont.Bold, UI.Shared.Common.GetEditorFontSize()), Height = 30, VerticalAlignment = VerticalAlignment.Center
            });

            if (Application.Instance.Platform.IsGtk)
            {
                ti1.Size  = new Size(30, 30);
                ti2.Size  = new Size(30, 30);
                ti3.Size  = new Size(30, 30);
                ti3a.Size = new Size(30, 30);
            }

            var menu1 = new StackLayout
            {
                Items       = { ti1, ti2, ti3, ti3a },
                Orientation = Orientation.Horizontal,
                Spacing     = 4,
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                VerticalContentAlignment   = VerticalAlignment.Center,
                Padding = 5
            };

            leftcontainer.Rows.Add(new TableRow(menu1));

            leftcontainer.Rows.Add(new TableRow(lbScripts));
            leftcontainer.Padding = new Padding(5, 5, 5, 5);
            leftcontainer.Spacing = new Size(0, 0);
            leftcontainer.Width   = 250;

            rightcontainer.Rows.Add(new Label {
                Text = "Selected Script", Font = new Font(SystemFont.Bold, UI.Shared.Common.GetEditorFontSize()), Height = 30, VerticalAlignment = VerticalAlignment.Center
            });

            if (Application.Instance.Platform.IsGtk)
            {
                ti4.Size  = new Size(30, 30);
                ti5.Size  = new Size(30, 30);
                ti6.Size  = new Size(30, 30);
                ti7.Size  = new Size(30, 30);
                ti8.Size  = new Size(30, 30);
                ti9.Size  = new Size(30, 30);
                ti10.Size = new Size(30, 30);
                ti11.Size = new Size(30, 30);
                ti12.Size = new Size(30, 30);
                ti13.Size = new Size(30, 30);
                ti14.Size = new Size(30, 30);
                ti15.Size = new Size(30, 30);
                ti16.Size = new Size(30, 30);
                ti17.Size = new Size(30, 30);
            }

            var menu2 = new StackLayout
            {
                Items = { ti15, ti16, new Label {
                              Text = " "
                          },
                          ti4,  ti5,  ti6, new Label{
                              Text = " "
                          },
                          ti7,  ti8,  new Label {
                              Text = " "
                          },
                          ti9,  ti10, ti11, new Label{
                              Text = " "
                          },
                          ti12, ti13, new Label {
                              Text = " "
                          },
                          ti14, new Label {
                              Text = " "
                          },
                          ti17, l1,   t1 },
                Orientation = Orientation.Horizontal,
                Spacing     = 4,
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                VerticalContentAlignment   = VerticalAlignment.Center,
                Padding = 5
            };

            rightcontainer.Rows.Add(new TableRow(menu2));

            rightcontainer.Rows.Add(new TableRow(ScriptEditor));
            rightcontainer.Padding = new Padding(5, 5, 5, 5);

            ti1.Click += (sender, e) =>
            {
                var script = new DWSIM.FlowsheetSolver.Script {
                    ID = Guid.NewGuid().ToString(), Title = "Script" + (Flowsheet.Scripts.Count + 1).ToString()
                };
                Flowsheet.Scripts.Add(script.ID, script);
                lbScripts.Items.Add(new ListItem {
                    Key = script.ID, Text = script.Title
                });
            };

            lbScripts.SelectedIndexChanged += (sender, e) =>
            {
                Application.Instance.Invoke(() =>
                {
                    try
                    {
                        if (lbScripts.SelectedIndex < 0)
                        {
                            return;
                        }

                        selecting = true;

                        if (selscript != null)
                        {
                            selscript.ScriptText = ScriptEditor.txtScript.ScriptText;
                        }

                        selscript = Flowsheet.Scripts[lbScripts.SelectedKey];

                        adding = true;

                        ScriptEditor.cbLinkedObject.Items.Clear();

                        ScriptEditor.cbLinkedObject.Items.Add(new ListItem {
                            Text = "Simulation", Key = "Simulation"
                        });
                        ScriptEditor.cbLinkedObject.Items.Add(new ListItem {
                            Text = "Solver", Key = "Solver"
                        });

                        foreach (var obj in Flowsheet.SimulationObjects.Values)
                        {
                            ScriptEditor.cbLinkedObject.Items.Add(new ListItem {
                                Text = obj.GraphicObject.Tag, Key = obj.Name
                            });
                        }

                        adding = false;

                        t1.Text = selscript.Title;

                        ScriptEditor.txtScript.ScriptText = selscript.ScriptText;

                        ScriptEditor.chkLink.Checked = selscript.Linked;

                        if (!string.IsNullOrEmpty(selscript.LinkedObjectName))
                        {
                            ScriptEditor.cbLinkedObject.SelectedKey = Flowsheet.SimulationObjects[selscript.LinkedObjectName].Name;
                        }
                        else
                        {
                            switch (selscript.LinkedObjectType)
                            {
                            case Scripts.ObjectType.Simulation:
                                ScriptEditor.cbLinkedObject.SelectedIndex = 0;
                                break;

                            case Scripts.ObjectType.Solver:
                                ScriptEditor.cbLinkedObject.SelectedIndex = 1;
                                break;
                            }
                        }

                        switch (selscript.LinkedEventType)
                        {
                        case Scripts.EventType.ObjectCalculationStarted:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 0;
                            break;

                        case Scripts.EventType.ObjectCalculationFinished:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 1;
                            break;

                        case Scripts.EventType.ObjectCalculationError:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 2;
                            break;

                        case Scripts.EventType.SimulationOpened:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 0;
                            break;

                        case Scripts.EventType.SimulationSaved:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 1;
                            break;

                        case Scripts.EventType.SimulationClosed:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 2;
                            break;

                        case Scripts.EventType.SolverStarted:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 0;
                            break;

                        case Scripts.EventType.SolverFinished:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 1;
                            break;

                        case Scripts.EventType.SolverRecycleLoop:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 2;
                            break;

                        case Scripts.EventType.SimulationTimer1:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 3;
                            break;

                        case Scripts.EventType.SimulationTimer5:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 4;
                            break;

                        case Scripts.EventType.SimulationTimer15:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 5;
                            break;

                        case Scripts.EventType.SimulationTimer30:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 6;
                            break;

                        case Scripts.EventType.SimulationTimer60:
                            ScriptEditor.cbLinkedEvent.SelectedIndex = 7;
                            break;
                        }

                        ScriptEditor.cbPythonInt.SelectedIndex = (int)selscript.PythonInterpreter;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.ToString(), MessageBoxType.Error);
                    }
                    finally {
                        selecting = false;
                    }
                });
            };

            ti3a.Click += (sender, e) =>
            {
                if (MessageBox.Show("Confirm removal of the selected script?", "Delete Script", MessageBoxButtons.YesNo, MessageBoxType.Question, MessageBoxDefaultButton.Yes) == DialogResult.Yes)
                {
                    Flowsheet.Scripts.Remove(lbScripts.SelectedKey);
                    lbScripts.Items.RemoveAt(lbScripts.SelectedIndex);
                }
            };

            ti15.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                Flowsheet.ShowMessage("Running script '" + Flowsheet.Scripts[lbScripts.SelectedKey].Title + "'...", IFlowsheet.MessageType.Information);
                Flowsheet.Scripts[lbScripts.SelectedKey].ScriptText = ScriptEditor.txtScript.ScriptText;
                Flowsheet.RunScript(lbScripts.SelectedKey);
            };

            ti16.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                Flowsheet.ShowMessage("Running script '" + Flowsheet.Scripts[lbScripts.SelectedKey].Title + "' asynchronously...", IFlowsheet.MessageType.Information);
                Flowsheet.Scripts[lbScripts.SelectedKey].ScriptText = ScriptEditor.txtScript.ScriptText;
                Flowsheet.RunScriptAsync(lbScripts.SelectedKey);
            };

            ti2.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                Flowsheet.Scripts[lbScripts.SelectedKey].ScriptText = ScriptEditor.txtScript.ScriptText;
            };

            ti3.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                ScriptEditor.txtScript.Print();
            };

            ti4.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                ScriptEditor.txtScript.Cut();
            };

            ti5.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                ScriptEditor.txtScript.Copy();
            };

            ti6.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                ScriptEditor.txtScript.Paste();
            };

            ti7.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                ScriptEditor.txtScript.Undo();
            };

            ti8.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                ScriptEditor.txtScript.Redo();
            };

            ti9.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                ScriptEditor.txtScript.ToggleCommenting();
            };

            ti10.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                ScriptEditor.txtScript.Indent();
            };

            ti11.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                ScriptEditor.txtScript.Unindent();
            };

            ti12.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                ScriptEditor.txtScript.DecreaseFontSize();
            };

            ti13.Click += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                ScriptEditor.txtScript.IncreaseFontSize();
            };

            ti14.Click += (sender, e) =>
            {
                var c1 = new ContextMenu();
                Application.Instance.Invoke(() =>
                {
                    var snippets = SharedClasses.Scripts.IronPythonSnippets.GetSnippets();
                    foreach (var group1 in snippets.GroupBy((x) => x.Category1))
                    {
                        ButtonMenuItem tsmi = new ButtonMenuItem()
                        {
                            Text = group1.Key
                        };
                        c1.Items.Add(tsmi);
                        foreach (var group2 in group1.GroupBy((x2) => x2.Category2))
                        {
                            ButtonMenuItem tsmi2 = new ButtonMenuItem()
                            {
                                Text = group2.Key
                            };
                            tsmi.Items.Add(tsmi2);
                            foreach (var snippet in group2)
                            {
                                ButtonMenuItem tsmi3 = new ButtonMenuItem()
                                {
                                    Text = snippet.Name + " (" + snippet.Scope + ")", Tag = snippet.Snippet
                                };
                                tsmi3.Click += (sender2, e2) =>
                                {
                                    ScriptEditor.txtScript.InsertSnippet(tsmi3.Tag.ToString());
                                };
                                tsmi2.Items.Add(tsmi3);
                            }
                        }
                    }
                    DWSIM.SharedClasses.Scripts.IronPythonSnippets.PopulateWithDynamicSnippets(c1, Flowsheet, (text) =>
                    {
                        ScriptEditor.txtScript.InsertSnippet(text);
                    });
                    c1.Show(ti14);
                });
            };

            ScriptEditor.chkLink.CheckedChanged += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                Flowsheet.Scripts[lbScripts.SelectedKey].Linked = ScriptEditor.chkLink.Checked.GetValueOrDefault();
            };

            ScriptEditor.cbLinkedObject.SelectedIndexChanged += cbLinkedObject_SelectedIndexChanged;

            ScriptEditor.cbLinkedEvent.SelectedIndexChanged += cbLinkedObject_SelectedIndexChanged;

            ScriptEditor.cbPythonInt.SelectedIndexChanged += (s, e) => {
                if (!Loaded)
                {
                    return;
                }
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                if (!Flowsheet.Scripts.ContainsKey(lbScripts.SelectedKey))
                {
                    return;
                }
                var scr = Flowsheet.Scripts[lbScripts.SelectedKey];
                scr.PythonInterpreter = (Scripts.Interpreter)ScriptEditor.cbPythonInt.SelectedIndex;
            };


            t1.TextChanged += (sender, e) =>
            {
                if (lbScripts.SelectedIndex < 0)
                {
                    return;
                }
                Flowsheet.Scripts[lbScripts.SelectedKey].Title = t1.Text;
                lbScripts.Items[lbScripts.SelectedIndex].Text  = t1.Text;
            };

            var splitc = new Splitter()
            {
            };

            splitc.Panel1        = leftcontainer;
            splitc.Panel1.Width  = 250;
            splitc.Panel2        = rightcontainer;
            splitc.SplitterWidth = 2;

            Rows.Add(new TableRow(splitc));
        }
Exemple #27
0
        /// <summary>
        /// The default constructor
        /// Sets the base panels
        /// </summary>
        public Workspace()
        {
            // Graphical measures
            Graphics g          = CreateGraphics();
            SizeF    sizeString = g.MeasureString("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890", Font);

            Data.HorizontalDLU = (sizeString.Width / 62) / 4;
            Data.VerticalDLU   = sizeString.Height / 8;
            g.Dispose();

            toolTip = new ToolTip();

            MainMenuStrip = new MenuStrip();
            pnlWorkspace  = new Panel();
            statusStrip   = new StatusStrip();

            pnlDataBase = new Panel();

            pnlMarketBase = new Panel();
            tsMarket      = new ToolStrip();
            pnlMarket     = new Panel();

            pnlStrategyBase = new Panel();
            tsStrategy      = new ToolStrip();
            pnlStrategy     = new Panel();

            pnlAccountBase = new Panel();
            tsAccount      = new ToolStrip();
            pnlAccount     = new Panel();

            pnlJournalBase = new Panel();
            pnlJournal     = new Panel();

            splitHoriz = new Splitter();
            Splitter splitVert1 = new Splitter();
            Splitter splitVert2 = new Splitter();

            // Panel Workspace
            pnlWorkspace.Parent    = this;
            pnlWorkspace.Dock      = DockStyle.Fill;
            pnlWorkspace.BackColor = LayoutColors.ColorFormBack;

            // Main menu
            MainMenuStrip.Parent = this;
            MainMenuStrip.Dock   = DockStyle.Top;

            // Status bar
            statusStrip.Parent = this;
            statusStrip.Dock   = DockStyle.Bottom;

            // Panel Journal Base
            pnlJournalBase.Parent  = pnlWorkspace;
            pnlJournalBase.Dock    = DockStyle.Fill;
            pnlJournalBase.Padding = new Padding(space, 0, space, space);

            // Horizontal splitter
            splitHoriz.Parent = pnlWorkspace;
            splitHoriz.Dock   = DockStyle.Top;
            splitHoriz.Height = space;

            // Panel Data Base
            pnlDataBase.Parent      = pnlWorkspace;
            pnlDataBase.Dock        = DockStyle.Top;
            pnlDataBase.MinimumSize = new Size(300, 200);

            // Panel Account Base
            pnlAccountBase.Parent      = pnlDataBase;
            pnlAccountBase.Dock        = DockStyle.Fill;
            pnlAccountBase.MinimumSize = new Size(100, 100);

            // Vertical splitter 1
            splitVert1.Parent = pnlDataBase;
            splitVert1.Dock   = DockStyle.Left;
            splitVert1.Width  = space;

            // Panel pnlStrategyBase
            pnlStrategyBase.Parent      = pnlDataBase;
            pnlStrategyBase.Dock        = DockStyle.Left;
            pnlStrategyBase.MinimumSize = new Size(100, 100);

            // Vertical splitter 2
            splitVert2.Parent = pnlDataBase;
            splitVert2.Dock   = DockStyle.Left;
            splitVert2.Width  = space;

            // Panel Market Base
            pnlMarketBase.Parent      = pnlDataBase;
            pnlMarketBase.Dock        = DockStyle.Left;
            pnlMarketBase.MinimumSize = new Size(100, 100);

            // Market panel
            pnlMarket.Parent  = pnlMarketBase;
            pnlMarket.Dock    = DockStyle.Fill;
            pnlMarket.Padding = new Padding(space, space, 0, 0);
            tsMarket.Parent   = pnlMarketBase;
            tsMarket.Dock     = DockStyle.Top;

            // Strategy panel
            pnlStrategy.Parent  = pnlStrategyBase;
            pnlStrategy.Dock    = DockStyle.Fill;
            pnlStrategy.Padding = new Padding(0, space, 0, 0);
            tsStrategy.Parent   = pnlStrategyBase;
            tsStrategy.Dock     = DockStyle.Top;

            // Account panel
            pnlAccount.Parent  = pnlAccountBase;
            pnlAccount.Dock    = DockStyle.Fill;
            pnlAccount.Padding = new Padding(0, space, space, 0);
            tsAccount.Parent   = pnlAccountBase;
            tsAccount.Dock     = DockStyle.Top;

            // Journal panel
            pnlJournal.Parent = pnlJournalBase;
            pnlJournal.Dock   = DockStyle.Fill;
        }
Exemple #28
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(TimeSeriesHydrographEditor));
     Reclamation.Core.MonthDayRange monthDayRange1            = new Reclamation.Core.MonthDayRange();
     this.comboBoxInputs        = new System.Windows.Forms.ComboBox();
     this.buttonUpload          = new System.Windows.Forms.Button();
     this.linkLabelChartDetails = new System.Windows.Forms.LinkLabel();
     this.buttonDownload        = new System.Windows.Forms.Button();
     this.toolTip1            = new System.Windows.Forms.ToolTip(this.components);
     this.checkBoxShowBadData = new System.Windows.Forms.CheckBox();
     this.checkBoxShowPoints  = new System.Windows.Forms.CheckBox();
     this.panelGraphTable     = new System.Windows.Forms.Panel();
     this.splitter1           = new System.Windows.Forms.Splitter();
     this.tChart1             = new Steema.TeeChart.TChart();
     this.labelFileName       = new System.Windows.Forms.Label();
     this.label2            = new System.Windows.Forms.Label();
     this.buttonOpenFile    = new System.Windows.Forms.Button();
     this.linkLabelUsgs     = new System.Windows.Forms.LinkLabel();
     this.yearSelector1     = new Reclamation.TimeSeries.Forms.YearSelector();
     this.monthRangePicker1 = new Reclamation.TimeSeries.Forms.MonthRangePicker();
     this.checkBoxWaterYear = new System.Windows.Forms.CheckBox();
     this.checkBoxCelsius   = new System.Windows.Forms.CheckBox();
     this.panelGraphTable.SuspendLayout();
     this.SuspendLayout();
     //
     // comboBoxInputs
     //
     this.comboBoxInputs.Location = new System.Drawing.Point(3, 28);
     this.comboBoxInputs.Name     = "comboBoxInputs";
     this.comboBoxInputs.Size     = new System.Drawing.Size(349, 24);
     this.comboBoxInputs.TabIndex = 23;
     this.toolTip1.SetToolTip(this.comboBoxInputs, "example:  JCK AF, AMF AF");
     this.comboBoxInputs.SelectedIndexChanged += new System.EventHandler(this.comboBoxInputs_SelectedIndexChanged);
     this.comboBoxInputs.KeyDown += new System.Windows.Forms.KeyEventHandler(this.comboBoxInputs_KeyDown);
     //
     // buttonUpload
     //
     this.buttonUpload.BackColor = System.Drawing.SystemColors.Control;
     this.buttonUpload.Font      = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.buttonUpload.ForeColor = System.Drawing.SystemColors.ControlText;
     this.buttonUpload.Location  = new System.Drawing.Point(352, 64);
     this.buttonUpload.Name      = "buttonUpload";
     this.buttonUpload.Size      = new System.Drawing.Size(75, 23);
     this.buttonUpload.TabIndex  = 21;
     this.buttonUpload.Text      = "Save";
     this.buttonUpload.UseVisualStyleBackColor = false;
     this.buttonUpload.Visible = false;
     //
     // linkLabelChartDetails
     //
     this.linkLabelChartDetails.Location     = new System.Drawing.Point(196, 66);
     this.linkLabelChartDetails.Name         = "linkLabelChartDetails";
     this.linkLabelChartDetails.Size         = new System.Drawing.Size(72, 23);
     this.linkLabelChartDetails.TabIndex     = 18;
     this.linkLabelChartDetails.TabStop      = true;
     this.linkLabelChartDetails.Text         = "chart details";
     this.linkLabelChartDetails.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelChartDetails_LinkClicked);
     //
     // buttonDownload
     //
     this.buttonDownload.ForeColor = System.Drawing.SystemColors.ControlText;
     this.buttonDownload.Location  = new System.Drawing.Point(272, 64);
     this.buttonDownload.Name      = "buttonDownload";
     this.buttonDownload.Size      = new System.Drawing.Size(75, 23);
     this.buttonDownload.TabIndex  = 16;
     this.buttonDownload.Text      = "Refresh";
     this.buttonDownload.Click    += new System.EventHandler(this.RefreshClick);
     this.buttonDownload.KeyDown  += new System.Windows.Forms.KeyEventHandler(this.buttonDownload_KeyDown);
     //
     // checkBoxShowBadData
     //
     this.checkBoxShowBadData.AutoSize   = true;
     this.checkBoxShowBadData.Checked    = true;
     this.checkBoxShowBadData.CheckState = System.Windows.Forms.CheckState.Checked;
     this.checkBoxShowBadData.Location   = new System.Drawing.Point(358, 24);
     this.checkBoxShowBadData.Name       = "checkBoxShowBadData";
     this.checkBoxShowBadData.Size       = new System.Drawing.Size(150, 21);
     this.checkBoxShowBadData.TabIndex   = 32;
     this.checkBoxShowBadData.Text       = "graph flagged data";
     this.checkBoxShowBadData.TextAlign  = System.Drawing.ContentAlignment.MiddleCenter;
     this.toolTip1.SetToolTip(this.checkBoxShowBadData, "show data that has been \'flagged\' bad");
     this.checkBoxShowBadData.UseVisualStyleBackColor = true;
     this.checkBoxShowBadData.CheckedChanged         += new System.EventHandler(this.checkBoxShowBadData_CheckedChanged);
     //
     // checkBoxShowPoints
     //
     this.checkBoxShowPoints.AutoSize  = true;
     this.checkBoxShowPoints.Location  = new System.Drawing.Point(358, 39);
     this.checkBoxShowPoints.Name      = "checkBoxShowPoints";
     this.checkBoxShowPoints.Size      = new System.Drawing.Size(104, 21);
     this.checkBoxShowPoints.TabIndex  = 33;
     this.checkBoxShowPoints.Text      = "show points";
     this.checkBoxShowPoints.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     this.toolTip1.SetToolTip(this.checkBoxShowPoints, "show point on graph for each timestamp");
     this.checkBoxShowPoints.UseVisualStyleBackColor = true;
     this.checkBoxShowPoints.CheckedChanged         += new System.EventHandler(this.checkBoxShowPoints_CheckedChanged);
     //
     // panelGraphTable
     //
     this.panelGraphTable.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                          | System.Windows.Forms.AnchorStyles.Left)
                                                                         | System.Windows.Forms.AnchorStyles.Right)));
     this.panelGraphTable.Controls.Add(this.splitter1);
     this.panelGraphTable.Controls.Add(this.tChart1);
     this.panelGraphTable.Location = new System.Drawing.Point(0, 88);
     this.panelGraphTable.Name     = "panelGraphTable";
     this.panelGraphTable.Size     = new System.Drawing.Size(929, 393);
     this.panelGraphTable.TabIndex = 27;
     //
     // splitter1
     //
     this.splitter1.Location = new System.Drawing.Point(510, 0);
     this.splitter1.Name     = "splitter1";
     this.splitter1.Size     = new System.Drawing.Size(6, 393);
     this.splitter1.TabIndex = 4;
     this.splitter1.TabStop  = false;
     //
     // tChart1
     //
     //
     //
     //
     this.tChart1.Aspect.View3D  = false;
     this.tChart1.Aspect.ZOffset = 0D;
     //
     //
     //
     //
     //
     //
     //
     //
     //
     this.tChart1.Axes.Bottom.Title.Transparent = true;
     //
     //
     //
     //
     //
     //
     this.tChart1.Axes.Depth.Title.Transparent = true;
     //
     //
     //
     //
     //
     //
     this.tChart1.Axes.DepthTop.Title.Transparent = true;
     //
     //
     //
     //
     //
     //
     this.tChart1.Axes.Left.Title.Transparent = true;
     //
     //
     //
     //
     //
     //
     this.tChart1.Axes.Right.Title.Transparent = true;
     //
     //
     //
     //
     //
     //
     this.tChart1.Axes.Top.Title.Transparent = true;
     this.tChart1.Dock     = System.Windows.Forms.DockStyle.Left;
     this.tChart1.Location = new System.Drawing.Point(0, 0);
     this.tChart1.Name     = "tChart1";
     this.tChart1.Size     = new System.Drawing.Size(510, 393);
     this.tChart1.TabIndex = 3;
     this.tChart1.Click   += new System.EventHandler(this.tChart1_Click);
     this.tChart1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tChart1_MouseUp);
     //
     // labelFileName
     //
     this.labelFileName.AutoSize = true;
     this.labelFileName.Location = new System.Drawing.Point(101, 7);
     this.labelFileName.Name     = "labelFileName";
     this.labelFileName.Size     = new System.Drawing.Size(46, 17);
     this.labelFileName.TabIndex = 29;
     this.labelFileName.Text     = "label2";
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(49, 7);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(61, 17);
     this.label2.TabIndex = 30;
     this.label2.Text     = "filename";
     //
     // buttonOpenFile
     //
     this.buttonOpenFile.Image    = ((System.Drawing.Image)(resources.GetObject("buttonOpenFile.Image")));
     this.buttonOpenFile.Location = new System.Drawing.Point(10, 6);
     this.buttonOpenFile.Name     = "buttonOpenFile";
     this.buttonOpenFile.Size     = new System.Drawing.Size(35, 18);
     this.buttonOpenFile.TabIndex = 31;
     this.buttonOpenFile.UseVisualStyleBackColor = true;
     this.buttonOpenFile.Click += new System.EventHandler(this.buttonOpenFile_Click);
     //
     // linkLabelUsgs
     //
     this.linkLabelUsgs.Location     = new System.Drawing.Point(17, 62);
     this.linkLabelUsgs.Name         = "linkLabelUsgs";
     this.linkLabelUsgs.Size         = new System.Drawing.Size(132, 23);
     this.linkLabelUsgs.TabIndex     = 35;
     this.linkLabelUsgs.TabStop      = true;
     this.linkLabelUsgs.Text         = "usgs";
     this.linkLabelUsgs.Visible      = false;
     this.linkLabelUsgs.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelUsgs_LinkClicked);
     //
     // yearSelector1
     //
     this.yearSelector1.Location      = new System.Drawing.Point(479, 64);
     this.yearSelector1.Margin        = new System.Windows.Forms.Padding(4, 4, 4, 4);
     this.yearSelector1.Name          = "yearSelector1";
     this.yearSelector1.SelectedYears = new int[] {
         1977,
         2001,
         2005
     };
     this.yearSelector1.Size     = new System.Drawing.Size(289, 20);
     this.yearSelector1.TabIndex = 37;
     //
     // monthRangePicker1
     //
     this.monthRangePicker1.BeginningMonth = 10;
     this.monthRangePicker1.Location       = new System.Drawing.Point(497, 24);
     this.monthRangePicker1.Margin         = new System.Windows.Forms.Padding(4, 4, 4, 4);
     this.monthRangePicker1.MonthDayRange  = monthDayRange1;
     this.monthRangePicker1.Name           = "monthRangePicker1";
     this.monthRangePicker1.Size           = new System.Drawing.Size(428, 34);
     this.monthRangePicker1.TabIndex       = 36;
     //
     // checkBoxWaterYear
     //
     this.checkBoxWaterYear.AutoSize   = true;
     this.checkBoxWaterYear.Checked    = true;
     this.checkBoxWaterYear.CheckState = System.Windows.Forms.CheckState.Checked;
     this.checkBoxWaterYear.Location   = new System.Drawing.Point(497, 1);
     this.checkBoxWaterYear.Name       = "checkBoxWaterYear";
     this.checkBoxWaterYear.Size       = new System.Drawing.Size(96, 21);
     this.checkBoxWaterYear.TabIndex   = 38;
     this.checkBoxWaterYear.Text       = "water year";
     this.checkBoxWaterYear.UseVisualStyleBackColor = true;
     this.checkBoxWaterYear.CheckedChanged         += new System.EventHandler(this.checkBoxWaterYear_CheckedChanged);
     //
     // checkBoxCelsius
     //
     this.checkBoxCelsius.AutoSize = true;
     this.checkBoxCelsius.Location = new System.Drawing.Point(584, 1);
     this.checkBoxCelsius.Name     = "checkBoxCelsius";
     this.checkBoxCelsius.Size     = new System.Drawing.Size(257, 21);
     this.checkBoxCelsius.TabIndex = 39;
     this.checkBoxCelsius.Text     = "display water temperature in Celsius";
     this.checkBoxCelsius.UseVisualStyleBackColor = true;
     //
     // TimeSeriesHydrographEditor
     //
     this.Controls.Add(this.checkBoxCelsius);
     this.Controls.Add(this.checkBoxWaterYear);
     this.Controls.Add(this.yearSelector1);
     this.Controls.Add(this.monthRangePicker1);
     this.Controls.Add(this.linkLabelUsgs);
     this.Controls.Add(this.checkBoxShowPoints);
     this.Controls.Add(this.checkBoxShowBadData);
     this.Controls.Add(this.buttonOpenFile);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.labelFileName);
     this.Controls.Add(this.panelGraphTable);
     this.Controls.Add(this.buttonUpload);
     this.Controls.Add(this.comboBoxInputs);
     this.Controls.Add(this.linkLabelChartDetails);
     this.Controls.Add(this.buttonDownload);
     this.Name  = "TimeSeriesHydrographEditor";
     this.Size  = new System.Drawing.Size(929, 481);
     this.Load += new System.EventHandler(this.TimeSeriesEditor_Load);
     this.panelGraphTable.ResumeLayout(false);
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Exemple #29
0
	public MainForm ()
	{
		// 
		// _rightPanel
		// 
		_rightPanel = new Panel ();
		_rightPanel.Dock = DockStyle.Fill;
		_rightPanel.Width = 100;
		_rightPanel.TabIndex = 3;
		Controls.Add (_rightPanel);
		// 
		// _treeSplitter
		// 
		_treeSplitter = new Splitter ();
		_treeSplitter.ImeMode = ImeMode.NoControl;
		_treeSplitter.Location = new Point (240, 0);
		_treeSplitter.MinSize = 10;
		_treeSplitter.Size = new Size (6, 545);
		_treeSplitter.TabIndex = 2;
		_treeSplitter.TabStop = false;
		Controls.Add (_treeSplitter);
		// 
		// _leftPanel
		// 
		_leftPanel = new Panel ();
		_leftPanel.Dock = DockStyle.Left;
		_leftPanel.Width = 100;
		_leftPanel.TabIndex = 4;
		Controls.Add (_leftPanel);
		// 
		// _resultTabs
		// 
		_resultTabs = new ResultTabs ();
		_resultTabs.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
		_resultTabs.Location = new Point (0, 120);
		_resultTabs.Size = new Size (498, 425);
		_resultTabs.TabIndex = 2;
		_rightPanel.Controls.Add (_resultTabs);
		// 
		// _treeView
		// 
		_treeView = new TreeView ();
		_treeView.Dock = DockStyle.Fill;
		_treeView.TabIndex = 0;
		_leftPanel.Controls.Add (_treeView);
		// 
		// _groupBox
		// 
		_groupBox = new GroupBox ();
		_groupBox.Dock = DockStyle.Top;
		_groupBox.Height = 120;
		_groupBox.TabIndex = 0;
		_groupBox.TabStop = false;
		_rightPanel.Controls.Add (_groupBox);
		// 
		// _runButton
		// 
		_runButton = new Button ();
		_runButton.ImeMode = ImeMode.NoControl;
		_runButton.Location = new Point (8, 18);
		_runButton.Size = new Size (88, 38);
		_runButton.TabIndex = 3;
		_runButton.Text = "&Run";
		_groupBox.Controls.Add (_runButton);
		// 
		// MainForm
		// 
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #80729";
		Load += new EventHandler (MainForm_Load);
	}
Exemple #30
0
 void FoundNonEmptyCharacter(char c)
 {
     _builder.Append(c);
     Splitter.Append(_builder.ToString());
     Splitter.SetParser(new SqlScriptReader(Splitter));
 }
Exemple #31
0
        private static async Task Run(string[] args)
        {
            Console.WriteLine("Sqlite file : loading ");
            string bddFile = args[0];

            Console.WriteLine("Ressource file : loading ");
            string resourceFile = args[1];

            SQLiteConnection dbConnection = new SQLiteConnection($"Data Source={bddFile};Version=3;");

            dbConnection.Open();

            Console.WriteLine("Config done !");
            Console.WriteLine("Starting initialization...");
            string fillDatabase = null;

            try
            {
                fillDatabase = File.ReadAllText(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "/SQL/shakespeare.sql");
                SQLiteCommand command = new SQLiteCommand(fillDatabase, dbConnection);
                await command.ExecuteNonQueryAsync();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            Console.WriteLine("Initialized.");



            Console.WriteLine("Writing data, it would take few seconds...");
            List <string>  personnes = new List <string>();
            List <string>  pieces    = new List <string>();
            List <Tirades> tirades   = new List <Tirades>();
            List <Texte>   textes    = new List <Texte>();
            Tirades        tirade;
            string         personneName = "";
            string         pieceName    = "";
            string         line;

            DateTime start = DateTime.UtcNow;

            try
            {
                StreamReader sr = new StreamReader(resourceFile);
                line = sr.ReadLine();

                while (line != null)
                {
                    string[] lineSplitted = line.Split('|');

                    personneName = Splitter.PersonnageSplitter(lineSplitted);
                    if (!string.IsNullOrEmpty(personneName) && !personnes.Exists(x => x == personneName))
                    {
                        personnes.Add(personneName);
                    }

                    pieceName = Splitter.PieceSplitter(lineSplitted);
                    if (!string.IsNullOrEmpty(pieceName) && !pieces.Exists(x => x == pieceName))
                    {
                        pieces.Add(pieceName);
                    }

                    tirade = Splitter.TiradesSplitter(lineSplitted);
                    if (!tirades.Exists(x => x.NomPiece == tirade.NomPiece && x.Acte == tirade.Acte && x.Scene == tirade.Scene) && tirade.TiradeNumber != 0)
                    {
                        tirades.Add(tirade);
                    }

                    textes.Add(Splitter.TexteSplitter(lineSplitted));

                    line = sr.ReadLine();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }

            Parallel.For(0, tirades.Count, i =>
            {
                tirades[i].IdPersonne = personnes.FindIndex(x => x == tirades[i].NomPersonnage);
                tirades[i].IdPiece    = pieces.FindIndex(x => x == tirades[i].NomPiece);
            });

            Parallel.For(0, textes.Count, i =>
            {
                if (textes[i].Text.Contains('\''))
                {
                    textes[i].Text = textes[i].Text.Replace('\'', ' ');
                }
                textes[i].IdTirade = tirades.FindIndex(x => x.Acte == textes[i].ActeNumber && x.IdPiece == textes[i].IdPiece && x.Scene == textes[i].SceneNumber);
                textes[i].IdPiece  = pieces.FindIndex(x => x == textes[i].NomPiece);
            });


            await SqliteRequest.Insert(personnes, pieces, tirades, textes, dbConnection);

            DateTime stop = DateTime.UtcNow;

            Console.WriteLine($"Time to proccess : {(start - stop)}");
            dbConnection.Close();
            Console.WriteLine("Done");
            Console.ReadKey();
        }
        public SearchableTreePanel(ThemeConfig theme)
            : base(FlowDirection.TopToBottom)
        {
            this.theme      = theme;
            this.TreeLoaded = false;

            var searchIcon = AggContext.StaticData.LoadIcon("icon_search_24x24.png", 16, 16, theme.InvertIcons).AjustAlpha(0.3);

            searchBox = new SearchInputBox(theme)
            {
                Name    = "Search",
                HAnchor = HAnchor.Stretch,
                Margin  = new BorderDouble(6),
            };

            searchBox.ResetButton.Visible = false;

            var searchInput = searchBox.searchInput;

            searchInput.BeforeDraw += (s, e) =>
            {
                if (!searchBox.ResetButton.Visible)
                {
                    e.Graphics2D.Render(
                        searchIcon,
                        searchInput.Width - searchIcon.Width - 5,
                        searchInput.LocalBounds.Bottom + searchInput.Height / 2 - searchIcon.Height / 2);
                }
            };

            searchBox.ResetButton.Click += (s, e) =>
            {
                this.ClearSearch();
            };

            searchBox.KeyDown += (s, e) =>
            {
                if (e.KeyCode == Keys.Escape)
                {
                    this.ClearSearch();
                    e.Handled = true;
                }
            };

            searchBox.searchInput.ActualTextEditWidget.TextChanged += (s, e) =>
            {
                if (string.IsNullOrWhiteSpace(searchBox.Text))
                {
                    this.ClearSearch();
                }
                else
                {
                    this.PerformSearch(searchBox.Text);
                }
            };

            horizontalSplitter = new Splitter()
            {
                SplitterDistance   = Math.Max(UserSettings.Instance.LibraryViewWidth, 20),
                SplitterSize       = theme.SplitterWidth,
                SplitterBackground = theme.SplitterBackground
            };
            horizontalSplitter.AnchorAll();

            horizontalSplitter.DistanceChanged += (s, e) =>
            {
                UserSettings.Instance.LibraryViewWidth = Math.Max(horizontalSplitter.SplitterDistance, 20);
            };

            this.AddChild(horizontalSplitter);

            var leftPanel = new FlowLayoutWidget(FlowDirection.TopToBottom)
            {
                HAnchor = HAnchor.Stretch,
                VAnchor = VAnchor.Stretch
            };

            leftPanel.AddChild(searchBox);

            treeView = new TreeView(theme)
            {
                HAnchor = HAnchor.Stretch,
                VAnchor = VAnchor.Stretch,
            };
            leftPanel.AddChild(treeView);

            horizontalSplitter.Panel1.AddChild(leftPanel);

            contentPanel = new FlowLayoutWidget(FlowDirection.TopToBottom)
            {
                HAnchor = HAnchor.Fit,
                VAnchor = VAnchor.Fit,
                Margin  = new BorderDouble(left: 2)
            };
            treeView.AddChild(contentPanel);
        }
Exemple #33
0
        public AddInScoutViewContent() : base()
        {
            this.TitleName = "AddIn Scout";

            Panel p = new Panel();

            p.Dock        = DockStyle.Fill;
            p.BorderStyle = BorderStyle.FixedSingle;

            Panel RightPanel = new Panel();

            RightPanel.Dock = DockStyle.Fill;
            p.Controls.Add(RightPanel);

            codonListPanel.Dock = DockStyle.Fill;
            codonListPanel.CurrentAddinChanged += new EventHandler(CodonListPanelCurrentAddinChanged);
            RightPanel.Controls.Add(codonListPanel);

            Splitter hs = new Splitter();

            hs.Dock = DockStyle.Top;
            RightPanel.Controls.Add(hs);

            addInDetailsPanel.Dock   = DockStyle.Top;
            addInDetailsPanel.Height = 175;
            RightPanel.Controls.Add(addInDetailsPanel);

            Splitter s1 = new Splitter();

            s1.Dock = DockStyle.Left;
            p.Controls.Add(s1);

            AddinTreeView addinTreeView = new AddinTreeView();

            addinTreeView.Dock = DockStyle.Fill;
            addinTreeView.treeView.AfterSelect += new TreeViewEventHandler(this.tvSelectHandler);

            TreeTreeView treeTreeView = new TreeTreeView();

            treeTreeView.Dock = DockStyle.Fill;
            treeTreeView.treeView.AfterSelect += new TreeViewEventHandler(this.tvSelectHandler);

            TabControl tab = new TabControl();

            tab.Width = 300;
            tab.Dock  = DockStyle.Left;

            TabPage tabPage2 = new TabPage("Tree");

            tabPage2.Dock = DockStyle.Left;
            tabPage2.Controls.Add(treeTreeView);
            tab.TabPages.Add(tabPage2);

            TabPage tabPage = new TabPage("AddIns");

            tabPage.Dock = DockStyle.Left;
            tabPage.Controls.Add(addinTreeView);
            tab.TabPages.Add(tabPage);

            p.Controls.Add(tab);

            this.control   = p;
            this.TitleName = "AddIn Scout";
        }
Exemple #34
0
        public SplitterTest()
        {
            contours = new List <IContour>();
            Primitive.Contour contour1 = new Primitive.Contour();
            Primitive.Contour contour2 = new Primitive.Contour();

            List <ISegment> segments1 = new List <ISegment>
            {
                new Segment(new BezierCurve(), new List <Point>
                {
                    new Point(-2, -2),
                    new Point(-2, 2)
                }),
                new Segment(new BezierCurve(), new List <Point>
                {
                    new Point(-2, 2),
                    new Point(2, 2)
                }),
                new Segment(new BezierCurve(), new List <Point>
                {
                    new Point(2, 2),
                    new Point(2, -2)
                }),
                new Segment(new BezierCurve(), new List <Point>
                {
                    new Point(2, -2),
                    new Point(-2, -2)
                })
            };

            List <ISegment> segments2 = new List <ISegment>
            {
                new Segment(new BezierCurve(), new List <Point>
                {
                    new Point(0, 0),
                    new Point(1, 0)
                }),
                new Segment(new BezierCurve(), new List <Point>
                {
                    new Point(1, 0),
                    new Point(0, 1)
                }),
                new Segment(new BezierCurve(), new List <Point>
                {
                    new Point(0, 1),
                    new Point(0, 0)
                })
            };

            foreach (var segment in segments1)
            {
                contour1.Add(segment);
            }
            foreach (var segment in segments2)
            {
                contour2.Add(segment);
            }
            contours.Add(contour1);
            contours.Add(contour2);

            splitter      = new Splitter();
            numOfSegments = 0;
            foreach (var contour in contours)
            {
                numOfSegments += contour.GetSegments().Count();
            }
        }
        private void InitializeComponent()
        {
            currTreeView = new TreeView();
            splitter1    = new Splitter();
            panel1       = new Panel();

            CustomPropertyGrid currGrid            = new CustomPropertyGrid();
            ContextMenu        currGridContextMenu = new ContextMenu();

            panelContextMenu        = new ContextMenu();
            panelContextMenu.Popup += new EventHandler(PopupPanelContextMenu);

            currTreeView.HideSelection      = false;
            currTreeView.Dock               = DockStyle.Left;
            currTreeView.ImageIndex         = -1;
            currTreeView.Location           = new Point(0, 0);
            currTreeView.Name               = "currTreeView";
            currTreeView.SelectedImageIndex = -1;
            currTreeView.Size               = new Size(256, 266);
            currTreeView.TabIndex           = 6;
            currTreeView.ImageList          = ImageListFactory.GetImageList();
            currTreeView.AfterSelect       += new TreeViewEventHandler(OnAfterSelect);
            currTreeViewContextMenu         = new ContextMenu();
            currTreeViewContextMenu.Popup  += new EventHandler(PopupTreeViewContextMenu);
            currTreeView.MouseDown         += new MouseEventHandler(TreeViewMouseDown);
            currTreeView.KeyDown           += new KeyEventHandler(TreeViewKeyDown);

            splitter1.Dock     = DockStyle.Left;
            splitter1.Location = new Point(140, 0);
            splitter1.Name     = "splitter1";
            splitter1.Size     = new Size(2, 266);
            splitter1.TabIndex = 7;
            splitter1.TabStop  = false;

            currGridContextMenu.Popup += new EventHandler(OnPropertyGridPopupContextMenu);

            currGrid.Dock                  = DockStyle.Fill;
            currGrid.Font                  = new Font("Tahoma", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((System.Byte)(0)));
            currGrid.Location              = new Point(140, 0);
            currGrid.Name                  = "_currGrid";
            currGrid.Size                  = new Size(250, 266);
            currGrid.TabIndex              = 1;
            currGrid.PropertySort          = PropertySort.Alphabetical;
            currGrid.ToolbarVisible        = false;
            currGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(OnPropertyValueChanged);
            currGrid.ContextMenu           = currGridContextMenu;

            panel1.Controls.Add(currGrid);
            panel1.Dock     = DockStyle.Fill;
            panel1.Location = new Point(142, 0);
            panel1.Name     = "panel1";
            panel1.Size     = new Size(409, 266);
            panel1.TabIndex = 9;

            Controls.Add(panel1);
            Controls.Add(splitter1);
            Controls.Add(currTreeView);

            CurrentGrid            = currGrid;
            CurrentGridContextMenu = currGridContextMenu;
        }
Exemple #36
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
     this.contextMenu1       = new System.Windows.Forms.ContextMenu();
     this.setFontMenuItem    = new System.Windows.Forms.MenuItem();
     this.openMenuItem       = new System.Windows.Forms.MenuItem();
     this.saveMenuItem       = new System.Windows.Forms.MenuItem();
     this.fontDialog1        = new System.Windows.Forms.FontDialog();
     this.saveFileDialog1    = new System.Windows.Forms.SaveFileDialog();
     this.openFileDialog1    = new System.Windows.Forms.OpenFileDialog();
     this.statusBar1         = new System.Windows.Forms.StatusBar();
     this.statusBarPanel1    = new System.Windows.Forms.StatusBarPanel();
     this.sandDockManager1   = new TD.SandDock.SandDockManager();
     this.leftSandDock       = new TD.SandDock.DockContainer();
     this.rightSandDock      = new TD.SandDock.DockContainer();
     this.bottomSandDock     = new TD.SandDock.DockContainer();
     this.topSandDock        = new TD.SandDock.DockContainer();
     this.toolBar1           = new TD.SandBar.ToolBar();
     this.buttonOpen         = new TD.SandBar.ButtonItem();
     this.saveButton         = new TD.SandBar.ButtonItem();
     this.recordButton       = new TD.SandBar.ButtonItem();
     this.assertButton       = new TD.SandBar.ButtonItem();
     this.playbackButton     = new TD.SandBar.ButtonItem();
     this.dropDownMenuItem1  = new TD.SandBar.DropDownMenuItem();
     this.menuButtonItem2    = new TD.SandBar.MenuButtonItem();
     this.menuButtonItem5    = new TD.SandBar.MenuButtonItem();
     this.menuButtonItem6    = new TD.SandBar.MenuButtonItem();
     this.menuButtonItem3    = new TD.SandBar.MenuButtonItem();
     this.menuButtonItem4    = new TD.SandBar.MenuButtonItem();
     this.menuButtonItem1    = new TD.SandBar.MenuButtonItem();
     this.aboutButton        = new TD.SandBar.ButtonItem();
     this.documentContainer1 = new TD.SandDock.DocumentContainer();
     this.dockControl1       = new TD.SandDock.DockControl();
     this.panel1             = new System.Windows.Forms.Panel();
     this.groupBox1          = new System.Windows.Forms.GroupBox();
     this.textScript         = new System.Windows.Forms.RichTextBox();
     this.splitter1          = new System.Windows.Forms.Splitter();
     this.groupBox2          = new System.Windows.Forms.GroupBox();
     this.lstEvents          = new System.Windows.Forms.ListBox();
     this.dockControlOutput  = new TD.SandDock.DockControl();
     this.groupBox3          = new System.Windows.Forms.GroupBox();
     this.rtbStdOutLog       = new System.Windows.Forms.RichTextBox();
     this.btnSaveLog         = new System.Windows.Forms.Button();
     this.btnClear           = new System.Windows.Forms.Button();
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
     this.documentContainer1.SuspendLayout();
     this.dockControl1.SuspendLayout();
     this.panel1.SuspendLayout();
     this.groupBox1.SuspendLayout();
     this.groupBox2.SuspendLayout();
     this.dockControlOutput.SuspendLayout();
     this.groupBox3.SuspendLayout();
     this.SuspendLayout();
     //
     // contextMenu1
     //
     this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.setFontMenuItem,
         this.openMenuItem,
         this.saveMenuItem
     });
     //
     // setFontMenuItem
     //
     this.setFontMenuItem.Index  = 0;
     this.setFontMenuItem.Text   = "Set Font...";
     this.setFontMenuItem.Click += new System.EventHandler(this.setFontMenuItem_Click);
     //
     // openMenuItem
     //
     this.openMenuItem.Index  = 1;
     this.openMenuItem.Text   = "Open...";
     this.openMenuItem.Click += new System.EventHandler(this.openMenuItem_Click);
     //
     // saveMenuItem
     //
     this.saveMenuItem.Index  = 2;
     this.saveMenuItem.Text   = "Save...";
     this.saveMenuItem.Click += new System.EventHandler(this.saveMenuItem_Click);
     //
     // statusBar1
     //
     this.statusBar1.Location = new System.Drawing.Point(0, 583);
     this.statusBar1.Name     = "statusBar1";
     this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
         this.statusBarPanel1
     });
     this.statusBar1.ShowPanels = true;
     this.statusBar1.Size       = new System.Drawing.Size(608, 22);
     this.statusBar1.TabIndex   = 8;
     //
     // statusBarPanel1
     //
     this.statusBarPanel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
     this.statusBarPanel1.Name     = "statusBarPanel1";
     this.statusBarPanel1.Width    = 592;
     //
     // sandDockManager1
     //
     this.sandDockManager1.OwnerForm = this;
     //
     // leftSandDock
     //
     this.leftSandDock.Dock         = System.Windows.Forms.DockStyle.Left;
     this.leftSandDock.Guid         = new System.Guid("25ec745e-de38-4c1a-a783-53b829ea6734");
     this.leftSandDock.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400);
     this.leftSandDock.Location     = new System.Drawing.Point(0, 0);
     this.leftSandDock.Manager      = this.sandDockManager1;
     this.leftSandDock.Name         = "leftSandDock";
     this.leftSandDock.Size         = new System.Drawing.Size(0, 605);
     this.leftSandDock.TabIndex     = 10;
     //
     // rightSandDock
     //
     this.rightSandDock.Dock         = System.Windows.Forms.DockStyle.Right;
     this.rightSandDock.Guid         = new System.Guid("c4aec7ed-9055-44f4-af3f-2ea35df51099");
     this.rightSandDock.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400);
     this.rightSandDock.Location     = new System.Drawing.Point(608, 0);
     this.rightSandDock.Manager      = this.sandDockManager1;
     this.rightSandDock.Name         = "rightSandDock";
     this.rightSandDock.Size         = new System.Drawing.Size(0, 605);
     this.rightSandDock.TabIndex     = 11;
     //
     // bottomSandDock
     //
     this.bottomSandDock.Dock         = System.Windows.Forms.DockStyle.Bottom;
     this.bottomSandDock.Guid         = new System.Guid("5196e983-c717-40e9-b223-368ca5f449f3");
     this.bottomSandDock.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400);
     this.bottomSandDock.Location     = new System.Drawing.Point(0, 605);
     this.bottomSandDock.Manager      = this.sandDockManager1;
     this.bottomSandDock.Name         = "bottomSandDock";
     this.bottomSandDock.Size         = new System.Drawing.Size(608, 0);
     this.bottomSandDock.TabIndex     = 12;
     //
     // topSandDock
     //
     this.topSandDock.Dock         = System.Windows.Forms.DockStyle.Top;
     this.topSandDock.Guid         = new System.Guid("c11b7c3d-b652-47b2-bf7d-0a72097ec98e");
     this.topSandDock.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400);
     this.topSandDock.Location     = new System.Drawing.Point(0, 0);
     this.topSandDock.Manager      = this.sandDockManager1;
     this.topSandDock.Name         = "topSandDock";
     this.topSandDock.Size         = new System.Drawing.Size(608, 0);
     this.topSandDock.TabIndex     = 13;
     //
     // toolBar1
     //
     this.toolBar1.ContextMenu  = this.contextMenu1;
     this.toolBar1.FlipLastItem = true;
     this.toolBar1.Guid         = new System.Guid("a57ee27e-f5fa-4a3f-986a-cbe4264539d5");
     this.toolBar1.Items.AddRange(new TD.SandBar.ToolbarItemBase[] {
         this.buttonOpen,
         this.saveButton,
         this.recordButton,
         this.assertButton,
         this.playbackButton,
         this.dropDownMenuItem1,
         this.aboutButton
     });
     this.toolBar1.Location = new System.Drawing.Point(0, 0);
     this.toolBar1.Name     = "toolBar1";
     this.toolBar1.ShowShortcutsInToolTips = true;
     this.toolBar1.Size      = new System.Drawing.Size(608, 22);
     this.toolBar1.TabIndex  = 14;
     this.toolBar1.Text      = "";
     this.toolBar1.TextAlign = TD.SandBar.ToolBarTextAlign.Underneath;
     //
     // buttonOpen
     //
     this.buttonOpen.IconSize    = new System.Drawing.Size(32, 32);
     this.buttonOpen.Text        = "Open";
     this.buttonOpen.ToolTipText = "Open";
     this.buttonOpen.Activate   += new System.EventHandler(this.buttonOpen_Activate);
     //
     // saveButton
     //
     this.saveButton.IconSize    = new System.Drawing.Size(32, 32);
     this.saveButton.Text        = "Save";
     this.saveButton.ToolTipText = "Save";
     this.saveButton.Activate   += new System.EventHandler(this.saveButton_Activate);
     //
     // recordButton
     //
     this.recordButton.BeginGroup  = true;
     this.recordButton.Text        = "Start";
     this.recordButton.ToolTipText = "Start";
     this.recordButton.Activate   += new System.EventHandler(this.recordButton_Activate);
     //
     // assertButton
     //
     this.assertButton.IconSize    = new System.Drawing.Size(128, 128);
     this.assertButton.Text        = "Assert";
     this.assertButton.ToolTipText = "Add assertion";
     this.assertButton.Activate   += new System.EventHandler(this.assertButton_Activate);
     //
     // playbackButton
     //
     this.playbackButton.Text        = "Playback";
     this.playbackButton.ToolTipText = "Playback";
     this.playbackButton.Activate   += new System.EventHandler(this.playbackButton_Activate);
     //
     // dropDownMenuItem1
     //
     this.dropDownMenuItem1.Items.AddRange(new TD.SandBar.ToolbarItemBase[] {
         this.menuButtonItem2,
         this.menuButtonItem3,
         this.menuButtonItem4,
         this.menuButtonItem1
     });
     this.dropDownMenuItem1.Text    = "Options";
     this.dropDownMenuItem1.Visible = false;
     //
     // menuButtonItem2
     //
     this.menuButtonItem2.Items.AddRange(new TD.SandBar.ToolbarItemBase[] {
         this.menuButtonItem5,
         this.menuButtonItem6
     });
     this.menuButtonItem2.Text = "Browser Selection";
     //
     // menuButtonItem5
     //
     this.menuButtonItem5.Text = "Firewatir: Mozilla Firefox";
     //
     // menuButtonItem6
     //
     this.menuButtonItem6.Text = "Watir: Internet Explorer";
     //
     // menuButtonItem3
     //
     this.menuButtonItem3.Text = "Watir Project Page";
     //
     // menuButtonItem4
     //
     this.menuButtonItem4.Text = "Ruby Project Page";
     //
     // menuButtonItem1
     //
     this.menuButtonItem1.BeginGroup = true;
     this.menuButtonItem1.Text       = "About...";
     this.menuButtonItem1.Activate  += new System.EventHandler(this.menuButtonItem1_Activate);
     //
     // aboutButton
     //
     this.aboutButton.BuddyMenu   = this.menuButtonItem1;
     this.aboutButton.IconSize    = new System.Drawing.Size(32, 32);
     this.aboutButton.Text        = "About";
     this.aboutButton.ToolTipText = "About";
     this.aboutButton.Activate   += new System.EventHandler(this.aboutButton_Activate);
     //
     // documentContainer1
     //
     this.documentContainer1.Controls.Add(this.dockControl1);
     this.documentContainer1.Controls.Add(this.dockControlOutput);
     this.documentContainer1.Guid         = new System.Guid("a1f0db60-29b8-4f8c-b3ca-0613232ae52d");
     this.documentContainer1.LayoutSystem = new TD.SandDock.SplitLayoutSystem(250, 400, System.Windows.Forms.Orientation.Horizontal, new TD.SandDock.LayoutSystemBase[] {
         ((TD.SandDock.LayoutSystemBase)(new TD.SandDock.DocumentLayoutSystem(606, 559, new TD.SandDock.DockControl[] {
             this.dockControl1,
             this.dockControlOutput
         }, this.dockControl1)))
     });
     this.documentContainer1.Location   = new System.Drawing.Point(0, 22);
     this.documentContainer1.Manager    = null;
     this.documentContainer1.Name       = "documentContainer1";
     this.documentContainer1.Renderer   = new TD.SandDock.Rendering.Office2003Renderer();
     this.documentContainer1.Size       = new System.Drawing.Size(608, 561);
     this.documentContainer1.TabIndex   = 15;
     this.documentContainer1.DragDrop  += new System.Windows.Forms.DragEventHandler(this.textScript_DragDrop);
     this.documentContainer1.DragEnter += new System.Windows.Forms.DragEventHandler(this.textScript_DragEnter);
     //
     // dockControl1
     //
     this.dockControl1.Controls.Add(this.panel1);
     this.dockControl1.Guid     = new System.Guid("804e5184-274f-4191-a3ab-346cf996384a");
     this.dockControl1.Location = new System.Drawing.Point(5, 33);
     this.dockControl1.Name     = "dockControl1";
     this.dockControl1.Size     = new System.Drawing.Size(598, 523);
     this.dockControl1.TabIndex = 0;
     this.dockControl1.Text     = "Recording";
     this.dockControl1.Closing += new System.ComponentModel.CancelEventHandler(this.dockControl1_Closing);
     //
     // panel1
     //
     this.panel1.Controls.Add(this.groupBox1);
     this.panel1.Controls.Add(this.splitter1);
     this.panel1.Controls.Add(this.groupBox2);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panel1.Location = new System.Drawing.Point(0, 0);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(598, 523);
     this.panel1.TabIndex = 8;
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.textScript);
     this.groupBox1.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.groupBox1.Location   = new System.Drawing.Point(0, 0);
     this.groupBox1.Name       = "groupBox1";
     this.groupBox1.Size       = new System.Drawing.Size(598, 384);
     this.groupBox1.TabIndex   = 4;
     this.groupBox1.TabStop    = false;
     this.groupBox1.Text       = "Watir Test Code";
     this.groupBox1.DragOver  += new System.Windows.Forms.DragEventHandler(this.textScript_DragEnter);
     this.groupBox1.DragDrop  += new System.Windows.Forms.DragEventHandler(this.textScript_DragDrop);
     this.groupBox1.DragEnter += new System.Windows.Forms.DragEventHandler(this.textScript_DragEnter);
     //
     // textScript
     //
     this.textScript.AllowDrop   = true;
     this.textScript.ContextMenu = this.contextMenu1;
     this.textScript.DetectUrls  = false;
     this.textScript.Dock        = System.Windows.Forms.DockStyle.Fill;
     this.textScript.Font        = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.textScript.Location    = new System.Drawing.Point(3, 16);
     this.textScript.Name        = "textScript";
     this.textScript.Size        = new System.Drawing.Size(592, 365);
     this.textScript.TabIndex    = 1;
     this.textScript.Text        = "";
     this.textScript.DragDrop   += new System.Windows.Forms.DragEventHandler(this.textScript_DragDrop);
     this.textScript.DragEnter  += new System.Windows.Forms.DragEventHandler(this.textScript_DragEnter);
     //
     // splitter1
     //
     this.splitter1.Dock     = System.Windows.Forms.DockStyle.Bottom;
     this.splitter1.Location = new System.Drawing.Point(0, 384);
     this.splitter1.Name     = "splitter1";
     this.splitter1.Size     = new System.Drawing.Size(598, 3);
     this.splitter1.TabIndex = 6;
     this.splitter1.TabStop  = false;
     //
     // groupBox2
     //
     this.groupBox2.Controls.Add(this.lstEvents);
     this.groupBox2.Dock     = System.Windows.Forms.DockStyle.Bottom;
     this.groupBox2.Location = new System.Drawing.Point(0, 387);
     this.groupBox2.Name     = "groupBox2";
     this.groupBox2.Size     = new System.Drawing.Size(598, 136);
     this.groupBox2.TabIndex = 5;
     this.groupBox2.TabStop  = false;
     this.groupBox2.Text     = "Events";
     //
     // lstEvents
     //
     this.lstEvents.Dock           = System.Windows.Forms.DockStyle.Fill;
     this.lstEvents.Font           = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lstEvents.IntegralHeight = false;
     this.lstEvents.ItemHeight     = 16;
     this.lstEvents.Location       = new System.Drawing.Point(3, 16);
     this.lstEvents.Name           = "lstEvents";
     this.lstEvents.Size           = new System.Drawing.Size(592, 117);
     this.lstEvents.TabIndex       = 2;
     //
     // dockControlOutput
     //
     this.dockControlOutput.Controls.Add(this.groupBox3);
     this.dockControlOutput.Controls.Add(this.btnSaveLog);
     this.dockControlOutput.Controls.Add(this.btnClear);
     this.dockControlOutput.Guid     = new System.Guid("e4b3c490-2cd9-4436-a969-ac697467fb4a");
     this.dockControlOutput.Location = new System.Drawing.Point(5, 33);
     this.dockControlOutput.Name     = "dockControlOutput";
     this.dockControlOutput.Size     = new System.Drawing.Size(598, 523);
     this.dockControlOutput.TabIndex = 1;
     this.dockControlOutput.Text     = "Standard Output Log";
     //
     // groupBox3
     //
     this.groupBox3.Controls.Add(this.rtbStdOutLog);
     this.groupBox3.Location = new System.Drawing.Point(0, 0);
     this.groupBox3.Name     = "groupBox3";
     this.groupBox3.Size     = new System.Drawing.Size(603, 460);
     this.groupBox3.TabIndex = 3;
     this.groupBox3.TabStop  = false;
     this.groupBox3.Text     = "Standard Output";
     //
     // rtbStdOutLog
     //
     this.rtbStdOutLog.Dock      = System.Windows.Forms.DockStyle.Fill;
     this.rtbStdOutLog.Enabled   = false;
     this.rtbStdOutLog.Font      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
     this.rtbStdOutLog.ForeColor = System.Drawing.SystemColors.Desktop;
     this.rtbStdOutLog.Location  = new System.Drawing.Point(3, 16);
     this.rtbStdOutLog.Name      = "rtbStdOutLog";
     this.rtbStdOutLog.ReadOnly  = true;
     this.rtbStdOutLog.Size      = new System.Drawing.Size(597, 441);
     this.rtbStdOutLog.TabIndex  = 0;
     this.rtbStdOutLog.Text      = "";
     //
     // btnSaveLog
     //
     this.btnSaveLog.Location = new System.Drawing.Point(435, 466);
     this.btnSaveLog.Name     = "btnSaveLog";
     this.btnSaveLog.Size     = new System.Drawing.Size(75, 23);
     this.btnSaveLog.TabIndex = 2;
     this.btnSaveLog.Text     = "Save Log";
     this.btnSaveLog.UseVisualStyleBackColor = true;
     this.btnSaveLog.Click += new System.EventHandler(this.btnSaveLog_Click);
     //
     // btnClear
     //
     this.btnClear.Location = new System.Drawing.Point(516, 466);
     this.btnClear.Name     = "btnClear";
     this.btnClear.Size     = new System.Drawing.Size(75, 23);
     this.btnClear.TabIndex = 1;
     this.btnClear.Text     = "Clear";
     this.btnClear.UseVisualStyleBackColor = true;
     this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
     //
     // frmMain
     //
     this.AccessibleName    = "WatirRecorder#";
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(608, 605);
     this.Controls.Add(this.documentContainer1);
     this.Controls.Add(this.toolBar1);
     this.Controls.Add(this.statusBar1);
     this.Controls.Add(this.leftSandDock);
     this.Controls.Add(this.rightSandDock);
     this.Controls.Add(this.bottomSandDock);
     this.Controls.Add(this.topSandDock);
     this.Icon  = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name  = "frmMain";
     this.Text  = "WatirRecorder#";
     this.Load += new System.EventHandler(this.frmMain_Load);
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
     this.documentContainer1.ResumeLayout(false);
     this.dockControl1.ResumeLayout(false);
     this.panel1.ResumeLayout(false);
     this.groupBox1.ResumeLayout(false);
     this.groupBox2.ResumeLayout(false);
     this.dockControlOutput.ResumeLayout(false);
     this.groupBox3.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Exemple #37
0
        public RunView(Run run)
        {
            count++;
            this.Text         = Path.GetFileNameWithoutExtension(run.Executable) + " #" + count;
            namespaces        = new NamespaceView(this);
            namespaces.Height = 100;
            namespaces.Dock   = DockStyle.Fill;

            //callers.DoubleClick += delegate { CallersNext(); };
            //callers.KeyDown += delegate(object sender, KeyEventArgs e)
            //{
            //    if (e.KeyData == Keys.Enter)
            //    {
            //        CallersNext();
            //    }
            //};
            //callees.KeyDown += delegate(object sender, KeyEventArgs e)
            //{
            //    if (e.KeyData == Keys.Enter)
            //    {
            //        CalleesNext();
            //    }
            //};

            //callees.DoubleClick += delegate
            //{
            //    CalleesNext();
            //};


            ContextMenu callerMenu = new ContextMenu(
                new MenuItem[] {
                new MenuItem(
                    "go to method",
                    delegate {
                    GoToCaller(callers);
                },
                    Shortcut.CtrlN
                    ),
                new MenuItem(
                    "go to callee",
                    delegate {
                    GoToCallee(callers);
                },
                    Shortcut.CtrlN
                    )
            }
                );
            ContextMenu calleesMenu = new ContextMenu(
                new MenuItem[] {
                new MenuItem(
                    "go to method",
                    delegate
                {
                    GoToCallee(callers);
                },
                    Shortcut.CtrlE
                    ),
                new MenuItem(
                    "go to callee",
                    delegate
                {
                    GoToCaller(callers);
                },
                    Shortcut.CtrlN
                    )
            }
                );

            callees.Size = new Size(100, 100);
            callers.Size = new Size(100, 100);
            callees.Dock = DockStyle.Fill;
            callers.Dock = DockStyle.Fill;
            SplitContainer methodPanel = new SplitContainer();

            methodPanel.Orientation = Orientation.Horizontal;


            //const string columnCaptions = "        Inclusive   Method signature";

            methodPanel.Panel2.Controls.Add(callers);
            //methodPanel.Panel2.Controls.Add(Caption(columnCaptions));
            methodPanel.Panel2.Controls.Add(Caption("Callers"));
            methodPanel.Panel1.Controls.Add(callees);
            //methodPanel.Panel1.Controls.Add(Caption(columnCaptions));
            methodPanel.Panel1.Controls.Add(Caption("Calls"));

            methodPanel.Dock = DockStyle.Fill;
            methodPanel.Dock = DockStyle.Fill;
            Panel panel      = new Panel();
            Panel rightPanel = new Panel();

            Splitter mainSplitter = new Splitter();

            mainSplitter.Dock = DockStyle.Left;

            Panel leftPanel = new Panel();

            leftPanel.Width = 200;
            leftPanel.Dock  = DockStyle.Left;

            rightPanel.Dock = DockStyle.Fill;
            rightPanel.Controls.Add(methodPanel);

            leftPanel.Controls.Add(namespaces);
            leftPanel.Controls.Add(Caption("Namespaces"));

            panel.Dock = DockStyle.Fill;
            panel.Controls.AddRange(new Control[] { rightPanel, mainSplitter, leftPanel });
            panel.Padding = new Padding(5);
            namespaces.Update(run, run.callers);
            callees.Update(run, run.functions);
            callers.Update(run, run.callers);
            this.Controls.Add(panel);
        }
Exemple #38
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(Frm_fin_treealle));
            this.tree = new System.Windows.Forms.TreeView();
            this.icons = new System.Windows.Forms.ImageList(this.components);
            this.dataGrid1 = new System.Windows.Forms.DataGrid();
            this.DS = new fin_treealle.vistaForm();
            this.btnOk = new System.Windows.Forms.Button();
            this.btnCancel = new System.Windows.Forms.Button();
            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
            this.MetaDataDetail = new System.Windows.Forms.GroupBox();
            this.splitter1 = new System.Windows.Forms.Splitter();
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.DS)).BeginInit();
            this.MetaDataDetail.SuspendLayout();
            this.SuspendLayout();
            // 
            // tree
            // 
            this.tree.Dock = System.Windows.Forms.DockStyle.Left;
            this.tree.HideSelection = false;
            this.tree.ImageIndex = 1;
            this.tree.ImageList = this.icons;
            this.tree.Location = new System.Drawing.Point(0, 0);
            this.tree.Name = "tree";
            this.tree.SelectedImageIndex = 0;
            this.tree.ShowPlusMinus = false;
            this.tree.Size = new System.Drawing.Size(315, 559);
            this.tree.TabIndex = 0;
            this.tree.Tag = "fin.tree";
            // 
            // icons
            // 
            this.icons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("icons.ImageStream")));
            this.icons.TransparentColor = System.Drawing.Color.Transparent;
            this.icons.Images.SetKeyName(0, "");
            this.icons.Images.SetKeyName(1, "");
            // 
            // dataGrid1
            // 
            this.dataGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
            | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.dataGrid1.DataMember = "";
            this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
            this.dataGrid1.Location = new System.Drawing.Point(9, 19);
            this.dataGrid1.Name = "dataGrid1";
            this.dataGrid1.Size = new System.Drawing.Size(575, 490);
            this.dataGrid1.TabIndex = 1;
            this.dataGrid1.Tag = "TreeNavigator.tree";
            // 
            // DS
            // 
            this.DS.DataSetName = "vistaForm";
            this.DS.EnforceConstraints = false;
            this.DS.Locale = new System.Globalization.CultureInfo("en-US");
            // 
            // btnOk
            // 
            this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnOk.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnOk.Location = new System.Drawing.Point(414, 524);
            this.btnOk.Name = "btnOk";
            this.btnOk.Size = new System.Drawing.Size(75, 23);
            this.btnOk.TabIndex = 2;
            this.btnOk.Tag = "mainselect";
            this.btnOk.Text = "Ok";
            // 
            // btnCancel
            // 
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.Location = new System.Drawing.Point(495, 524);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(75, 23);
            this.btnCancel.TabIndex = 3;
            this.btnCancel.Text = "Cancel";
            // 
            // MetaDataDetail
            // 
            this.MetaDataDetail.Controls.Add(this.dataGrid1);
            this.MetaDataDetail.Controls.Add(this.btnOk);
            this.MetaDataDetail.Controls.Add(this.btnCancel);
            this.MetaDataDetail.Dock = System.Windows.Forms.DockStyle.Fill;
            this.MetaDataDetail.Location = new System.Drawing.Point(315, 0);
            this.MetaDataDetail.Name = "MetaDataDetail";
            this.MetaDataDetail.Size = new System.Drawing.Size(590, 559);
            this.MetaDataDetail.TabIndex = 4;
            this.MetaDataDetail.TabStop = false;
            // 
            // splitter1
            // 
            this.splitter1.Location = new System.Drawing.Point(315, 0);
            this.splitter1.Name = "splitter1";
            this.splitter1.Size = new System.Drawing.Size(3, 559);
            this.splitter1.TabIndex = 5;
            this.splitter1.TabStop = false;
            // 
            // Frm_fin_treealle
            // 
            this.AcceptButton = this.btnOk;
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.CancelButton = this.btnCancel;
            this.ClientSize = new System.Drawing.Size(905, 559);
            this.Controls.Add(this.splitter1);
            this.Controls.Add(this.MetaDataDetail);
            this.Controls.Add(this.tree);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.Name = "Frm_fin_treealle";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "frmTreeBilancio";
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.DS)).EndInit();
            this.MetaDataDetail.ResumeLayout(false);
            this.ResumeLayout(false);

		}
Exemple #39
0
 private void InitializeComponent()
 {
     this.components     = new System.ComponentModel.Container();
     this.splitter1      = new System.Windows.Forms.Splitter();
     this.panel1         = new System.Windows.Forms.Panel();
     this.tabControl1    = new System.Windows.Forms.TabControl();
     this.tabPage1       = new System.Windows.Forms.TabPage();
     this.CollapseButton = new Findwise.SolutionManager.Controls.NoFocusButton();
     this.toolTip1       = new System.Windows.Forms.ToolTip(this.components);
     this.tabControl1.SuspendLayout();
     this.SuspendLayout();
     //
     // splitter1
     //
     this.splitter1.Location   = new System.Drawing.Point(0, 0);
     this.splitter1.Name       = "splitter1";
     this.splitter1.Size       = new System.Drawing.Size(3, 3);
     this.splitter1.TabIndex   = 0;
     this.splitter1.TabStop    = false;
     this.splitter1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.splitter1_MouseDown);
     this.splitter1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.splitter1_MouseMove);
     this.splitter1.MouseUp   += new System.Windows.Forms.MouseEventHandler(this.splitter1_MouseUp);
     //
     // panel1
     //
     this.panel1.AutoScroll = true;
     this.panel1.Dock       = System.Windows.Forms.DockStyle.Fill;
     this.panel1.Location   = new System.Drawing.Point(0, 0);
     this.panel1.Name       = "panel1";
     this.panel1.Size       = new System.Drawing.Size(200, 100);
     this.panel1.TabIndex   = 0;
     //
     // tabControl1
     //
     this.tabControl1.Controls.Add(this.tabPage1);
     this.tabControl1.Dock          = System.Windows.Forms.DockStyle.Fill;
     this.tabControl1.Location      = new System.Drawing.Point(0, 0);
     this.tabControl1.Name          = "tabControl1";
     this.tabControl1.SelectedIndex = 0;
     this.tabControl1.Size          = new System.Drawing.Size(200, 100);
     this.tabControl1.TabIndex      = 0;
     //
     // tabPage1
     //
     this.tabPage1.Location = new System.Drawing.Point(4, 22);
     this.tabPage1.Name     = "tabPage1";
     this.tabPage1.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPage1.Size     = new System.Drawing.Size(192, 74);
     this.tabPage1.TabIndex = 0;
     this.tabPage1.UseVisualStyleBackColor = true;
     //
     // CollapseButton
     //
     this.CollapseButton.AutoSizeMode            = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.CollapseButton.Location                = new System.Drawing.Point(0, 0);
     this.CollapseButton.Name                    = "CollapseButton";
     this.CollapseButton.Size                    = new System.Drawing.Size(21, 21);
     this.CollapseButton.TabIndex                = 0;
     this.CollapseButton.Text                    = "📌";
     this.CollapseButton.UseVisualStyleBackColor = true;
     this.CollapseButton.Click                  += new System.EventHandler(this.CollapseButton_Click);
     this.tabControl1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
 private void InitializeComponent()
 {
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1  = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2  = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3  = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4  = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5  = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6  = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7  = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8  = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9  = new System.Windows.Forms.DataGridViewCellStyle();
     System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
     this.toolStrip1                 = new System.Windows.Forms.ToolStrip();
     this.tsbResetCounters           = new System.Windows.Forms.ToolStripButton();
     this.dgvProviderCounters        = new System.Windows.Forms.DataGridView();
     this.colProvider                = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.colTrades                  = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.colTradesDelta             = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.colQuotes                  = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.colQuotesDelta             = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.colEmpty                   = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.splitter1                  = new System.Windows.Forms.Splitter();
     this.dgvInstrumentCounters      = new System.Windows.Forms.DataGridView();
     this.colInstrument              = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
     this.toolStrip1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.dgvProviderCounters)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dgvInstrumentCounters)).BeginInit();
     this.SuspendLayout();
     //
     // toolStrip1
     //
     this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.tsbResetCounters
     });
     this.toolStrip1.Location = new System.Drawing.Point(0, 0);
     this.toolStrip1.Name     = "toolStrip1";
     this.toolStrip1.Size     = new System.Drawing.Size(586, 25);
     this.toolStrip1.TabIndex = 0;
     this.toolStrip1.Text     = "toolStrip1";
     //
     // tsbResetCounters
     //
     this.tsbResetCounters.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsbResetCounters.Image                 = global::OpenQuant.Shared.Properties.Resources.evtmon_reset;
     this.tsbResetCounters.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tsbResetCounters.Name   = "tsbResetCounters";
     this.tsbResetCounters.Size   = new System.Drawing.Size(23, 22);
     this.tsbResetCounters.Text   = "Reset Counters";
     this.tsbResetCounters.Click += new System.EventHandler(this.tsbResetCounters_Click);
     //
     // dgvProviderCounters
     //
     this.dgvProviderCounters.AllowUserToAddRows          = false;
     this.dgvProviderCounters.AllowUserToDeleteRows       = false;
     this.dgvProviderCounters.AllowUserToResizeRows       = false;
     this.dgvProviderCounters.BackgroundColor             = System.Drawing.SystemColors.Window;
     this.dgvProviderCounters.BorderStyle                 = System.Windows.Forms.BorderStyle.None;
     this.dgvProviderCounters.CellBorderStyle             = System.Windows.Forms.DataGridViewCellBorderStyle.None;
     this.dgvProviderCounters.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     this.dgvProviderCounters.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
         this.colProvider,
         this.colTrades,
         this.colTradesDelta,
         this.colQuotes,
         this.colQuotesDelta,
         this.colEmpty
     });
     this.dgvProviderCounters.Dock               = System.Windows.Forms.DockStyle.Top;
     this.dgvProviderCounters.Location           = new System.Drawing.Point(0, 25);
     this.dgvProviderCounters.MultiSelect        = false;
     this.dgvProviderCounters.Name               = "dgvProviderCounters";
     this.dgvProviderCounters.RowHeadersVisible  = false;
     this.dgvProviderCounters.RowTemplate.Height = 19;
     this.dgvProviderCounters.SelectionMode      = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
     this.dgvProviderCounters.ShowCellErrors     = false;
     this.dgvProviderCounters.ShowEditingIcon    = false;
     this.dgvProviderCounters.ShowRowErrors      = false;
     this.dgvProviderCounters.Size               = new System.Drawing.Size(586, 130);
     this.dgvProviderCounters.TabIndex           = 1;
     this.dgvProviderCounters.SelectionChanged  += new System.EventHandler(this.dgvProviderCounters_SelectionChanged);
     //
     // colProvider
     //
     this.colProvider.HeaderText = "Provider";
     this.colProvider.Name       = "colProvider";
     this.colProvider.ReadOnly   = true;
     //
     // colTrades
     //
     dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
     dataGridViewCellStyle1.Format    = "n0";
     this.colTrades.DefaultCellStyle  = dataGridViewCellStyle1;
     this.colTrades.HeaderText        = "Trades (total)";
     this.colTrades.Name     = "colTrades";
     this.colTrades.ReadOnly = true;
     //
     // colTradesDelta
     //
     dataGridViewCellStyle2.Alignment     = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
     dataGridViewCellStyle2.Format        = "n0";
     this.colTradesDelta.DefaultCellStyle = dataGridViewCellStyle2;
     this.colTradesDelta.HeaderText       = "Trades (delta)";
     this.colTradesDelta.Name             = "colTradesDelta";
     this.colTradesDelta.ReadOnly         = true;
     //
     // colQuotes
     //
     dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
     dataGridViewCellStyle3.Format    = "n0";
     this.colQuotes.DefaultCellStyle  = dataGridViewCellStyle3;
     this.colQuotes.HeaderText        = "Quotes (total)";
     this.colQuotes.Name     = "colQuotes";
     this.colQuotes.ReadOnly = true;
     //
     // colQuotesDelta
     //
     dataGridViewCellStyle4.Alignment     = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
     dataGridViewCellStyle4.Format        = "n0";
     this.colQuotesDelta.DefaultCellStyle = dataGridViewCellStyle4;
     this.colQuotesDelta.HeaderText       = "Quotes (delta)";
     this.colQuotesDelta.Name             = "colQuotesDelta";
     this.colQuotesDelta.ReadOnly         = true;
     //
     // colEmpty
     //
     this.colEmpty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
     dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Window;
     this.colEmpty.DefaultCellStyle            = dataGridViewCellStyle5;
     this.colEmpty.HeaderText = "";
     this.colEmpty.Name       = "colEmpty";
     this.colEmpty.ReadOnly   = true;
     this.colEmpty.SortMode   = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
     //
     // splitter1
     //
     this.splitter1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.splitter1.Location = new System.Drawing.Point(0, 155);
     this.splitter1.Name     = "splitter1";
     this.splitter1.Size     = new System.Drawing.Size(586, 4);
     this.splitter1.TabIndex = 2;
     this.splitter1.TabStop  = false;
     //
     // dgvInstrumentCounters
     //
     this.dgvInstrumentCounters.AllowUserToAddRows          = false;
     this.dgvInstrumentCounters.AllowUserToDeleteRows       = false;
     this.dgvInstrumentCounters.AllowUserToResizeRows       = false;
     this.dgvInstrumentCounters.BackgroundColor             = System.Drawing.SystemColors.Window;
     this.dgvInstrumentCounters.BorderStyle                 = System.Windows.Forms.BorderStyle.None;
     this.dgvInstrumentCounters.CellBorderStyle             = System.Windows.Forms.DataGridViewCellBorderStyle.None;
     this.dgvInstrumentCounters.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     this.dgvInstrumentCounters.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
         this.colInstrument,
         this.dataGridViewTextBoxColumn1,
         this.dataGridViewTextBoxColumn2,
         this.dataGridViewTextBoxColumn3,
         this.dataGridViewTextBoxColumn4,
         this.dataGridViewTextBoxColumn5
     });
     this.dgvInstrumentCounters.Dock               = System.Windows.Forms.DockStyle.Fill;
     this.dgvInstrumentCounters.Location           = new System.Drawing.Point(0, 159);
     this.dgvInstrumentCounters.MultiSelect        = false;
     this.dgvInstrumentCounters.Name               = "dgvInstrumentCounters";
     this.dgvInstrumentCounters.RowHeadersVisible  = false;
     this.dgvInstrumentCounters.RowTemplate.Height = 19;
     this.dgvInstrumentCounters.SelectionMode      = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
     this.dgvInstrumentCounters.ShowCellErrors     = false;
     this.dgvInstrumentCounters.ShowEditingIcon    = false;
     this.dgvInstrumentCounters.ShowRowErrors      = false;
     this.dgvInstrumentCounters.Size               = new System.Drawing.Size(586, 269);
     this.dgvInstrumentCounters.TabIndex           = 3;
     //
     // colInstrument
     //
     this.colInstrument.HeaderText = "Instrument";
     this.colInstrument.Name       = "colInstrument";
     this.colInstrument.ReadOnly   = true;
     //
     // dataGridViewTextBoxColumn1
     //
     dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
     dataGridViewCellStyle6.Format    = "n0";
     this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle6;
     this.dataGridViewTextBoxColumn1.HeaderText       = "Trades (total)";
     this.dataGridViewTextBoxColumn1.Name             = "dataGridViewTextBoxColumn1";
     this.dataGridViewTextBoxColumn1.ReadOnly         = true;
     //
     // dataGridViewTextBoxColumn2
     //
     dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
     dataGridViewCellStyle7.Format    = "n0";
     this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle7;
     this.dataGridViewTextBoxColumn2.HeaderText       = "Trades (delta)";
     this.dataGridViewTextBoxColumn2.Name             = "dataGridViewTextBoxColumn2";
     this.dataGridViewTextBoxColumn2.ReadOnly         = true;
     //
     // dataGridViewTextBoxColumn3
     //
     dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
     dataGridViewCellStyle8.Format    = "n0";
     this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle8;
     this.dataGridViewTextBoxColumn3.HeaderText       = "Quotes (total)";
     this.dataGridViewTextBoxColumn3.Name             = "dataGridViewTextBoxColumn3";
     this.dataGridViewTextBoxColumn3.ReadOnly         = true;
     //
     // dataGridViewTextBoxColumn4
     //
     dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
     dataGridViewCellStyle9.Format    = "n0";
     this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle9;
     this.dataGridViewTextBoxColumn4.HeaderText       = "Quotes (delta)";
     this.dataGridViewTextBoxColumn4.Name             = "dataGridViewTextBoxColumn4";
     this.dataGridViewTextBoxColumn4.ReadOnly         = true;
     //
     // dataGridViewTextBoxColumn5
     //
     this.dataGridViewTextBoxColumn5.AutoSizeMode     = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
     dataGridViewCellStyle10.SelectionBackColor       = System.Drawing.SystemColors.Window;
     this.dataGridViewTextBoxColumn5.DefaultCellStyle = dataGridViewCellStyle10;
     this.dataGridViewTextBoxColumn5.HeaderText       = "";
     this.dataGridViewTextBoxColumn5.Name             = "dataGridViewTextBoxColumn5";
     this.dataGridViewTextBoxColumn5.ReadOnly         = true;
     this.dataGridViewTextBoxColumn5.SortMode         = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
     //
     // EventMonitorWindow
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.dgvInstrumentCounters);
     this.Controls.Add(this.splitter1);
     this.Controls.Add(this.dgvProviderCounters);
     this.Controls.Add(this.toolStrip1);
     this.DefaultDockLocation = TD.SandDock.ContainerDockLocation.Center;
     this.Name     = "EventMonitorWindow";
     this.Size     = new System.Drawing.Size(586, 428);
     this.TabImage = global::OpenQuant.Shared.Properties.Resources.evtmon;
     this.Text     = "Event Monitor";
     this.toolStrip1.ResumeLayout(false);
     this.toolStrip1.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.dgvProviderCounters)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dgvInstrumentCounters)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Exemple #41
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);
 }
Exemple #42
0
                private void initalize()
                {
                    this._application.status_bar_inform.Text = "Initializing...";
                    this._chat_window = new TextBox();
                    this._user_list = new TextBox();
                    this._entry = new TextBox();
                    this._splitter = new Splitter();
                    this._send_button = new Button();

                    // dummy text to be removed //
                    this._chat_window.Text = "Hi there";
                    this._user_list.Text = "Username";

                    /* start chat window setup */
                    this._chat_window.Multiline = true;
                    this._chat_window.Height = this._application.container.Height - 25;
                    this._chat_window.Width = this._application.container.Width - 100;
                    this._chat_window.ReadOnly = true;
                    this._chat_window.BackColor = Color.White;
                    this._chat_window.Top = 5;
                    this._chat_window.Left = 5;
                    this._chat_window.BorderStyle = BorderStyle.FixedSingle;
                    this._chat_window.Resize += new EventHandler(this.resize_fix_heights);
                    this._chat_window.Dock = DockStyle.Left;
                    /* end chat window setup */
                    /* start splitter setup */
                    this._splitter.BorderStyle = BorderStyle.FixedSingle;
                    this._splitter.Location = new Point(this._chat_window.Left + this._chat_window.Width, 0);
                    this._splitter.Height = this._application.container.Height - 25;
                    this._splitter.Width = 3;
                    this._splitter.BackColor = Color.Blue;
                    this._splitter.Dock = DockStyle.Left;
                    this._splitter.SplitterMoved += new SplitterEventHandler(this.split_resize_user_list);
                    /*end splitter setup */
                    /* start user list setup */
                    this._user_list.Multiline = true;
                    this._user_list.ReadOnly = true;
                    this._user_list.BorderStyle = BorderStyle.FixedSingle;
                    this._user_list.BackColor = Color.White;
                    this._user_list.Height = this._application.container.Height - 25;
                    this._user_list.Width = this._user_list_width = 150;
                    this._user_list.Dock = DockStyle.Left;
                    this._user_list.Left = this._chat_window.Left + this._chat_window.Width;
                    this._user_list.Resize += new EventHandler(this.resize_fix_heights);
                    this._user_list.Top = 5;
                    /* end user list setup */
                    /* start entry setup */
                    this._entry.BorderStyle = BorderStyle.FixedSingle;
                    this._entry.BackColor = Color.White;
                    this._entry.Width = this._application.container.Size.Width - 70;
                    this._entry.Left = 0;
                    this._entry.Top = this._application.container.Height - 20;
                    /* end entry setup */
                    /* start send button setup */
                    this._send_button.Width = 40;
                    this._send_button.Height = 15;
                    this._send_button.Text = "Send";
                    this._send_button.BackColor = Color.White;
                    this._send_button.Top = this._application.container.Height - 25;
                    this._send_button.Left = this._application.container.Width - 50;
                    this._application.status_bar_inform.Text = "Focusing...";
                    this.focus();
                    /* set resizing hooks and we are done */
                    this._application.container.SizeChanged += new EventHandler(this.resize_session);
                }
Exemple #43
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();
 }
Exemple #44
0
 public void AddPartner(Splitter s)
 {
     if(!partners.Contains(s))
         partners.Add (s);
 }
Exemple #45
0
        // 分割ボタン
        // splitPath(string)     : 分割するファイルのフルパス
        // splitFolder(string)   : 分割したファイルを保存するフォルダ
        // splitFileName(string) : 分割したファイルの名前(出力用)
        private void SplitButton_Click(object sender, EventArgs e)
        {
            // MainListにアイテムが存在するか?
            if (MainList.Items.Count == 0)
            {
                OriginalMessageBox_OK(Properties.Resources.EmptyList, MessageBoxIcon.Warning);
                return;
            }

            var dialog = new FolderBrowserDialog();
            dialog.Description = Properties.Resources.SaveFolder;
            var result = dialog.ShowDialog();
            if (result != DialogResult.OK)
            {
                return;
            }

            var splitter = new Splitter();
            var configure = new Configure();

            var successfile = new List<string>();
            var failedfile = new List<string>();
            int success = 0;
            int failed = 0;

            foreach (ListViewItem item in MainList.Items)
            {
                FileProperty obj = item.Tag as FileProperty;
                if (obj == null) continue;

                string splitFolder = dialog.SelectedPath;
                string splitFileName = item.SubItems[0].Text;
                string splitPath;

                if (obj.OwnerPassword == null)
                    splitPath = obj.Path;
                else
                {
                    try
                    {
                        splitPath = configure.DetachPassword(obj.Path, obj.OwnerPassword);
                    }
                    catch (FileNotFoundException err)
                    {
                        OriginalMessageBox_OK(err.Message, MessageBoxIcon.Error);
                        continue;
                    }
                }

                try
                {
                    var files = splitter.Run(splitPath, splitFolder);
                    if (files.Count > 0) successfile.AddRange(files);
                    success++;
                }
                catch (OperationCanceledException)
                {
                    continue;
                }

                // ファイルが既に消滅している場合、リストに追加してスルーする
                catch (FileNotFoundException)
                {
                    failedfile.Add(item.Text);
                    failed++;
                    continue;
                }
                catch (Exception err)
                {
                    OriginalMessageBox_OK(err.Message, MessageBoxIcon.Error);
                    continue;
                }
                finally
                {
                    if (obj.OwnerPassword != null)
                        File.Delete(configure.DetachPassword(obj.Path, obj.OwnerPassword));
                }
            }

            // 存在しないファイル(失敗)が一個でもあった
            if (failed > 0)
            {
                string faileditems = "";
                foreach (var item in failedfile)
                {
                    faileditems = faileditems + "\n" + Path.GetFileName(item);
                }
                OriginalMessageBox_OK(String.Format(Properties.Resources.SplitFailedFiles) + faileditems, MessageBoxIcon.Warning);
            }

            if (success > 0)
            {
                var listdelete =
                OriginalMessageBox_YesNo(String.Format(Properties.Resources.SplitDone, success), MessageBoxIcon.Information);

                // 分割に成功したファイルのみをリストから削除する
                foreach (ListViewItem item in MainList.Items)
                {
                    bool flag = false;
                    foreach (string fItem in failedfile)
                    {
                        if (fItem == item.Text)
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (!flag)
                    {
                        MainList.Items.Remove(item);
                    }
                }

                if (listdelete == DialogResult.Yes)
                {
                    foreach (string item in successfile.ToArray())
                    {
                        AddItemToList(item, null);
                    }
                }
            }
        }
	public void InsertSplitter(int Index)
	{
		Splitter icon = new Splitter();
		Icons.Insert(Index, icon);
	}
Exemple #47
0
 public SplitterPaneFactory(Splitter container, ViewContext viewContext)
 {
     this.container = container;
     this.viewContext = viewContext;
 }
Exemple #48
0
        public static NeuralNetwork<Matrix> CreateNorb(IDataSet<Matrix, Vector> dataSet)
        {
            var count  = 12;
            var branch = 5;

            var a = new ISingleLayer<Matrix, Matrix>[count];
            for (var i = 0; i < count; ++i)
                a[i] = new MatrixConvolutor(96, 96, 92, 92, new Tanh());

            var b = new ISingleLayer<Matrix, Matrix>[count];
            for (var i = 0; i < count; ++i)
                b[i] = new MatrixSubsampler(92, 92, 46, 46, new Tanh());

            var c = new ISingleLayer<Matrix, Matrix>[count];
            for (var i = 0; i < count; ++i)
                c[i] = new MatrixSubsampler(46, 46, 23, 23, new Tanh());

            var splitter    = new Splitter<Matrix, Matrix>(a);
            var applicator1 = new Applicator<Matrix, Matrix>(b);
            var merger      = new MatrixMerger<Matrix>(c);

            var classif  = new FullyConnectedLayer(23 * 23 * count, 5, new Tanh());

            var comp = CompositeLayer<Vector, Vector[], Vector>.Compose(splitter,
                                                                        applicator1,
                                                                        merger,
                                                                        classif
                                                                       );

            return new NeuralNetwork<Matrix>(comp);
        }
            public RichTextItem(Control parent, bool visible = false)
            {
                Key = Guid.NewGuid().ToString("N");

                Parent = parent;

                Spliter         = new Splitter();
                Spliter.Visible = false;

                BackGround         = new Panel();
                BackGround.Visible = false;

                Head         = new Button();
                Head.Width   = _headWidth;
                Head.Visible = false;

                Editor               = new RichTextBox();
                Editor.Visible       = false;
                Editor.HideSelection = false;

                BackGround.Name = Key;


                parent.Controls.Add(Spliter);
                Spliter.Cursor = Cursors.SizeNS;
                Spliter.Dock   = DockStyle.Top;
                Spliter.BringToFront();

                parent.Controls.Add(BackGround);
                BackGround.BorderStyle = BorderStyle.FixedSingle;
                BackGround.BackColor   = Color.Silver;
                BackGround.Dock        = DockStyle.Top;
                BackGround.BringToFront();

                BackGround.Left = -10000;
                BackGround.Top  = -10000;

                BackGround.Enter += DoEnterProcess;

                BackGround.Controls.Add(Head);
                Head.Dock = DockStyle.Left;

                Head.ImageAlign        = ContentAlignment.MiddleLeft;
                Head.TextAlign         = ContentAlignment.MiddleLeft;
                Head.TextImageRelation = TextImageRelation.ImageBeforeText;

                Head.Click += DoHeadClick;

                BackGround.Controls.Add(Editor);
                Editor.BorderStyle = BorderStyle.None;
                Editor.BringToFront();
                Editor.Dock = DockStyle.Fill;

                Editor.TextChanged += DoTextChanged;

                Editor.Visible = visible;
                Head.Visible   = visible;

                BackGround.Visible = visible;
                Spliter.Visible    = visible;
            }
Exemple #50
0
        private void InsertPanelAt(Control panel, int panelIndex, int rSIndex)
        {
            panel.Parent = this;
            panel.IsHidden = false;

            if (panels.Count > 0)
            {
                float right = 1;
                if (rSIndex < splitters.Count)
                    right = splitters[rSIndex].RelativePosition;

                float left = 0;
                if (rSIndex-1 >= 0)
                    left = splitters[rSIndex-1].RelativePosition;

                var newSplitter = new Splitter(this);
                newSplitter.RelativePosition = (right + left)/2;
                splitters.Insert(rSIndex,newSplitter);
            }

            panels.Insert(panelIndex,panel);
            Invalidate();
        }
 // Use this for initialization
 void Start()
 {
     split = GetComponent<Splitter>();
     vib = GetComponent<ColorBoxByPose>();
 }
Exemple #52
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.label1             = new System.Windows.Forms.Label();
     this._displayName       = new System.Windows.Forms.TextBox();
     this._resourceType      = new System.Windows.Forms.TextBox();
     this.label2             = new System.Windows.Forms.Label();
     this._properties        = new System.Windows.Forms.ListView();
     this.columnHeader1      = new System.Windows.Forms.ColumnHeader();
     this.columnHeader2      = new System.Windows.Forms.ColumnHeader();
     this.columnHeader4      = new System.Windows.Forms.ColumnHeader();
     this.columnHeader3      = new System.Windows.Forms.ColumnHeader();
     this.contextMenu1       = new System.Windows.Forms.ContextMenu();
     this.menuItem1          = new System.Windows.Forms.MenuItem();
     this.menuItem2          = new System.Windows.Forms.MenuItem();
     this.panel1             = new System.Windows.Forms.Panel();
     this._btnDeleteProperty = new System.Windows.Forms.Button();
     this._refresh           = new System.Windows.Forms.Button();
     this._traceProps        = new System.Windows.Forms.Button();
     this._btnDeleteResource = new System.Windows.Forms.Button();
     this._btnClose          = new System.Windows.Forms.Button();
     this._showLinks         = new System.Windows.Forms.CheckBox();
     this._btnCopy           = new System.Windows.Forms.Button();
     this.panel2             = new System.Windows.Forms.Panel();
     this._traceBox          = new System.Windows.Forms.ListBox();
     this.splitter1          = new System.Windows.Forms.Splitter();
     this._statusBar         = new System.Windows.Forms.StatusBar();
     this._setPropButton     = new System.Windows.Forms.Button();
     this.panel1.SuspendLayout();
     this.panel2.SuspendLayout();
     this.SuspendLayout();
     //
     // label1
     //
     this.label1.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.label1.Location  = new System.Drawing.Point(8, 12);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(80, 17);
     this.label1.TabIndex  = 0;
     this.label1.Text      = "Display name:";
     //
     // _displayName
     //
     this._displayName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                      | System.Windows.Forms.AnchorStyles.Right)));
     this._displayName.Location = new System.Drawing.Point(88, 8);
     this._displayName.Name     = "_displayName";
     this._displayName.ReadOnly = true;
     this._displayName.Size     = new System.Drawing.Size(392, 21);
     this._displayName.TabIndex = 1;
     this._displayName.Text     = "";
     //
     // _resourceType
     //
     this._resourceType.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                       | System.Windows.Forms.AnchorStyles.Right)));
     this._resourceType.Location = new System.Drawing.Point(88, 36);
     this._resourceType.Name     = "_resourceType";
     this._resourceType.ReadOnly = true;
     this._resourceType.Size     = new System.Drawing.Size(392, 21);
     this._resourceType.TabIndex = 3;
     this._resourceType.Text     = "";
     //
     // label2
     //
     this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.label2.Location  = new System.Drawing.Point(8, 40);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(80, 16);
     this.label2.TabIndex  = 2;
     this.label2.Text      = "Resource type:";
     //
     // _properties
     //
     this._properties.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
         this.columnHeader1,
         this.columnHeader2,
         this.columnHeader4,
         this.columnHeader3
     });
     this._properties.ContextMenu           = this.contextMenu1;
     this._properties.Dock                  = System.Windows.Forms.DockStyle.Top;
     this._properties.FullRowSelect         = true;
     this._properties.Location              = new System.Drawing.Point(0, 0);
     this._properties.Name                  = "_properties";
     this._properties.Size                  = new System.Drawing.Size(592, 232);
     this._properties.Sorting               = System.Windows.Forms.SortOrder.Ascending;
     this._properties.TabIndex              = 4;
     this._properties.View                  = System.Windows.Forms.View.Details;
     this._properties.DoubleClick          += new System.EventHandler(this.OnDoubleClick);
     this._properties.SelectedIndexChanged += new System.EventHandler(this._properties_SelectedIndexChanged);
     //
     // columnHeader1
     //
     this.columnHeader1.Text  = "Name";
     this.columnHeader1.Width = 92;
     //
     // columnHeader2
     //
     this.columnHeader2.Text  = "Type";
     this.columnHeader2.Width = 107;
     //
     // columnHeader4
     //
     this.columnHeader4.Text  = "Dir";
     this.columnHeader4.Width = 40;
     //
     // columnHeader3
     //
     this.columnHeader3.Text  = "Value";
     this.columnHeader3.Width = 242;
     //
     // contextMenu1
     //
     this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItem1,
         this.menuItem2
     });
     //
     // menuItem1
     //
     this.menuItem1.Index  = 0;
     this.menuItem1.Text   = "Show Blob As Picture";
     this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
     //
     // menuItem2
     //
     this.menuItem2.Index  = 1;
     this.menuItem2.Text   = "Show BlobAs Text";
     this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
     //
     // panel1
     //
     this.panel1.Controls.Add(this._setPropButton);
     this.panel1.Controls.Add(this._btnDeleteProperty);
     this.panel1.Controls.Add(this._refresh);
     this.panel1.Controls.Add(this._traceProps);
     this.panel1.Controls.Add(this._btnDeleteResource);
     this.panel1.Controls.Add(this._btnClose);
     this.panel1.Controls.Add(this._showLinks);
     this.panel1.Controls.Add(this._btnCopy);
     this.panel1.Controls.Add(this._resourceType);
     this.panel1.Controls.Add(this._displayName);
     this.panel1.Controls.Add(this.label2);
     this.panel1.Controls.Add(this.label1);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.panel1.Location = new System.Drawing.Point(0, 0);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(592, 104);
     this.panel1.TabIndex = 5;
     //
     // _btnDeleteProperty
     //
     this._btnDeleteProperty.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._btnDeleteProperty.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this._btnDeleteProperty.Location  = new System.Drawing.Point(368, 76);
     this._btnDeleteProperty.Name      = "_btnDeleteProperty";
     this._btnDeleteProperty.Size      = new System.Drawing.Size(108, 23);
     this._btnDeleteProperty.TabIndex  = 10;
     this._btnDeleteProperty.Text      = "Delete Property";
     this._btnDeleteProperty.Click    += new System.EventHandler(this._btnDeleteProperty_Click);
     //
     // _refresh
     //
     this._refresh.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._refresh.Enabled   = false;
     this._refresh.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this._refresh.Location  = new System.Drawing.Point(96, 76);
     this._refresh.Name      = "_refresh";
     this._refresh.TabIndex  = 9;
     this._refresh.Text      = "Refresh";
     this._refresh.Click    += new System.EventHandler(this.OnRefresh);
     //
     // _traceProps
     //
     this._traceProps.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._traceProps.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this._traceProps.Location  = new System.Drawing.Point(176, 76);
     this._traceProps.Name      = "_traceProps";
     this._traceProps.TabIndex  = 8;
     this._traceProps.Text      = "Trace";
     this._traceProps.Click    += new System.EventHandler(this.OnTrace);
     //
     // _btnDeleteResource
     //
     this._btnDeleteResource.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._btnDeleteResource.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this._btnDeleteResource.Location  = new System.Drawing.Point(256, 76);
     this._btnDeleteResource.Name      = "_btnDeleteResource";
     this._btnDeleteResource.Size      = new System.Drawing.Size(108, 23);
     this._btnDeleteResource.TabIndex  = 7;
     this._btnDeleteResource.Text      = "Delete Resource";
     this._btnDeleteResource.Click    += new System.EventHandler(this.OnDeleteResource);
     //
     // _btnClose
     //
     this._btnClose.Anchor       = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this._btnClose.FlatStyle    = System.Windows.Forms.FlatStyle.System;
     this._btnClose.Location     = new System.Drawing.Point(500, 36);
     this._btnClose.Name         = "_btnClose";
     this._btnClose.Size         = new System.Drawing.Size(75, 24);
     this._btnClose.TabIndex     = 6;
     this._btnClose.Text         = "Close";
     this._btnClose.Click       += new System.EventHandler(this.OnClose);
     //
     // _showLinks
     //
     this._showLinks.FlatStyle       = System.Windows.Forms.FlatStyle.System;
     this._showLinks.Location        = new System.Drawing.Point(8, 64);
     this._showLinks.Name            = "_showLinks";
     this._showLinks.Size            = new System.Drawing.Size(128, 16);
     this._showLinks.TabIndex        = 5;
     this._showLinks.Text            = "Show links:";
     this._showLinks.CheckedChanged += new System.EventHandler(this._showLinks_CheckedChanged);
     //
     // _btnCopy
     //
     this._btnCopy.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._btnCopy.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this._btnCopy.Location  = new System.Drawing.Point(500, 8);
     this._btnCopy.Name      = "_btnCopy";
     this._btnCopy.Size      = new System.Drawing.Size(75, 24);
     this._btnCopy.TabIndex  = 4;
     this._btnCopy.Text      = "Copy";
     this._btnCopy.Click    += new System.EventHandler(this._btnCopy_Click);
     //
     // panel2
     //
     this.panel2.Controls.Add(this._traceBox);
     this.panel2.Controls.Add(this.splitter1);
     this.panel2.Controls.Add(this._properties);
     this.panel2.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panel2.Location = new System.Drawing.Point(0, 104);
     this.panel2.Name     = "panel2";
     this.panel2.Size     = new System.Drawing.Size(592, 416);
     this.panel2.TabIndex = 6;
     //
     // _traceBox
     //
     this._traceBox.Dock     = System.Windows.Forms.DockStyle.Fill;
     this._traceBox.Font     = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
     this._traceBox.Location = new System.Drawing.Point(0, 235);
     this._traceBox.Name     = "_traceBox";
     this._traceBox.Size     = new System.Drawing.Size(592, 173);
     this._traceBox.TabIndex = 6;
     //
     // splitter1
     //
     this.splitter1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.splitter1.Location = new System.Drawing.Point(0, 232);
     this.splitter1.Name     = "splitter1";
     this.splitter1.Size     = new System.Drawing.Size(592, 3);
     this.splitter1.TabIndex = 5;
     this.splitter1.TabStop  = false;
     //
     // _statusBar
     //
     this._statusBar.Location = new System.Drawing.Point(0, 520);
     this._statusBar.Name     = "_statusBar";
     this._statusBar.Size     = new System.Drawing.Size(592, 22);
     this._statusBar.TabIndex = 5;
     //
     // _setPropButton
     //
     this._setPropButton.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this._setPropButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this._setPropButton.Location  = new System.Drawing.Point(480, 76);
     this._setPropButton.Name      = "_setPropButton";
     this._setPropButton.Size      = new System.Drawing.Size(96, 23);
     this._setPropButton.TabIndex  = 11;
     this._setPropButton.Text      = "Set Property";
     this._setPropButton.Click    += new System.EventHandler(this._setPropButton_Click);
     //
     // ResourcePropertiesDialog
     //
     this.AcceptButton      = this._btnClose;
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
     this.CancelButton      = this._btnClose;
     this.ClientSize        = new System.Drawing.Size(592, 542);
     this.Controls.Add(this.panel2);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this._statusBar);
     this.MinimumSize   = new System.Drawing.Size(544, 336);
     this.Name          = "ResourcePropertiesDialog";
     this.ShowInTaskbar = true;
     this.Text          = "Resource Properties";
     this.panel1.ResumeLayout(false);
     this.panel2.ResumeLayout(false);
     this.ResumeLayout(false);
 }
	public void InsertSplitter()
	{
		Splitter icon = new Splitter();
		Icons.Add(icon);
	}
        public LibraryWidget(MainViewWidget mainViewWidget, ThemeConfig theme)
        {
            this.theme          = theme;
            this.mainViewWidget = mainViewWidget;
            this.Padding        = 0;
            this.AnchorAll();

            var allControls = new FlowLayoutWidget(FlowDirection.TopToBottom);

            libraryContext = ApplicationController.Instance.LibraryTabContext;

            libraryView = new LibraryListView(libraryContext, theme)
            {
                Name = "LibraryView",
                // Drop containers if ShowContainers != 1
                ContainerFilter   = (container) => UserSettings.Instance.ShowContainers,
                BackgroundColor   = theme.BackgroundColor,
                Border            = new BorderDouble(top: 1),
                DoubleClickAction = LibraryListView.DoubleClickActions.PreviewItem
            };

            libraryView.SelectedItems.CollectionChanged += SelectedItems_CollectionChanged;

            libraryContext.ContainerChanged += Library_ContainerChanged;

            navBar = new OverflowBar(theme)
            {
                HAnchor = HAnchor.Stretch,
                VAnchor = VAnchor.Fit,
            };
            allControls.AddChild(navBar);
            theme.ApplyBottomBorder(navBar);

            breadCrumbWidget = new FolderBreadCrumbWidget(libraryContext, theme);
            navBar.AddChild(breadCrumbWidget);

            var searchPanel = new SearchInputBox(theme)
            {
                Visible = false,
                Margin  = new BorderDouble(10, 0, 5, 0),
            };

            searchPanel.searchInput.ActualTextEditWidget.EnterPressed += (s, e) =>
            {
                this.PerformSearch();
            };
            searchPanel.ResetButton.Click += (s, e) =>
            {
                breadCrumbWidget.Visible = true;
                searchPanel.Visible      = false;

                searchPanel.searchInput.Text = "";

                this.ClearSearch();
            };

            // Store a reference to the input field
            this.searchInput = searchPanel.searchInput;

            navBar.AddChild(searchPanel);

            searchButton         = theme.CreateSearchButton();
            searchButton.Enabled = false;
            searchButton.Name    = "Search Library Button";
            searchButton.Click  += (s, e) =>
            {
                if (searchPanel.Visible)
                {
                    PerformSearch();
                }
                else
                {
                    searchContainer = libraryContext.ActiveContainer;

                    breadCrumbWidget.Visible = false;
                    searchPanel.Visible      = true;
                    searchInput.Focus();
                }
            };
            navBar.AddChild(searchButton);

            PopupMenuButton viewOptionsButton;

            navBar.AddChild(
                viewOptionsButton = new PopupMenuButton(
                    new ImageWidget(AggContext.StaticData.LoadIcon("fa-sort_16.png", 32, 32, theme.InvertIcons))
            {
                //VAnchor = VAnchor.Center
            },
                    theme)
            {
                AlignToRightEdge = true,
                Name             = "Print Library View Options"
            });

            viewOptionsButton.DynamicPopupContent = () =>
            {
                var popupMenu = new PopupMenu(ApplicationController.Instance.MenuTheme);

                var siblingList = new List <GuiWidget>();

                popupMenu.CreateBoolMenuItem(
                    "Date Created".Localize(),
                    () => libraryView.ActiveSort == LibraryListView.SortKey.CreatedDate,
                    (v) => libraryView.ActiveSort = LibraryListView.SortKey.CreatedDate,
                    useRadioStyle: true,
                    siblingRadioButtonList: siblingList);

                popupMenu.CreateBoolMenuItem(
                    "Date Modified".Localize(),
                    () => libraryView.ActiveSort == LibraryListView.SortKey.ModifiedDate,
                    (v) => libraryView.ActiveSort = LibraryListView.SortKey.ModifiedDate,
                    useRadioStyle: true,
                    siblingRadioButtonList: siblingList);

                popupMenu.CreateBoolMenuItem(
                    "Name".Localize(),
                    () => libraryView.ActiveSort == LibraryListView.SortKey.Name,
                    (v) => libraryView.ActiveSort = LibraryListView.SortKey.Name,
                    useRadioStyle: true,
                    siblingRadioButtonList: siblingList);

                popupMenu.CreateSeparator();

                siblingList = new List <GuiWidget>();

                popupMenu.CreateBoolMenuItem(
                    "Ascending".Localize(),
                    () => libraryView.Ascending,
                    (v) => libraryView.Ascending = true,
                    useRadioStyle: true,
                    siblingRadioButtonList: siblingList);

                popupMenu.CreateBoolMenuItem(
                    "Descending".Localize(),
                    () => !libraryView.Ascending,
                    (v) => libraryView.Ascending = false,
                    useRadioStyle: true,
                    siblingRadioButtonList: siblingList);

                return(popupMenu);
            };

            PopupMenuButton viewMenuButton;

            navBar.AddChild(
                viewMenuButton = new PopupMenuButton(
                    new ImageWidget(AggContext.StaticData.LoadIcon("mi-view-list_10.png", 32, 32, theme.InvertIcons))
            {
                //VAnchor = VAnchor.Center
            },
                    theme)
            {
                AlignToRightEdge = true
            });

            viewMenuButton.DynamicPopupContent = () =>
            {
                var popupMenu = new PopupMenu(ApplicationController.Instance.MenuTheme);

                var listView = this.libraryView;

                var siblingList = new List <GuiWidget>();

                popupMenu.CreateBoolMenuItem(
                    "View List".Localize(),
                    () => ApplicationController.Instance.ViewState.LibraryViewMode == ListViewModes.RowListView,
                    (isChecked) =>
                {
                    ApplicationController.Instance.ViewState.LibraryViewMode = ListViewModes.RowListView;
                    listView.ListContentView = new RowListView(theme);
                    listView.Reload().ConfigureAwait(false);
                },
                    useRadioStyle: true,
                    siblingRadioButtonList: siblingList);
#if DEBUG
                popupMenu.CreateBoolMenuItem(
                    "View XSmall Icons".Localize(),
                    () => ApplicationController.Instance.ViewState.LibraryViewMode == ListViewModes.IconListView18,
                    (isChecked) =>
                {
                    ApplicationController.Instance.ViewState.LibraryViewMode = ListViewModes.IconListView18;
                    listView.ListContentView = new IconListView(theme, 18);
                    listView.Reload().ConfigureAwait(false);
                },
                    useRadioStyle: true,
                    siblingRadioButtonList: siblingList);

                popupMenu.CreateBoolMenuItem(
                    "View Small Icons".Localize(),
                    () => ApplicationController.Instance.ViewState.LibraryViewMode == ListViewModes.IconListView70,
                    (isChecked) =>
                {
                    ApplicationController.Instance.ViewState.LibraryViewMode = ListViewModes.IconListView70;
                    listView.ListContentView = new IconListView(theme, 70);
                    listView.Reload().ConfigureAwait(false);
                },
                    useRadioStyle: true,
                    siblingRadioButtonList: siblingList);
#endif
                popupMenu.CreateBoolMenuItem(
                    "View Icons".Localize(),
                    () => ApplicationController.Instance.ViewState.LibraryViewMode == ListViewModes.IconListView,
                    (isChecked) =>
                {
                    ApplicationController.Instance.ViewState.LibraryViewMode = ListViewModes.IconListView;
                    listView.ListContentView = new IconListView(theme);
                    listView.Reload().ConfigureAwait(false);
                },
                    useRadioStyle: true,
                    siblingRadioButtonList: siblingList);

                popupMenu.CreateBoolMenuItem(
                    "View Large Icons".Localize(),
                    () => ApplicationController.Instance.ViewState.LibraryViewMode == ListViewModes.IconListView256,
                    (isChecked) =>
                {
                    ApplicationController.Instance.ViewState.LibraryViewMode = ListViewModes.IconListView256;
                    listView.ListContentView = new IconListView(theme, 256);
                    listView.Reload().ConfigureAwait(false);
                },
                    useRadioStyle: true,
                    siblingRadioButtonList: siblingList);

                return(popupMenu);
            };

            var horizontalSplitter = new Splitter()
            {
                SplitterDistance   = UserSettings.Instance.LibraryViewWidth,
                SplitterSize       = theme.SplitterWidth,
                SplitterBackground = theme.SplitterBackground
            };
            horizontalSplitter.AnchorAll();

            horizontalSplitter.DistanceChanged += (s, e) =>
            {
                UserSettings.Instance.LibraryViewWidth = horizontalSplitter.SplitterDistance;
            };

            allControls.AddChild(horizontalSplitter);

            libraryTreeView = new TreeView(theme)
            {
                HAnchor = HAnchor.Stretch,
                VAnchor = VAnchor.Stretch,
                Margin  = 5
            };
            libraryTreeView.AfterSelect += async(s, e) =>
            {
                if (libraryTreeView.SelectedNode is ContainerTreeNode treeNode)
                {
                    if (!treeNode.ContainerAcquired)
                    {
                        await this.EnsureExpanded(treeNode.Tag as ILibraryItem, treeNode);
                    }

                    if (treeNode.ContainerAcquired)
                    {
                        libraryContext.ActiveContainer = treeNode.Container;
                    }
                }
            };
            horizontalSplitter.Panel1.AddChild(libraryTreeView);

            var rootColumn = new FlowLayoutWidget(FlowDirection.TopToBottom)
            {
                HAnchor = HAnchor.Fit,
                VAnchor = VAnchor.Fit,
                Margin  = new BorderDouble(left: 10)
            };
            libraryTreeView.AddChild(rootColumn);

            if (AppContext.IsLoading)
            {
                ApplicationController.StartupActions.Add(new ApplicationController.StartupAction()
                {
                    Title    = "Initializing Library".Localize(),
                    Priority = 0,
                    Action   = () =>
                    {
                        this.LoadRootLibraryNodes(rootColumn);
                    }
                });
            }
            else
            {
                this.LoadRootLibraryNodes(rootColumn);
            }

            horizontalSplitter.Panel2.AddChild(libraryView);

            buttonPanel = new FlowLayoutWidget()
            {
                HAnchor = HAnchor.Stretch,
                Padding = theme.ToolbarPadding,
            };
            AddLibraryButtonElements();
            allControls.AddChild(buttonPanel);

            allControls.AnchorAll();

            this.AddChild(allControls);
        }
 private void InitializeComponent()
 {
     this.icontainer_0 = new Container();
     this.panel1 = new Panel();
     this.groupBox2 = new GroupBox();
     this.listView1 = new ListView();
     this.columnHeader_0 = new ColumnHeader();
     this.columnHeader_1 = new ColumnHeader();
     this.columnHeader_2 = new ColumnHeader();
     this.columnHeader_3 = new ColumnHeader();
     this.imageList_0 = new ImageList(this.icontainer_0);
     this.toolStrip1 = new ToolStrip();
     this.btnAdd = new ToolStripButton();
     this.btnEdit = new ToolStripButton();
     this.btnDelete = new ToolStripButton();
     this.panel2 = new Panel();
     this.btnImport = new Button();
     this.btnCancel = new Button();
     this.btnOK = new Button();
     this.groupBox1 = new GroupBox();
     this.cboCommandType = new ComboBox();
     this.label3 = new Label();
     this.txtDataBase = new TextBox();
     this.label2 = new Label();
     this.txtName = new TextBox();
     this.label1 = new Label();
     this.splitter1 = new Splitter();
     this.txtCode = new SyntaxHighlighterControl();
     this.label4 = new Label();
     this.nudTimeout = new NumericUpDown();
     this.panel1.SuspendLayout();
     this.groupBox2.SuspendLayout();
     this.toolStrip1.SuspendLayout();
     this.panel2.SuspendLayout();
     this.groupBox1.SuspendLayout();
     this.nudTimeout.BeginInit();
     base.SuspendLayout();
     this.panel1.Controls.Add(this.groupBox2);
     this.panel1.Controls.Add(this.panel2);
     this.panel1.Controls.Add(this.groupBox1);
     this.panel1.Dock = DockStyle.Right;
     this.panel1.Location = new Point(0x296, 3);
     this.panel1.Name = "panel1";
     this.panel1.Size = new Size(0x189, 0x214);
     this.panel1.TabIndex = 0;
     this.groupBox2.Controls.Add(this.listView1);
     this.groupBox2.Controls.Add(this.toolStrip1);
     this.groupBox2.Dock = DockStyle.Fill;
     this.groupBox2.Location = new Point(0, 0x73);
     this.groupBox2.Name = "groupBox2";
     this.groupBox2.Size = new Size(0x189, 0x176);
     this.groupBox2.TabIndex = 2;
     this.groupBox2.TabStop = false;
     this.groupBox2.Text = "命令参数";
     this.listView1.Columns.AddRange(new ColumnHeader[] { this.columnHeader_0, this.columnHeader_1, this.columnHeader_2, this.columnHeader_3 });
     this.listView1.Dock = DockStyle.Fill;
     this.listView1.FullRowSelect = true;
     this.listView1.HideSelection = false;
     this.listView1.Location = new Point(3, 0x2a);
     this.listView1.MultiSelect = false;
     this.listView1.Name = "listView1";
     this.listView1.Size = new Size(0x183, 0x149);
     this.listView1.SmallImageList = this.imageList_0;
     this.listView1.TabIndex = 1;
     this.listView1.UseCompatibleStateImageBehavior = false;
     this.listView1.View = View.Details;
     this.listView1.ItemActivate += new EventHandler(this.btnEdit_Click);
     this.listView1.Resize += new EventHandler(this.listView1_Resize);
     this.columnHeader_0.Text = "Name";
     this.columnHeader_0.Width = 0x8e;
     this.columnHeader_1.Text = "Type";
     this.columnHeader_1.Width = 0x54;
     this.columnHeader_2.Text = "Direction";
     this.columnHeader_2.Width = 0x4e;
     this.columnHeader_3.Text = "Size";
     this.columnHeader_3.TextAlign = HorizontalAlignment.Right;
     this.columnHeader_3.Width = 0x37;
     this.imageList_0.ColorDepth = ColorDepth.Depth8Bit;
     this.imageList_0.ImageSize = new Size(0x10, 0x10);
     this.imageList_0.TransparentColor = Color.Transparent;
     this.toolStrip1.Items.AddRange(new ToolStripItem[] { this.btnAdd, this.btnEdit, this.btnDelete });
     this.toolStrip1.Location = new Point(3, 0x11);
     this.toolStrip1.Name = "toolStrip1";
     this.toolStrip1.Size = new Size(0x183, 0x19);
     this.toolStrip1.TabIndex = 0;
     this.toolStrip1.Text = "toolStrip1";
     //this.btnAdd.Image = Resources.NewDocumentHS;
     this.btnAdd.ImageTransparentColor = Color.Magenta;
     this.btnAdd.Name = "btnAdd";
     this.btnAdd.Size = new Size(0x33, 0x16);
     this.btnAdd.Text = "新增";
     this.btnAdd.Click += new EventHandler(this.btnAdd_Click);
     // this.btnEdit.Image = Resources.EditTableHS;
     this.btnEdit.ImageTransparentColor = Color.Magenta;
     this.btnEdit.Name = "btnEdit";
     this.btnEdit.Size = new Size(0x33, 0x16);
     this.btnEdit.Text = "修改";
     this.btnEdit.Click += new EventHandler(this.btnEdit_Click);
     //this.btnDelete.Image = Resources.DeleteHS;
     this.btnDelete.ImageTransparentColor = Color.Magenta;
     this.btnDelete.Name = "btnDelete";
     this.btnDelete.Size = new Size(0x33, 0x16);
     this.btnDelete.Text = "删除";
     this.btnDelete.Click += new EventHandler(this.btnDelete_Click);
     this.panel2.Controls.Add(this.btnImport);
     this.panel2.Controls.Add(this.btnCancel);
     this.panel2.Controls.Add(this.btnOK);
     this.panel2.Dock = DockStyle.Bottom;
     this.panel2.Location = new Point(0, 0x1e9);
     this.panel2.Name = "panel2";
     this.panel2.Size = new Size(0x189, 0x2b);
     this.panel2.TabIndex = 1;
     this.btnImport.Location = new Point(7, 10);
     this.btnImport.Name = "btnImport";
     this.btnImport.Size = new Size(100, 0x17);
     this.btnImport.TabIndex = 2;
     this.btnImport.Text = "从剪切板导入";
     this.btnImport.UseVisualStyleBackColor = true;
     this.btnImport.Visible = false;
     this.btnImport.Click += new EventHandler(this.btnImport_Click);
     this.btnCancel.Anchor = AnchorStyles.Right | AnchorStyles.Top;
     this.btnCancel.DialogResult = DialogResult.Cancel;
     this.btnCancel.Location = new Point(0x12d, 10);
     this.btnCancel.Name = "btnCancel";
     this.btnCancel.Size = new Size(0x4b, 0x17);
     this.btnCancel.TabIndex = 1;
     this.btnCancel.Text = "取消(&C)";
     this.btnCancel.UseVisualStyleBackColor = true;
     this.btnOK.Anchor = AnchorStyles.Right | AnchorStyles.Top;
     this.btnOK.Location = new Point(0xce, 10);
     this.btnOK.Name = "btnOK";
     this.btnOK.Size = new Size(0x4b, 0x17);
     this.btnOK.TabIndex = 0;
     this.btnOK.Text = "确定(&K)";
     this.btnOK.UseVisualStyleBackColor = true;
     this.btnOK.Click += new EventHandler(this.btnOK_Click);
     this.groupBox1.Controls.Add(this.nudTimeout);
     this.groupBox1.Controls.Add(this.label4);
     this.groupBox1.Controls.Add(this.cboCommandType);
     this.groupBox1.Controls.Add(this.label3);
     this.groupBox1.Controls.Add(this.txtDataBase);
     this.groupBox1.Controls.Add(this.label2);
     this.groupBox1.Controls.Add(this.txtName);
     this.groupBox1.Controls.Add(this.label1);
     this.groupBox1.Dock = DockStyle.Top;
     this.groupBox1.Location = new Point(0, 0);
     this.groupBox1.Name = "groupBox1";
     this.groupBox1.Size = new Size(0x189, 0x73);
     this.groupBox1.TabIndex = 0;
     this.groupBox1.TabStop = false;
     this.groupBox1.Text = "基本信息";
     this.cboCommandType.DropDownStyle = ComboBoxStyle.DropDownList;
     this.cboCommandType.FormattingEnabled = true;
     this.cboCommandType.Location = new Point(0x3e, 0x4c);
     this.cboCommandType.Name = "cboCommandType";
     this.cboCommandType.Size = new Size(0xae, 20);
     this.cboCommandType.TabIndex = 5;
     this.label3.AutoSize = true;
     this.label3.Location = new Point(10, 80);
     this.label3.Name = "label3";
     this.label3.Size = new Size(0x1d, 12);
     this.label3.TabIndex = 4;
     this.label3.Text = "类型";
     this.txtDataBase.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this.txtDataBase.Font = new Font("Courier New", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.txtDataBase.Location = new Point(0x3e, 0x2d);
     this.txtDataBase.Name = "txtDataBase";
     this.txtDataBase.Size = new Size(0x13e, 0x15);
     this.txtDataBase.TabIndex = 3;
     this.label2.AutoSize = true;
     this.label2.Location = new Point(10, 50);
     this.label2.Name = "label2";
     this.label2.Size = new Size(0x29, 12);
     this.label2.TabIndex = 2;
     this.label2.Text = "数据库";
     this.txtName.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
     this.txtName.Font = new Font("Courier New", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
     this.txtName.Location = new Point(0x3e, 0x12);
     this.txtName.Name = "txtName";
     this.txtName.Size = new Size(0x13e, 0x15);
     this.txtName.TabIndex = 1;
     this.label1.AutoSize = true;
     this.label1.ForeColor = Color.Red;
     this.label1.Location = new Point(10, 0x17);
     this.label1.Name = "label1";
     this.label1.Size = new Size(0x23, 12);
     this.label1.TabIndex = 0;
     this.label1.Text = "名称*";
     this.splitter1.Dock = DockStyle.Right;
     this.splitter1.Location = new Point(0x28f, 3);
     this.splitter1.Name = "splitter1";
     this.splitter1.Size = new Size(7, 0x214);
     this.splitter1.TabIndex = 1;
     this.splitter1.TabStop = false;
     this.txtCode.Dock = DockStyle.Fill;
     this.txtCode.Location = new Point(3, 3);
     this.txtCode.Name = "txtCode";
     this.txtCode.method_6(false);
     this.txtCode.Size = new Size(0x28c, 0x214);
     this.txtCode.TabIndex = 2;
     this.label4.AutoSize = true;
     this.label4.Location = new Point(0xf3, 80);
     this.label4.Name = "label4";
     this.label4.Size = new Size(0x35, 12);
     this.label4.TabIndex = 6;
     this.label4.Text = "超时(秒)";
     this.nudTimeout.Font = new Font("Courier New", 9f);
     this.nudTimeout.Location = new Point(0x12d, 0x4c);
     int[] bits = new int[4];
     bits[0] = 0x186a0;
     this.nudTimeout.Maximum = new decimal(bits);
     this.nudTimeout.Name = "nudTimeout";
     this.nudTimeout.Size = new Size(0x4f, 0x15);
     this.nudTimeout.TabIndex = 7;
     bits = new int[4];
     bits[0] = 30;
     this.nudTimeout.Value = new decimal(bits);
     base.AutoScaleDimensions = new SizeF(6f, 12f);
     base.AutoScaleMode = AutoScaleMode.Font;
     base.CancelButton = this.btnCancel;
     base.ClientSize = new Size(0x422, 0x21a);
     base.Controls.Add(this.txtCode);
     base.Controls.Add(this.splitter1);
     base.Controls.Add(this.panel1);
     base.MinimizeBox = false;
     base.Name = "EditCommandDialog";
     base.Padding = new Padding(3);
     base.ShowIcon = false;
     base.ShowInTaskbar = false;
     base.StartPosition = FormStartPosition.CenterScreen;
     this.Text = "新增命令";
     base.Load += new EventHandler(this.EditCommandDialog_Load);
     base.Shown += new EventHandler(this.EditCommandDialog_Shown);
     this.panel1.ResumeLayout(false);
     this.groupBox2.ResumeLayout(false);
     this.groupBox2.PerformLayout();
     this.toolStrip1.ResumeLayout(false);
     this.toolStrip1.PerformLayout();
     this.panel2.ResumeLayout(false);
     this.groupBox1.ResumeLayout(false);
     this.groupBox1.PerformLayout();
     this.nudTimeout.EndInit();
     base.ResumeLayout(false);
 }
Exemple #56
0
        public HardwareTabPage(ThemeConfig theme)
            : base(FlowDirection.TopToBottom)
        {
            this.theme   = theme;
            this.Padding = 0;
            this.HAnchor = HAnchor.Stretch;
            this.VAnchor = VAnchor.Stretch;

            var toolbar = new Toolbar(theme)
            {
                HAnchor = HAnchor.Stretch,
                VAnchor = VAnchor.Fit,
                Padding = theme.ToolbarPadding
            };

            theme.ApplyBottomBorder(toolbar);

            toolbar.AddChild(new TextButton("Inventory".Localize(), theme)
            {
                Padding     = new BorderDouble(6, 0),
                MinimumSize = new Vector2(0, theme.ButtonHeight),
                Selectable  = false
            });

            this.AddChild(toolbar);

            var horizontalSplitter = new Splitter()
            {
                SplitterDistance   = UserSettings.Instance.LibraryViewWidth,
                SplitterSize       = theme.SplitterWidth,
                SplitterBackground = theme.SplitterBackground,
                HAnchor            = HAnchor.Stretch,
                VAnchor            = VAnchor.Stretch,
            };

            horizontalSplitter.DistanceChanged += (s, e) =>
            {
                UserSettings.Instance.LibraryViewWidth = horizontalSplitter.SplitterDistance;
            };

            this.AddChild(horizontalSplitter);

            var treeView = new HardwareTreeView(theme)
            {
                HAnchor = HAnchor.Stretch,
                VAnchor = VAnchor.Stretch,
                Width   = 300,
                Margin  = 5
            };

            treeView.NodeMouseDoubleClick += (s, e) =>
            {
                if (e is MouseEventArgs mouseEvent &&
                    s is GuiWidget clickedWidget &&
                    mouseEvent.Button == MouseButtons.Left &&
                    mouseEvent.Clicks == 2)
                {
                    if (treeView?.SelectedNode.Tag is PrinterInfo printerInfo)
                    {
                        ApplicationController.Instance.OpenPrinter(printerInfo);
                    }
                }
            };

            treeView.NodeMouseClick += (s, e) =>
            {
                if (e is MouseEventArgs mouseEvent &&
                    s is GuiWidget clickedWidget &&
                    mouseEvent.Button == MouseButtons.Right)
                {
                    UiThread.RunOnIdle(() =>
                    {
                        var popupMenu = new PopupMenu(ApplicationController.Instance.MenuTheme);

                        var openMenuItem    = popupMenu.CreateMenuItem("Open".Localize());
                        openMenuItem.Click += (s2, e2) =>
                        {
                            if (treeView?.SelectedNode.Tag is PrinterInfo printerInfo)
                            {
                                ApplicationController.Instance.OpenPrinter(printerInfo);
                            }
                        };

                        popupMenu.CreateSeparator();

                        var deleteMenuItem    = popupMenu.CreateMenuItem("Delete".Localize());
                        deleteMenuItem.Click += (s2, e2) =>
                        {
                            if (treeView.SelectedNode.Tag is PrinterInfo printerInfo)
                            {
                                // Delete printer
                                StyledMessageBox.ShowMessageBox(
                                    (deletePrinter) =>
                                {
                                    if (deletePrinter)
                                    {
                                        ProfileManager.Instance.DeletePrinter(printerInfo.ID);
                                    }
                                },
                                    "Are you sure you want to delete printer '{0}'?".Localize().FormatWith(printerInfo.Name),
                                    "Delete Printer?".Localize(),
                                    StyledMessageBox.MessageType.YES_NO,
                                    "Delete Printer".Localize());
                            }
                        };

                        popupMenu.ShowMenu(clickedWidget, mouseEvent);
                    });
                }
            };

            treeView.ScrollArea.HAnchor = HAnchor.Stretch;

            treeView.AfterSelect += (s, e) =>
            {
                if (treeView.SelectedNode.Tag is PrinterInfo printerInfo)
                {
                    horizontalSplitter.Panel2.CloseAllChildren();
                    horizontalSplitter.Panel2.AddChild(new PrinterDetails(printerInfo, theme, true)
                    {
                        HAnchor = HAnchor.MaxFitOrStretch,
                        VAnchor = VAnchor.Stretch,
                        Padding = theme.DefaultContainerPadding
                    });
                }
            };
            horizontalSplitter.Panel1.AddChild(treeView);

            horizontalSplitter.Panel2.AddChild(new GuiWidget()
            {
                HAnchor = HAnchor.Stretch,
                VAnchor = VAnchor.Stretch,
            });
        }
Exemple #57
0
        public static NeuralNetwork<Matrix> CreateSemi(IDataSet<Matrix, Vector> dataSet)
        {
            var count  = 5;

            var a = new ISingleLayer<Matrix, Matrix>[count];
            for (var i = 0; i < count; ++i)
                a[i] = new MatrixConvolutor(28, 28, 24, 24, new Tanh());

            var b = new ISingleLayer<Matrix, Matrix>[count];
            for (var i = 0; i < count; ++i)
                b[i] = new MatrixSubsampler(24, 24, 12, 12, new Tanh());

            var splitter    = new Splitter<Matrix, Matrix>(a);
            var merger      = new MatrixMerger<Matrix>(b);

            var classif  = new FullyConnectedLayer(144 * count, 50, new Tanh());
            var classif2 = new FullyConnectedLayer(100, 10, new Tanh());

            var comp = CompositeLayer<Vector, Vector[], Vector>.Compose(splitter,
                                                                        merger,
                                                                        classif,
                                                                        classif2);

            return new NeuralNetwork<Matrix>(comp);
        }
Exemple #58
0
        private void InitializeComponent()
        {
            Title  = "MonoGame Pipeline Tool";
            Icon   = Icon.FromResource("Icons.monogame.png");
            Width  = 750;
            Height = 550;

            InitalizeCommands();
            InitalizeMenu();
            InitalizeContextMenu();
            InitalizeToolbar();

            splitterHorizontal             = new Splitter();
            splitterHorizontal.Orientation = Orientation.Horizontal;
            splitterHorizontal.Position    = 200;

            splitterVertical             = new Splitter();
            splitterVertical.Width       = 150;
            splitterVertical.Orientation = Orientation.Vertical;
            splitterVertical.Position    = 230;
            splitterVertical.FixedPanel  = SplitterFixedPanel.None;

            projectControl = new ProjectControl();
            _pads.Add(projectControl);
            splitterVertical.Panel1 = projectControl;

            propertyGridControl = new PropertyGridControl();
            _pads.Add(propertyGridControl);
            splitterVertical.Panel2 = propertyGridControl;

            splitterHorizontal.Panel1 = splitterVertical;

            buildOutput = new BuildOutput();
            _pads.Add(buildOutput);
            splitterHorizontal.Panel2 = buildOutput;

            Content = splitterHorizontal;

            cmdNew.Executed    += CmdNew_Executed;
            cmdOpen.Executed   += CmdOpen_Executed;
            cmdClose.Executed  += CmdClose_Executed;
            cmdImport.Executed += CmdImport_Executed;
            cmdSave.Executed   += CmdSave_Executed;
            cmdSaveAs.Executed += CmdSaveAs_Executed;
            cmdExit.Executed   += CmdExit_Executed;

            cmdUndo.Executed    += CmdUndo_Executed;
            cmdRedo.Executed    += CmdRedo_Executed;
            cmdExclude.Executed += CmdExclude_Executed;
            cmdRename.Executed  += CmdRename_Executed;
            cmdDelete.Executed  += CmdDelete_Executed;

            cmdNewItem.Executed        += CmdNewItem_Executed;
            cmdNewFolder.Executed      += CmdNewFolder_Executed;
            cmdExistingItem.Executed   += CmdExistingItem_Executed;
            cmdExistingFolder.Executed += CmdExistingFolder_Executed;

            cmdBuild.Executed           += CmdBuild_Executed;
            cmdRebuild.Executed         += CmdRebuild_Executed;
            cmdClean.Executed           += CmdClean_Executed;
            cmdCancelBuild.Executed     += CmdCancelBuild_Executed;
            cmdDebugMode.CheckedChanged += CmdDebugMode_Executed;

            cmdHelp.Executed  += CmdHelp_Executed;
            cmdAbout.Executed += CmdAbout_Executed;

            cmdOpenItem.Executed         += CmdOpenItem_Executed;
            cmdOpenItemWith.Executed     += CmdOpenItemWith_Executed;
            cmdOpenItemLocation.Executed += CmdOpenItemLocation_Executed;
            cmdCopyAssetPath.Executed    += CmdCopyAssetPath_Executed;
            cmdRebuildItem.Executed      += CmdRebuildItem_Executed;
        }
 public SplitterHtmlBuilderTests()
 {
     splitter = SplitterTestHelper.CreateSplitter();
     pane = new SplitterPane();
     builder = new SplitterHtmlBuilder(splitter);
 }
Exemple #60
0
        /// <summary>
        ///     Required method for Designer support - do not modify
        ///     the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            var resources = new System.Resources.ResourceManager(typeof(FormSelectVariables));

            this.ctrlVariables  = new AutoFrontend.Controls.SelectControl();
            this.ctrlParameters = new AutoFrontend.Controls.SelectControl();
            this.panel1         = new System.Windows.Forms.Panel();
            this.panel3         = new System.Windows.Forms.Panel();
            this.splitter1      = new System.Windows.Forms.Splitter();
            this.panel2         = new System.Windows.Forms.Panel();
            this.panel4         = new System.Windows.Forms.Panel();
            this.cmdOk          = new System.Windows.Forms.Button();
            this.panel5         = new System.Windows.Forms.Panel();
            this.panel1.SuspendLayout();
            this.panel3.SuspendLayout();
            this.panel2.SuspendLayout();
            this.panel4.SuspendLayout();
            this.panel5.SuspendLayout();
            this.SuspendLayout();
            //
            // ctrlVariables
            //
            this.ctrlVariables.Dock            = System.Windows.Forms.DockStyle.Fill;
            this.ctrlVariables.DockPadding.All = 3;
            this.ctrlVariables.Location        = new System.Drawing.Point(0, 0);
            this.ctrlVariables.Name            = "ctrlVariables";
            this.ctrlVariables.PropertyName    = " Variables: ";
            this.ctrlVariables.SelectedIndices = new int[0];
            this.ctrlVariables.Size            = new System.Drawing.Size(768, 216);
            this.ctrlVariables.TabIndex        = 0;
            //
            // ctrlParameters
            //
            this.ctrlParameters.Dock            = System.Windows.Forms.DockStyle.Fill;
            this.ctrlParameters.DockPadding.All = 3;
            this.ctrlParameters.Location        = new System.Drawing.Point(0, 0);
            this.ctrlParameters.Name            = "ctrlParameters";
            this.ctrlParameters.PropertyName    = " Parameters: ";
            this.ctrlParameters.SelectedIndices = new int[0];
            this.ctrlParameters.Size            = new System.Drawing.Size(768, 238);
            this.ctrlParameters.TabIndex        = 1;
            //
            // panel1
            //
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Controls.Add(this.splitter1);
            this.panel1.Controls.Add(this.panel2);
            this.panel1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name     = "panel1";
            this.panel1.Size     = new System.Drawing.Size(768, 462);
            this.panel1.TabIndex = 2;
            //
            // panel3
            //
            this.panel3.Controls.Add(this.ctrlParameters);
            this.panel3.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.panel3.Location = new System.Drawing.Point(0, 224);
            this.panel3.Name     = "panel3";
            this.panel3.Size     = new System.Drawing.Size(768, 238);
            this.panel3.TabIndex = 2;
            //
            // splitter1
            //
            this.splitter1.Dock     = System.Windows.Forms.DockStyle.Top;
            this.splitter1.Location = new System.Drawing.Point(0, 216);
            this.splitter1.MinSize  = 200;
            this.splitter1.Name     = "splitter1";
            this.splitter1.Size     = new System.Drawing.Size(768, 8);
            this.splitter1.TabIndex = 1;
            this.splitter1.TabStop  = false;
            //
            // panel2
            //
            this.panel2.Controls.Add(this.ctrlVariables);
            this.panel2.Dock     = System.Windows.Forms.DockStyle.Top;
            this.panel2.Location = new System.Drawing.Point(0, 0);
            this.panel2.Name     = "panel2";
            this.panel2.Size     = new System.Drawing.Size(768, 216);
            this.panel2.TabIndex = 0;
            //
            // panel4
            //
            this.panel4.Controls.Add(this.cmdOk);
            this.panel4.Dock     = System.Windows.Forms.DockStyle.Bottom;
            this.panel4.Location = new System.Drawing.Point(0, 462);
            this.panel4.Name     = "panel4";
            this.panel4.Size     = new System.Drawing.Size(768, 40);
            this.panel4.TabIndex = 3;
            //
            // cmdOk
            //
            this.cmdOk.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.cmdOk.FlatStyle    = System.Windows.Forms.FlatStyle.System;
            this.cmdOk.Location     = new System.Drawing.Point(680, 8);
            this.cmdOk.Name         = "cmdOk";
            this.cmdOk.TabIndex     = 0;
            this.cmdOk.Text         = "Ok";
            this.cmdOk.Click       += new System.EventHandler(this.cmdOk_Click);
            //
            // panel5
            //
            this.panel5.Controls.Add(this.panel1);
            this.panel5.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.panel5.Location = new System.Drawing.Point(0, 0);
            this.panel5.Name     = "panel5";
            this.panel5.Size     = new System.Drawing.Size(768, 462);
            this.panel5.TabIndex = 4;
            //
            // FormSelectVariables
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize        = new System.Drawing.Size(768, 502);
            this.Controls.Add(this.panel5);
            this.Controls.Add(this.panel4);
            try
            {
                this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            }
            catch
            {
            }
            this.Name     = "FormSelectVariables";
            this.Text     = "Select Variables and Parameters for AUTO";
            this.Closing += new System.ComponentModel.CancelEventHandler(this.FormSelectVariables_Closing);
            this.panel1.ResumeLayout(false);
            this.panel3.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.panel4.ResumeLayout(false);
            this.panel5.ResumeLayout(false);
            this.ResumeLayout(false);
        }