Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InBuildSourceCodeEditor"/> class.
        /// </summary>
        /// <param name="type">The type.</param>
        public InBuildSourceCodeEditor(CodeEditorTypes type)
        {
            Type = type;
            switch (type)
            {
            case CodeEditorTypes.Custom:
                Name = "Custom";
                break;

            case CodeEditorTypes.SystemDefault:
                Name = "System Default";
                break;

            case CodeEditorTypes.VS2008:
                Name = "Visual Studio 2008";
                break;

            case CodeEditorTypes.VS2010:
                Name = "Visual Studio 2010";
                break;

            case CodeEditorTypes.VS2012:
                Name = "Visual Studio 2012";
                break;

            case CodeEditorTypes.VS2013:
                Name = "Visual Studio 2013";
                break;

            case CodeEditorTypes.VS2015:
                Name = "Visual Studio 2015";
                break;

            case CodeEditorTypes.VS2017:
                Name = "Visual Studio 2017";
                break;

            case CodeEditorTypes.VS2019:
                Name = "Visual Studio 2019";
                break;

            case CodeEditorTypes.VS2022:
                Name = "Visual Studio 2022";
                break;

            case CodeEditorTypes.VSCode:
                Name = "Visual Studio Code";
                break;

            case CodeEditorTypes.VSCodeInsiders:
                Name = "Visual Studio Code - Insiders";
                break;

            case CodeEditorTypes.Rider:
                Name = "Rider";
                break;

            default: throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
 internal static extern void Internal_OpenSolution(CodeEditorTypes editorType);
 /// <summary>
 /// Opens the solution project. Handles async opening.
 /// </summary>
 /// <param name="editorType">The code editor type.</param>
 public static void OpenSolution(CodeEditorTypes editorType)
 {
     Internal_OpenSolution(editorType);
 }
 internal static extern void Internal_OpenFile(CodeEditorTypes editorType, string path, int line);
 /// <summary>
 /// Opens the file. Handles async opening.
 /// </summary>
 /// <param name="editorType">The code editor type.</param>
 /// <param name="path">The file path.</param>
 /// <param name="line">The target line (use 0 to not use it).</param>
 public static void OpenFile(CodeEditorTypes editorType, string path, int line)
 {
     Internal_OpenFile(editorType, path, line);
 }