예제 #1
0
        private SourceEditorPanel CreateOrSwitchEditFunctionPanel(FilePositionItem filePositionItem)
        {
            SourceEditorPanel panel = null;

            panel = EditFunctionPaels.Where(x => x.FilePositionItem == filePositionItem).FirstOrDefault();

            if (panel == null)
            {
                try
                {
                    panel = new SourceEditorPanel();
                    panel.IsEditFunctionType      = true;
                    panel.SourceContainerDocument = this;
                    panel.Text             = filePositionItem.Name;
                    panel.FilePositionItem = filePositionItem;
                    panel.SetSourceFileClass(FileClass);
                    string text = SourceEditorPanel.fastColoredTextBox1.GetRange(new Place(0, filePositionItem.LineNumberStart), new Place(0, filePositionItem.LineNumberEnd)).Text;
                    panel.fastColoredTextBox1.Text = text;
                }
                catch (Exception ex) {
                    MessageBox.Show(ex.Message);
                }
                if (panel != null)
                {
                    EditFunctionPaels.Add(panel);
                }
            }

            if (panel != null)
            {
                panel.Show(dockPanel1);
            }
            return(panel);
        }
예제 #2
0
        public void ObjecExplorerNodeDoubleClicked(TreeNode node)
        {
            int lineNumber           = 0;
            var powerBuilderFileType = (node.Tag as PowerBuilderFileType);

            if (powerBuilderFileType != null)
            {
                //lineNumber = powerBuilderFileType.LineNumberStart;
            }
            else
            {
                var filePositionItem = (node.Tag as FilePositionItem);
                if (filePositionItem != null)
                {
                    SourceEditorPanel editFunctionPanel = this.CreateOrSwitchEditFunctionPanel(filePositionItem);
                }
            }
        }
예제 #3
0
        public SourceContainerDocument()
        {
            InitializeComponent();
            this.Closing        += OnClosing;
            TopLevel             = true;
            SourceEditorPanel    = new SourceEditorPanel();
            _findInSourcePanel   = new FindInSourcePanel();
            _objectExplorerPanel = new ObjectExplorerPanel();

            _findInSourcePanel.SourceEditorPanel         = SourceEditorPanel;
            SourceEditorPanel.FindInSourcePanel          = _findInSourcePanel;
            SourceEditorPanel.SourceContainerDocument    = this;
            SourceEditorPanel.MainSourceHolder           = true;
            _objectExplorerPanel.SourceContainerDocument = this;

            SourceEditorPanel.Show(dockPanel1);
            _findInSourcePanel.Show(dockPanel1, DockState.DockBottomAutoHide);
            _objectExplorerPanel.Show(dockPanel1, DockState.DockRight);
        }
예제 #4
0
        private void CreateSqlPanel()
        {
            if (_sqlPanel != null)
            {
                return;
            }
            _sqlPanel = SqlPanel = new SourceEditorPanel();
            SqlPanel.SourceContainerDocument = this;
            SqlPanel.Text = "SQL";
            SqlPanel.SetSourceFileClass(FileClass);
            string sqlText = SourceEditorPanel.fastColoredTextBox1.Text;
            Match  result  = Regex.Match(sqlText, @"(?<=retrieve=\"")([^\""\~]\n*)*(?=\""+?)");

            //var result = Regex.Match(sqlText, @"(?<=retrieve=\"")([^\""]\n*)*(?=\""+?)");
            sqlText = result.Value;
            if (string.IsNullOrEmpty(sqlText))
            {
                return;
            }
            SqlPanel.fastColoredTextBox1.Text = sqlText;
            SqlPanel.SetSyntaxSql();
            SqlPanel.Show(dockPanel1);
        }
예제 #5
0
        private void CreateAnalyzerPanell()
        {
            if (_analyzerPanel != null)
            {
                return;
            }
            _analyzerPanel = AnalyzerPanel = new SourceEditorPanel();
            AnalyzerPanel.SourceContainerDocument = this;
            AnalyzerPanel.Text = "Analyzer";
            AnalyzerPanel.SetSourceFileClass(FileClass);
            string sqlText = SourceEditorPanel.fastColoredTextBox1.Text;

            //Match result = Regex.Match(sqlText, @"(?<=retrieve=\"")([^\""\~]\n*)*(?=\""+?)");
            ////var result = Regex.Match(sqlText, @"(?<=retrieve=\"")([^\""]\n*)*(?=\""+?)");
            //sqlText = result.Value;
            if (string.IsNullOrEmpty(sqlText))
            {
                return;
            }
            AnalyzerPanel.fastColoredTextBox1.Text = "test";
            AnalyzerPanel.SetSyntaxSql();
            AnalyzerPanel.Show(dockPanel1, DockState.DockRight);
        }