Esempio n. 1
0
 private void InitializeOpenGLPanel(string theme)
 {
     //if (this.Parent is Form) ((Form)base.Parent).KeyPreview = true;
     this.panel1.BringToFront();
     this.OpenGL          = new COpenGL(theme, this.panel1, this.panel1.Width, this.panel1.Height);
     this.timer1.Enabled  = true;
     this.timer1.Interval = 10;
     this.timer1.Start();
     this.toolStrip1.Visible   = true;
     this.statusStrip1.Visible = false;
 }
Esempio n. 2
0
        private void OpenGL_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem toolStripMenuItem = (ToolStripMenuItem)sender;

            //if (base.Parent is Form) ((Form)base.Parent).KeyPreview = true;
            this.panel1.BringToFront();
            if (this.OpenGL != null)
            {
                this.OpenGL.Dispose();
            }
            this.OpenGL = new COpenGL(toolStripMenuItem.Text, this.panel1, this.panel1.Width, this.panel1.Height);
            this.panel1.Refresh();
            this.panel1.Tag = toolStripMenuItem.Text;
            //if (base.Parent is Form) ((Form)base.Parent).Text = Path.GetFileNameWithoutExtension(toolStripMenuItem.Text);
            this.newDocumentFlag = false;
            this.AddPreviousDocuments(toolStripMenuItem.Text);
            //this.settings.PreviousCustomDocuments.Add("XMLTreeMenu.Controls.OpenGLPanel!" + toolStripMenuItem.Text);
            //XMLTreeMenu.Controls.OpenGLPanel!Lesson05
        }
Esempio n. 3
0
        private void PreviousDocumentsMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem toolStripMenuItem = (ToolStripMenuItem)sender;

            try
            {
                if (this.Parent is Form)
                {
                    ((Form)this.Parent).KeyPreview = true;
                }
                if (File.Exists(toolStripMenuItem.Text) && Path.GetExtension(toolStripMenuItem.Text) == ".exe")
                {
                    try
                    {
                        if (this.executeInPlaceToolStripMenuItem.Checked)
                        {
                            //PluginBase.MainForm.WorkingDirectory = Path.GetDirectoryName(toolStripMenuItem.Text);
                            this.ExecuteInPlace(toolStripMenuItem.Text);
                            //((DockContent)this.Parent).TabText = Path.GetFileName(toolStripMenuItem.Text);
                            //this.settings.PreviousCustomDocuments.Add("XMLTreeMenu.Controls.OpenGLPanel!" + toolStripMenuItem.Text);
                            //if (this.Parent is Form) ((Form)this.Parent).Text = Path.GetFileName(toolStripMenuItem.Text);
                            this.AddPreviousDocuments(toolStripMenuItem.Text);
                        }
                        else
                        {
                            new Process
                            {
                                StartInfo =
                                {
                                    FileName         = toolStripMenuItem.Text,
                                    WorkingDirectory = Path.GetDirectoryName(toolStripMenuItem.Text)
                                }
                            }.Start();
                        }
                    }
                    catch (Exception ex)
                    {
                        string message = ex.Message.ToString();
                        MessageBox.Show(ex.Message.ToString());
                    }
                }
                else
                {
                    if (this.OpenGL != null)
                    {
                        this.OpenGL.Dispose();
                    }
                    this.OpenGL = new COpenGL(toolStripMenuItem.Text, this.panel1, this.panel1.Width, this.panel1.Height);
                    this.panel1.Refresh();
                    this.panel1.Tag = toolStripMenuItem.Text;
                    if (this.Parent is Form)
                    {
                        ((Form)this.Parent).Text = Path.GetFileName(toolStripMenuItem.Text);
                    }
                    this.newDocumentFlag = false;
                    this.AddPreviousDocuments(toolStripMenuItem.Text);
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message.ToString();
                MessageBox.Show(ex.Message.ToString());
            }
        }