Exemple #1
0
        public static bool ApplyCodingStyle(this IChromiumSourceFiles chromiumSourceFiles, IFileSystem fileSystem, ITextSnapshotLine line)
        {
            // Check document is part of a Chromium source repository
            ITextDocument document;

            if (!line.Snapshot.TextBuffer.Properties.TryGetProperty <ITextDocument>(typeof(ITextDocument), out document))
            {
                return(false);
            }

            var path = document.FilePath;

            if (!PathHelpers.IsAbsolutePath(path))
            {
                return(false);
            }

            if (!fileSystem.FileExists(new FullPath(path)))
            {
                return(false);
            }

            return(chromiumSourceFiles.ApplyCodingStyle(document.FilePath));
        }