コード例 #1
0
        //EditorTabItem TextBox_GuardTab = new EditorTabItem(LTSTabItem);
        //EditorTabItem TextBox_ClockGuardTab = new EditorTabItem(LTSTabItem);

        public CLTSTransitionEditingForm(Transition transition, string source, string target)
        {
            InitializeComponent();
            this.transition          = transition;
            this.TextBox_Source.Text = source;
            this.TextBox_Target.Text = target;

            //put in event, guard, program to dialogbox
            this.TextBox_Select.Text = this.transition.Select;
            this.TextBox_Event.Text  = this.transition.Event;

            ////
            //// TextBox_Guard
            ////
            //TextBox_ClockGuardTab.Controls.Clear();
            //this.TextBox_ClockGuardTab.CodeEditor.Dock = DockStyle.None;
            //this.TextBox_ClockGuardTab.CodeEditor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            //            | System.Windows.Forms.AnchorStyles.Right)));
            //this.TextBox_ClockGuardTab.CodeEditor.Location = new System.Drawing.Point(80, 105);
            //this.TextBox_ClockGuardTab.CodeEditor.Name = "TextBox_Guard";
            //this.TextBox_ClockGuardTab.CodeEditor.Size = new System.Drawing.Size(346, 43);
            //this.TextBox_ClockGuardTab.CodeEditor.TabIndex = 2;
            //this.Controls.Add(TextBox_ClockGuardTab.CodeEditor);

            ////
            //// TextBox_Guard
            ////
            //TextBox_GuardTab.Controls.Clear();
            //this.TextBox_GuardTab.CodeEditor.Dock = DockStyle.None;
            //this.TextBox_GuardTab.CodeEditor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            //            | System.Windows.Forms.AnchorStyles.Right)));
            //this.TextBox_GuardTab.CodeEditor.Location = new System.Drawing.Point(80, 156);
            //this.TextBox_GuardTab.CodeEditor.Name = "TextBox_Guard";
            //this.TextBox_GuardTab.CodeEditor.Size = new System.Drawing.Size(346, 41);
            //this.TextBox_GuardTab.CodeEditor.TabIndex = 2;
            //this.Controls.Add(TextBox_GuardTab.CodeEditor);



            //
            // TextBox_Program
            //
            TextBox_ProgramTab.Controls.Clear();
            this.TextBox_ProgramTab.CodeEditor.Dock   = DockStyle.None;
            this.TextBox_ProgramTab.CodeEditor.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.TextBox_ProgramTab.CodeEditor.Location = new System.Drawing.Point(80, 227);
            this.TextBox_ProgramTab.CodeEditor.Name     = "TextBox_Program";
            this.TextBox_ProgramTab.CodeEditor.Size     = new System.Drawing.Size(346, 160);
            this.TextBox_ProgramTab.CodeEditor.TabIndex = 3;
            this.Controls.Add(TextBox_ProgramTab.CodeEditor);

            TextBox_ProgramTab.HideGoToDeclarition();

            //this.TextBox_ClockGuard.Text = this.transition.ClockGuard;
            this.TextBox_Guard.Text      = this.transition.Guard;
            this.TextBox_ProgramTab.Text = this.transition.Program;
            //this.TextBox_ResetClocks.Text = this.transition.ClockReset;
        }
コード例 #2
0
        public TransitionEditingForm(PNTransition transition)
        {
            InitializeComponent();
            _transition   = transition;
            textBox1.Text = _transition.Name;

            this.TextBox_ProgramTab.CodeEditor.Dock   = DockStyle.None;
            this.TextBox_ProgramTab.CodeEditor.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.TextBox_ProgramTab.CodeEditor.Location = new System.Drawing.Point(71, 274);
            this.TextBox_ProgramTab.CodeEditor.Name     = "TextBox_Program";
            this.TextBox_ProgramTab.CodeEditor.Size     = new System.Drawing.Size(365, 180);
            this.TextBox_ProgramTab.CodeEditor.TabIndex = 11;
            this.Controls.Add(TextBox_ProgramTab.CodeEditor);

            TextBox_ProgramTab.HideGoToDeclarition();

            StringBuilder sb = new StringBuilder();

            foreach (PNPlace place in _transition.InputPlaces)
            {
                sb.AppendLine(place.Name);
            }
            txtInputPlaces.Text = sb.ToString();

            sb = new StringBuilder();
            foreach (PNPlace place in _transition.OutputPlaces)
            {
                sb.AppendLine(place.Name);
            }
            txtOutputPlaces.Text    = sb.ToString();
            txtGuard.Text           = _transition.Guard;
            TextBox_ProgramTab.Text = _transition.Program;
        }
