#pragma warning disable RS1012 // Start action has no registered actions. bool LoadOptions(CompilationStartAnalysisContext context, AdditionalText mdkOptions) #pragma warning restore RS1012 // Start action has no registered actions. { try { var content = mdkOptions.GetText(context.CancellationToken); var properties = MDKProjectOptions.Parse(content.ToString(), mdkOptions.Path); var basePath = Path.GetFullPath(Path.GetDirectoryName(mdkOptions.Path) ?? ".").TrimEnd('\\') + "\\..\\"; if (!basePath.EndsWith("\\")) { basePath += "\\"; } _basePath = new Uri(basePath); _namespaceName = properties.Namespace ?? DefaultNamespaceName; lock (_ignoredFolders) lock (_ignoredFiles) { _ignoredFolders.Clear(); _ignoredFiles.Clear(); foreach (var folder in properties.IgnoredFolders) { if (!folder.EndsWith("\\")) { _ignoredFolders.Add(new Uri(_basePath, new Uri(folder + "\\", UriKind.RelativeOrAbsolute))); } else { _ignoredFolders.Add(new Uri(_basePath, new Uri(folder, UriKind.RelativeOrAbsolute))); } } foreach (var file in properties.IgnoredFiles) { _ignoredFiles.Add(new Uri(_basePath, new Uri(file, UriKind.RelativeOrAbsolute))); } } return(true); } catch (Exception) { return(false); } }