Пример #1
0
		public static CodeEditorOptions TryCreate(ITextViewOptionsGroup group, IContentTypeRegistryService contentTypeRegistryService, ICodeEditorOptionsDefinitionMetadata md) {
			if (group == null)
				throw new ArgumentNullException(nameof(group));
			if (contentTypeRegistryService == null)
				throw new ArgumentNullException(nameof(contentTypeRegistryService));
			if (md == null)
				throw new ArgumentNullException(nameof(md));

			if (md.ContentType == null)
				return null;
			var contentType = contentTypeRegistryService.GetContentType(md.ContentType);
			if (contentType == null)
				return null;

			if (md.Guid == null)
				return null;
			Guid guid;
			if (!Guid.TryParse(md.Guid, out guid))
				return null;

			if (md.LanguageName == null)
				return null;

			return new CodeEditorOptions(group, contentType, guid, md.LanguageName);
		}
Пример #2
0
 CodeEditorOptions(ITextViewOptionsGroup group, IContentType contentType, Guid guid, string languageName)
 {
     this.group   = group;
     ContentType  = contentType;
     Guid         = guid;
     LanguageName = languageName;
 }
Пример #3
0
 public DocumentViewerOptions(ITextViewOptionsGroup group, IContentType contentType)
 {
     if (group == null)
     {
         throw new ArgumentNullException(nameof(group));
     }
     if (contentType == null)
     {
         throw new ArgumentNullException(nameof(contentType));
     }
     this.group  = group;
     ContentType = contentType;
 }
Пример #4
0
 protected CommonEditorOptions(ITextViewOptionsGroup group, IContentType contentType)
 {
     if (group == null)
     {
         throw new ArgumentNullException(nameof(group));
     }
     if (contentType == null)
     {
         throw new ArgumentNullException(nameof(contentType));
     }
     this.group  = group;
     ContentType = contentType;
 }
Пример #5
0
        public static CodeEditorOptions TryCreate(ITextViewOptionsGroup group, IContentTypeRegistryService contentTypeRegistryService, ICodeEditorOptionsDefinitionMetadata md)
        {
            if (group == null)
            {
                throw new ArgumentNullException(nameof(group));
            }
            if (contentTypeRegistryService == null)
            {
                throw new ArgumentNullException(nameof(contentTypeRegistryService));
            }
            if (md == null)
            {
                throw new ArgumentNullException(nameof(md));
            }

            if (md.ContentType == null)
            {
                return(null);
            }
            var contentType = contentTypeRegistryService.GetContentType(md.ContentType);

            if (contentType == null)
            {
                return(null);
            }

            if (md.Guid == null)
            {
                return(null);
            }
            Guid guid;

            if (!Guid.TryParse(md.Guid, out guid))
            {
                return(null);
            }

            if (md.LanguageName == null)
            {
                return(null);
            }

            return(new CodeEditorOptions(group, contentType, guid, md.LanguageName));
        }
Пример #6
0
        public static ReplOptions?TryCreate(ITextViewOptionsGroup group, IContentTypeRegistryService contentTypeRegistryService, IReplOptionsDefinitionMetadata md)
        {
            if (group is null)
            {
                throw new ArgumentNullException(nameof(group));
            }
            if (contentTypeRegistryService is null)
            {
                throw new ArgumentNullException(nameof(contentTypeRegistryService));
            }
            if (md is null)
            {
                throw new ArgumentNullException(nameof(md));
            }

            if (md.ContentType is null)
            {
                return(null);
            }
            var contentType = contentTypeRegistryService.GetContentType(md.ContentType);

            if (contentType is null)
            {
                return(null);
            }

            if (md.Guid is null)
            {
                return(null);
            }
            if (!Guid.TryParse(md.Guid, out var guid))
            {
                return(null);
            }

            if (md.LanguageName is null)
            {
                return(null);
            }

            return(new ReplOptions(group, contentType, guid, md.LanguageName));
        }
Пример #7
0
 ReplOptions(ITextViewOptionsGroup group, IContentType contentType, Guid guid, string languageName)
     : base(group, contentType)
 {
     Guid         = guid;
     LanguageName = languageName;
 }
Пример #8
0
		protected CommonEditorOptions(ITextViewOptionsGroup group, IContentType contentType) {
			if (group == null)
				throw new ArgumentNullException(nameof(group));
			if (contentType == null)
				throw new ArgumentNullException(nameof(contentType));
			this.group = group;
			ContentType = contentType;
		}
Пример #9
0
 public DocumentViewerOptions(ITextViewOptionsGroup group, IContentType contentType)
     : base(group, contentType)
 {
 }
Пример #10
0
 public OutputWindowOptions(ITextViewOptionsGroup group, IContentType contentType)
     : base(group, contentType)
 {
 }
Пример #11
0
		CodeEditorOptions(ITextViewOptionsGroup group, IContentType contentType, Guid guid, string languageName)
			: base(group, contentType) {
			Guid = guid;
			LanguageName = languageName;
		}
Пример #12
0
		public DocumentViewerOptions(ITextViewOptionsGroup group, IContentType contentType)
			: base(group, contentType) {
		}