public static ReplOptions TryCreate(ITextViewOptionsGroup group, IContentTypeRegistryService contentTypeRegistryService, IReplOptionsDefinitionMetadata 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 ReplOptions(group, contentType, guid, md.LanguageName); }
public static ReplOptions TryCreate(ITextViewOptionsGroup group, IContentTypeRegistryService contentTypeRegistryService, IReplOptionsDefinitionMetadata 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); } if (!Guid.TryParse(md.Guid, out var guid)) { return(null); } if (md.LanguageName == null) { return(null); } return(new ReplOptions(group, contentType, guid, md.LanguageName)); }