Пример #1
0
        public EditorTabItem(string moduleName)
        {
            InitializeComponent();

            textEditorControl             = new SharpDevelopTextAreaControl();
            textEditorControl.Dock        = DockStyle.Fill;
            textEditorControl.BorderStyle = BorderStyle.Fixed3D;

            this.Controls.Add(textEditorControl);
            this.TabText = Resources.Document_ + counter;
            counter++;

            textEditorControl.FileNameChanged += new EventHandler(_EditorControl_FileNameChanged);
            textEditorControl.TextChanged     += new EventHandler(textEditorControl_TextChanged);
            textEditorControl.Tag              = this;


            this.Padding       = new Padding(2, 2, 2, 2);
            this.DockableAreas = DockAreas.Document;

            secondaryViewContentCollection = new SecondaryViewContentCollection(this);
            InitFiles();

            file                       = FileService.CreateUntitledOpenedFile(TabText, new byte[] { });
            file.CurrentView           = this;
            textEditorControl.FileName = file.FileName;

            files.Clear();
            files.Add(file);

            this.SetSyntaxLanguage(moduleName);

            this.textEditorControl.ShowMatchingBracket = true;

            this.textEditorControl.BracketMatchingStyle = BracketMatchingStyle.Before;
        }
Пример #2
0
        public PNTabItem(string moduleName)
        {
            InitializeComponent();

            DeclarationNode = new TreeNode("Declaration");
            ModelNode = new TreeNode("Models");
            TreeNode treeNode8 = new TreeNode("Petri Nets Model",
                new TreeNode[] {
                    DeclarationNode,
                    ModelNode
                });

            MenuButton_SetError.Visible = false;

            //treeNode8.Name = "Root";
            treeNode8.Text = "Petri Nets";
            this.TreeView_Structure.Nodes.AddRange(new TreeNode[] { treeNode8 });

            //AssertionNode.Name = "Declaration";
            DeclarationNode.StateImageIndex = 0;
            //AssertionNode.Text = "Declaration";
            ModelNode.Name = "Models";
            ModelNode.StateImageIndex = 1;
            //ModelNode.Text = "Processes";

            AddEventHandlerForButtons();

            textEditorControl = new SharpDevelopTextAreaControl();
            textEditorControl.Dock = DockStyle.Fill;
            textEditorControl.ContextMenuStrip = EditorContextMenuStrip;
            textEditorControl.BorderStyle = BorderStyle.Fixed3D;
            textEditorControl.Visible = true;

            this.splitContainer1.Panel2.Controls.Add(textEditorControl);

            this.TabText = Resources.Document_ + counter;
            counter++;

            textEditorControl.FileNameChanged += new EventHandler(_EditorControl_FileNameChanged);
            textEditorControl.TextChanged += new EventHandler(textEditorControl_TextChanged);
            textEditorControl.Tag = this;

            this.Padding = new Padding(2, 2, 2, 2);
            this.DockableAreas = DockAreas.Document;

            secondaryViewContentCollection = new SecondaryViewContentCollection(this);
            InitFiles();

            file = FileService.CreateUntitledOpenedFile(TabText, new byte[] { });
            file.CurrentView = this;
            textEditorControl.FileName = file.FileName;
            files.Clear();
            files.Add(file);

            this.SetSyntaxLanguage(moduleName);

            textEditorControl.Document.FoldingManager.FoldingStrategy = new FoldingStrategy();

            // Highlight the matching bracket or not...
            this.textEditorControl.ShowMatchingBracket = true;

            this.textEditorControl.BracketMatchingStyle = BracketMatchingStyle.Before;

            HostCallbackImplementation.Register(this);
            CodeCompletionKeyHandler.Attach(this, textEditorControl);
            ToolTipProvider.Attach(this, textEditorControl);

            pcRegistry = new ProjectContentRegistry(); // Default .NET 2.0 registry

            // Persistence lets SharpDevelop.Dom create a cache file on disk so that
            // future starts are faster.
            // It also caches XML documentation files in an on-disk hash table, thus
            // reducing memory usage.
            pcRegistry.ActivatePersistence(Path.Combine(Path.GetTempPath(), "CSharpCodeCompletion"));

            myProjectContent = new DefaultProjectContent();
            myProjectContent.Language = LanguageProperties.CSharp;

            this.TreeView_Structure.HideSelection = false;
            splitContainer1.SplitterDistance = 100;

            addProcessToolStripMenuItem.PerformClick();

            this.TreeView_Structure.ExpandAll();

            Button_AddNewNail.Visible = false;

            //show the declaration
            TreeView_Structure.SelectedNode = DeclarationNode;
            TreeView_Structure_NodeMouseDoubleClick(null, new TreeNodeMouseClickEventArgs(DeclarationNode, MouseButtons.Left, 2, 0, 0));
        }
 /// <summary>
 /// Create a new AbstractViewContent instance.
 /// </summary>
 protected AbstractViewContent()
 {
     secondaryViewContentCollection = new SecondaryViewContentCollection(this);
     InitFiles();
 }
Пример #4
0
        public PDDLTabItem(string moduleName)
        {
            InitializeComponent();
            AddEventHandlerForButtons();

            toolStripContainer1.Visible = false;

            textEditorControl                  = new SharpDevelopTextAreaControl();
            textEditorControl.Dock             = DockStyle.Fill;
            textEditorControl.ContextMenuStrip = EditorContextMenuStrip;
            textEditorControl.BorderStyle      = BorderStyle.Fixed3D;
            textEditorControl.Visible          = true;

            splitContainer1.Panel2.Controls.Add(textEditorControl);

            TabText = "Document " + counter;
            counter++;

            textEditorControl.FileNameChanged += _EditorControl_FileNameChanged;
            textEditorControl.TextChanged     += textEditorControl_TextChanged;
            textEditorControl.Tag              = this;


            Padding       = new Padding(2, 2, 2, 2);
            DockableAreas = DockAreas.Document;

            secondaryViewContentCollection = new SecondaryViewContentCollection(this);
            InitFiles();

            file                       = FileService.CreateUntitledOpenedFile(TabText, new byte[] { });
            file.CurrentView           = this;
            textEditorControl.FileName = file.FileName;
            files.Clear();
            files.Add(file);

            SetSyntaxLanguage(moduleName);

            textEditorControl.Document.FoldingManager.FoldingStrategy = new FoldingStrategy();

            // Highlight the matching bracket or not...
            textEditorControl.ShowMatchingBracket  = true;
            textEditorControl.BracketMatchingStyle = BracketMatchingStyle.Before;


            HostCallbackImplementation.Register(this);
            CodeCompletionKeyHandler.Attach(this, textEditorControl);
            ToolTipProvider.Attach(this, textEditorControl);

            pcRegistry = new ProjectContentRegistry(); // Default .NET 2.0 registry

            // Persistence lets SharpDevelop.Dom create a cache file on disk so that
            // future starts are faster.
            // It also caches XML documentation files in an on-disk hash table, thus
            // reducing memory usage.
            pcRegistry.ActivatePersistence(Path.Combine(Path.GetTempPath(), "CSharpCodeCompletion"));

            myProjectContent          = new DefaultProjectContent();
            myProjectContent.Language = LanguageProperties.CSharp;

            TreeView_Structure.HideSelection = false;
            splitContainer1.SplitterDistance = 100;
            TreeView_Structure.ExpandAll();
            ProblemsNode.ExpandAll();
        }