/// <summary> /// Called by the runtime when the editor is first started. Called after <see cref="OnInitialize"/>. /// </summary> static void OnEditorStartUp() { if (EditorSettings.AutoLoadLastProject) { string projectPath = EditorSettings.LastOpenProject; if (EditorApplication.IsValidProject(projectPath)) { EditorApplication.LoadProject(projectPath); } else { ProjectWindow.Open(); } } else { ProjectWindow.Open(); } CodeEditorType activeCodeEditor = (CodeEditorType)EditorSettings.GetInt(SettingsWindow.ActiveCodeEditorKey, (int)CodeEditorType.None); CodeEditorType[] availableEditors = CodeEditor.AvailableEditors; if (Array.Exists(availableEditors, x => x == activeCodeEditor)) { CodeEditor.ActiveEditor = activeCodeEditor; } else { if (availableEditors.Length > 0) { CodeEditor.ActiveEditor = availableEditors[0]; } } }
private void SetEditorVisibility() { _codeEditorType = Settings.Default.CodeEditor; switch (_codeEditorType) { #if !__MonoCS__ case CodeEditorType.AvalonEdit: avalonEditorWrapper.Show(); (_codeEditors[CodeEditorType.Scintilla] as Control).Hide(); (_codeEditors[CodeEditorType.TextEditor] as Control).Hide(); break; case CodeEditorType.Scintilla: avalonEditorWrapper.Hide(); (_codeEditors[CodeEditorType.Scintilla] as Control).Show(); (_codeEditors[CodeEditorType.TextEditor] as Control).Hide(); break; #endif case CodeEditorType.TextEditor: #if !__MonoCS__ avalonEditorWrapper.Hide(); (_codeEditors[CodeEditorType.Scintilla] as Control).Hide(); #endif (_codeEditors[CodeEditorType.TextEditor] as Control).Show(); break; } }
private void SetEditorVisibility() { _codeEditorType = Settings.Default.CodeEditor; switch (_codeEditorType) { case CodeEditorType.AvalonEdit: // avalonEditor.Text = (_codeEditors[CodeEditorType.Scintilla] as Control).Text; avalonEditorWrapper.Show(); (_codeEditors[CodeEditorType.Scintilla] as Control).Hide(); break; case CodeEditorType.Scintilla: // (_codeEditors[CodeEditorType.Scintilla] as Control).Text = avalonEditor.Text; avalonEditorWrapper.Hide(); (_codeEditors[CodeEditorType.Scintilla] as Control).Show(); break; } }
internal static extern void Internal_SetActiveEditor(CodeEditorType type);
internal static extern void Internal_SetActiveEditor(CodeEditorType type);