コード例 #1
0
        static async Task<bool> IsMatchAsync(string projectName, string projectNameRegex)
        {
            using (var builder = new WorkspaceBuilder(projectName))
            {
                builder.ApplyOptions(
                    o => o.WithChangedOption(ProjectNameDocumentMatcher.ProjectNameRegex, projectNameRegex));

                return await Matcher.IsMatchAsync(builder.AddClass("Sample"));
            }
        }
コード例 #2
0
        static async Task<bool> IsMatchAsync(string documentText, params string[] matchingAttributes)
        {
            using (var builder = new WorkspaceBuilder())
            {
                builder.ApplyOptions(
                    o => o.WithChangedOption(AttributeDocumentMatcher.AttributeNames, matchingAttributes));

                return await Matcher.IsMatchAsync(builder.AddDocument(documentText));
            }
        }
コード例 #3
0
        static async Task<bool> IsMatchAsync(string className, string directoryPath, string fileNameRegex)
        {
            using (var builder = new WorkspaceBuilder())
            {
                builder.ApplyOptions(
                    o => o.WithChangedOption(FilePathDocumentMatcher.FilePathRegex, fileNameRegex));

                return await Matcher.IsMatchAsync(builder.AddClass(className, directoryPath));
            }
        }