Exemple #1
0
        void FireEditorTabItem_LanguageChanged(object sender, LanguageChangedEventArgs e)
        {
            if (e.Language != null && e.Language.Name == "HTML")
            {
                FireEditorTabItem tabItem = (FireEditorTabItem)sender;

                ToolStrip myToolStrip = new ToolStrip();

                myToolStrip.Name = "switchBar";

                myToolStrip.Dock = DockStyle.Bottom;

                tabItem.Controls.Add(myToolStrip);

                tabItem.BringToFront();


                ToolStripButton btnCode = new ToolStripButton();

                btnCode.Checked = true;

                btnCode.Text = "Html Code";

                btnCode.CheckOnClick = true;

                myToolStrip.Items.Add(btnCode);

                btnCode.Click += new EventHandler(btnCode_Click);


                ToolStripButton btnPreview = new ToolStripButton();

                btnPreview.Text = "Html Preview";

                btnPreview.CheckOnClick = true;

                myToolStrip.Items.Add(btnPreview);

                btnPreview.Click += new EventHandler(btnPreview_Click);


                WebBrowser browser = new WebBrowser();

                browser.Name = "preview";

                browser.Dock = DockStyle.Fill;

                browser.Visible = false;


                tabItem.Controls.Add(browser);
            }
        }
Exemple #2
0
        void FireEditorTabItem_LanguageChanged(object sender, FireEdit.Docking.LanguageChangedEventArgs e)
        {
            FireEditorTabItem tabItem = (FireEditorTabItem)sender;


            if (e.Language.Name == "PHP")
            {
                tabItem.CodeEditor.KeyPress    += new System.Windows.Forms.KeyPressEventHandler(CodeEditor_KeyPress);
                tabItem.CodeEditor.KeyDown     += new System.Windows.Forms.KeyEventHandler(CodeEditor_KeyDown);
                tabItem.CodeEditor.CaretChange += new EventHandler(CodeEditor_CaretChange);
                tabItem.CodeEditor.InfoTipSelectedIndexChanged += new EventHandler(CodeEditor_InfoTipSelectedIndexChanged);
            }

            if (sender is FireEditorTabItem)
            {
                this.CheckForToolbarState((FireEditorTabItem)sender);
            }
        }