Exemple #1
0
        public Analyzer()
        {
            Model = null;

            GlobalRules = new BestPracticeCollection();

            try
            {
                var p1 = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\TabularEditor\BPARules.json";
                var p2 = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\TabularEditor\BPARules.json";
                if (File.Exists(p1))
                {
                    GlobalRules.AddFromJsonFile(p1);
                }
                if (File.Exists(p2))
                {
                    GlobalRules.AddFromJsonFile(p2);
                }
            }
            catch { }

            //StandardBestPractices.GetStandardBestPractices().SaveToFile(@"c:\Projects\test.json");
        }
Exemple #2
0
        public static BestPracticeCollection GetCollectionFromFile(string filePath)
        {
            var result = new BestPracticeCollection();

            result.Name     = filePath;
            result.FilePath = filePath;

            var fi = new FileInfo(filePath);

            result.AllowEdit = FileSystemHelper.IsDirectoryWritable(fi.DirectoryName);
            result.AddFromJsonFile(filePath);

            return(result);
        }