コード例 #3
0
        public TATransitionEditingForm(Route route, List <LTSCanvas.CanvasItemData> canvasItems)
        {
            InitializeComponent();

            //
            // TextBox_Program
            //
            TextBox_ProgramTab.Controls.Clear();
            this.TextBox_ProgramTab.CodeEditor.Dock   = DockStyle.None;
            this.TextBox_ProgramTab.CodeEditor.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.TextBox_ProgramTab.CodeEditor.Location = new System.Drawing.Point(80, 227);
            this.TextBox_ProgramTab.CodeEditor.Name     = "TextBox_Program";
            this.TextBox_ProgramTab.CodeEditor.Size     = new System.Drawing.Size(346, 160);
            this.TextBox_ProgramTab.CodeEditor.TabIndex = 3;
            this.Controls.Add(TextBox_ProgramTab.CodeEditor);


            //
            this.route = route;
            foreach (LTSCanvas.CanvasItemData itemData in canvasItems)
            {
                if (itemData.Item is StateItem)
                {
                    this.comboBoxSource.Items.Add(itemData.Item);
                    this.comboBoxDest.Items.Add(itemData.Item);

                    if (itemData.Item.Equals(route.From))
                    {
                        this.comboBoxSource.SelectedItem = itemData.Item;
                    }

                    if (itemData.Item.Equals(route.To))
                    {
                        this.comboBoxDest.SelectedItem = itemData.Item;
                    }
                }
            }


            //put in event, guard, program to dialogbox
            this.TextBox_Select.Text = route.Transition.Select;
            this.TextBox_Event.Text  = route.Transition.Event;

            this.TextBox_ClockGuard.Text  = route.Transition.ClockGuard;
            this.TextBox_Guard.Text       = route.Transition.Guard;
            this.TextBox_ProgramTab.Text  = route.Transition.Program;
            this.TextBox_ResetClocks.Text = route.Transition.ClockReset;

            TextBox_ProgramTab.HideGoToDeclarition();
        }
コード例 #4
0
        public CSharpLibraryForm(string FileName)
        {
            InitializeComponent();

            TextBox_Program.HideGoToDeclarition();

            this.TextBox_Code.Visible = false;
            TextBox_Program.Dock      = DockStyle.Fill;
            this.toolStripContainer1.ContentPanel.Controls.Add(TextBox_Program.CodeEditor);


            //FileName = Path.Combine(Ultility.LibFolderPath, MathClassFile);
            if (File.Exists(FileName))
            {
                StreamReader tr = new StreamReader(FileName);
                this.TextBox_Program.Text = tr.ReadToEnd();
                tr.Close();
                this.StatusLabel_FileName.Text = FileName;
            }
            else
            {
                FileName = null;
            }

            MenuStrip         menuStrip1 = new MenuStrip();
            ToolStripMenuItem button     = new ToolStripMenuItem();

            button.Size         = new Size(0, 0);
            button.ShortcutKeys = (Keys)Shortcut.CtrlS;
            button.Click       += new EventHandler(this.Button_Save_Click);
            menuStrip1.Items.AddRange(new ToolStripItem[] { button });
            button              = new ToolStripMenuItem();
            button.Size         = new Size(0, 0);
            button.ShortcutKeys = (Keys)Shortcut.CtrlO;
            button.Click       += new EventHandler(this.Button_Load_Click);
            menuStrip1.Items.AddRange(new ToolStripItem[] { button });
            button              = new ToolStripMenuItem();
            button.Size         = new Size(0, 0);
            button.ShortcutKeys = (Keys)Shortcut.CtrlB;
            button.Click       += new EventHandler(this.Button_build_Click);
            menuStrip1.Items.AddRange(new ToolStripItem[] { button });
            menuStrip1.Visible = false;
            Controls.Add(menuStrip1);
            //MainMenuStrip = menuStrip1;

            Button_BuildMode.ComboBox.SelectedIndex = 0;

            TextBox_Program.CodeEditor.TextChanged += new EventHandler(CodeEditor_TextChanged);
        }
コード例 #5
0
        public LinkEditingForm(Transition transition, string source, string target)
        {
            InitializeComponent();
            this.transition          = transition;
            this.TextBox_Source.Text = source;
            this.TextBox_Target.Text = target;

            //put in event, guard, program to dialogbox
            //this.TextBox_Select.Text = this.transition.Select;
            this.TextBox_Bandwidth.Text = this.transition.Event;

            ////
            //// TextBox_LossRate
            ////
            //TextBox_GuardTab.Controls.Clear();
            //this.TextBox_GuardTab.CodeEditor.Dock = DockStyle.None;
            //this.TextBox_GuardTab.CodeEditor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            //            | System.Windows.Forms.AnchorStyles.Right)));
            //this.TextBox_GuardTab.CodeEditor.Location = new System.Drawing.Point(61, 129);
            //this.TextBox_GuardTab.CodeEditor.Name = "TextBox_LossRate";
            //this.TextBox_GuardTab.CodeEditor.Size = new System.Drawing.Size(365, 62);
            //this.TextBox_GuardTab.CodeEditor.TabIndex = 2;
            //this.Controls.Add(TextBox_GuardTab.CodeEditor);

            //
            // TextBox_Note
            //
            TextBox_ProgramTab.Controls.Clear();
            this.TextBox_ProgramTab.CodeEditor.Dock   = DockStyle.None;
            this.TextBox_ProgramTab.CodeEditor.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.TextBox_ProgramTab.CodeEditor.Location = new System.Drawing.Point(61, 208);
            this.TextBox_ProgramTab.CodeEditor.Name     = "TextBox_Note";
            this.TextBox_ProgramTab.CodeEditor.Size     = new System.Drawing.Size(365, 180);
            this.TextBox_ProgramTab.CodeEditor.TabIndex = 3;
            this.Controls.Add(TextBox_ProgramTab.CodeEditor);

            this.TextBox_LossRate.Text   = this.transition.Guard;
            this.TextBox_ProgramTab.Text = this.transition.Program;
            TextBox_ProgramTab.HideGoToDeclarition();
        }