示例#1
0
        private SourceContainerDocument CreateNewDocument(FileClass fileClass)
        {
            var sourceContainerDocument = new SourceContainerDocument();

            sourceContainerDocument.SetSourceFileClass(fileClass);
            return(sourceContainerDocument);
        }
示例#2
0
 public void ReloadDocumentContent(SourceContainerDocument sourceContainerDocument, FileClass fileClass)
 {
     fileClass.Text      = ReadSourceFile(fileClass.FilePath);
     fileClass.TextState = ETextState.ReadNotChanged;
     fileClass.IsOpened  = true;
     sourceContainerDocument.SetSourceFileClass(fileClass);
 }
示例#3
0
 private void AnalyzeTypesInSource()
 {
     if (IsEditFunctionType)
     {
         return;
     }
     SourceContainerDocument.AnalyzeSource();
 }
示例#4
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            SourceContainerDocument activeSourceContainerDocument = MainEngine.Instance.GetActiveSourceContainerDocument();

            activeSourceContainerDocument.SourceEditorPanel.fastColoredTextBox1.Font = new Font("Consolas", 9.75f, FontStyle.Regular);
            //            fastColoredTextBox1.Font = new Font("Consolas", 9.25f, FontStyle.Regular);
//            fastColoredTextBox1.Font = new Font("Consolas", 10f, FontStyle.Regular);
//            fastColoredTextBox1.Font = new Font("Arial", 10f, FontStyle.Regular);
//            fastColoredTextBox1.Font = new Font("Source Code Pro-Regular", 10f, FontStyle.Regular);
        }
示例#5
0
        private void FastColoredTextBox1OnSelectionChangedDelayed(object sender, EventArgs eventArgs)
        {
            HighlightSelected(sender);

            if (_isdisableHighlightingObjectOnce == true)
            {
                _isdisableHighlightingObjectOnce = false;
                return;
            }
            if (IsSqlSyntax == false)
            {
                SourceContainerDocument.HighlightObjectInObjectExplorer(fastColoredTextBox1.Selection.FromLine);
            }
        }
示例#6
0
        private void OpenOrSwitchFile(FileClass fileClass, bool reloadFileContent = false)
        {
            if (fileClass != null)
            {
                SourceContainerDocument newDocument = null;

                DockPane orDefault = MainDockPanel.Panes.FirstOrDefault(x => x.Appearance == DockPane.AppearanceStyle.Document);
                if (orDefault != null)
                {
                    IDockContent firstOrDefault = orDefault.Contents.FirstOrDefault(s => (s is SourceContainerDocument) && ((SourceContainerDocument)s).FileClass.FilePath == fileClass.FilePath);
                    if (firstOrDefault != null)
                    {
                        newDocument = firstOrDefault as SourceContainerDocument;
                    }
                }
                if (newDocument == null)
                {
                    if (fileClass.TextState == ETextState.UnRead)
                    {
                        fileClass.Text      = ReadSourceFile(fileClass.FilePath);
                        fileClass.TextState = ETextState.ReadNotChanged;
                    }
                    fileClass.IsOpened = true;
                    newDocument        = CreateNewDocument(fileClass);
                    OpenedDocumentsPanel.RefreshOpenedDocumentsList();
                    if (App.Configuration.SaveOnCloseOpenDocument)
                    {
                        if (MainEngine.Instance.IsLoadingWorkspase == false)
                        {
                            SaveWorkSpace();
                        }
                    }
                }
                else
                {
                    if (reloadFileContent)
                    {
                        ReloadDocumentContent(newDocument, fileClass);
                    }
                }
                if (reloadFileContent == false)
                {
                    ShowPanel(newDocument);
                }
                newDocument.SourceEditorPanel.fastColoredTextBox1.Focus();
            }
        }
示例#7
0
        public void RemeberOpenedDocumentsList()
        {
            var workSpaceItem = GetWorkspace(App.Configuration.CurrentWorkSpaceName);

            workSpaceItem.FileClasses.Clear();
            foreach (var dockContent in MainDockPanel.Contents)
            {
                if (dockContent is SourceContainerDocument)
                {
                    SourceContainerDocument content = (SourceContainerDocument)dockContent;
                    workSpaceItem.FileClasses.Add(new FileClassInWorkspace()
                    {
                        FilePath = content.FileClass.FilePath, Name = content.FileClass.Name
                    });
                }
            }
        }
示例#8
0
 private void toolStripButton4_Click(object sender, EventArgs e)
 {
     SourceContainerDocument.ReloadDocumentContent();
 }
示例#9
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     SourceContainerDocument.FindTextAllInSource(fastColoredTextBox1.SelectedText);
 }
示例#10
0
        public SourceContainerDocument GetActiveSourceContainerDocument()
        {
            SourceContainerDocument sourceContainerDocument = MainForm.ActiveMdiChild as SourceContainerDocument;

            return(sourceContainerDocument);
        }
示例#11
0
 private void ShowPanel(SourceContainerDocument dummyDoc)
 {
     dummyDoc.Show(MainDockPanel);
 }
示例#12
0
 private void CopySql_Button_Click(object sender, EventArgs e)
 {
     SourceContainerDocument.CopySql();
 }