Пример #1
0
 private void objectview_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (e.Node.Tag is string)
     {
         string str = (string)e.Node.Tag;
         switch (str)
         {
         case "Project Settings":
             ProjectSettingsControl projectsettings = new ProjectSettingsControl();
             projectsettings.ProjectFilename = CurrentProjectFilename;
             projectsettings.ProjectObject   = CurrentProject;
             AddTab("Project Settings", projectsettings, projectsettings);
             break;
         }
     }
     else if (e.Node.Tag is TypeDefinition)
     {
         TypeDefinition typedef = e.Node.Tag as TypeDefinition;
         if (typedef.IsClass)
         {
             ClassViewControl classview = new ClassViewControl();
             classview.TypeDef  = typedef;
             classview.MainForm = this;
             AddTab(typedef.Name, classview, classview);
         }
     }
     else if (e.Node.Tag is Hook)
     {
         GotoHook(e.Node.Tag as Hook);
     }
 }
Пример #2
0
        private void objectview_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            // Check if the tab is already open somewhere
            foreach (TabPage tabpage in tabview.TabPages)
            {
                ProjectSettingsControl psControl = tabpage.Tag as ProjectSettingsControl;
                ClassViewControl cvControl = tabpage.Tag as ClassViewControl;

                if ((psControl != null || cvControl != null) && e.Node.Text == tabpage.Text)
                {
                    tabview.SelectedTab = tabpage;
                    return;
                }
            }

            if (e.Node.Tag is string)
            {
                string str = (string)e.Node.Tag;
                switch (str)
                {
                    case "Project Settings":
                        ProjectSettingsControl projectsettings = new ProjectSettingsControl();
                        projectsettings.ProjectFilename = CurrentProjectFilename;
                        projectsettings.ProjectObject = CurrentProject;
                        AddTab("Project Settings", projectsettings, projectsettings);
                        break;
                }
            }
            else if (e.Node.Tag is TypeDefinition)
            {
                TypeDefinition typedef = e.Node.Tag as TypeDefinition;
                if (typedef.IsClass)
                {
                    ClassViewControl classview = new ClassViewControl();
                    classview.TypeDef = typedef;
                    classview.MainForm = this;
                    AddTab(typedef.FullName, classview, classview);
                }
            }
            else if (e.Node.Tag is Hook)
            {
                GotoHook(e.Node.Tag as Hook);
            }
        }