public bool IsUseful() { var directoryPath = Path.GetDirectoryName(FullPath); var dir = new CodeDirectory(directoryPath); return(!dir.IsHidden() && !IsHidden() && HasExtension() && !IsBinary()); }
public CodeFile(string fullPath, CodeDirectory rootDirectory, string content) { var languageService = new LanguageService(); AddNotifications(new Contract() .IsNotNullOrEmpty(fullPath, nameof(FullPath), languageService.GetString(Strings.FilePathMustNotBeEmpty)) .IsTrue(File.Exists(fullPath), nameof(FullPath), languageService.GetString(Strings.FileNotFound)) ); AddNotifications(rootDirectory); FullPath = fullPath; Content = content; RelativePath = fullPath.Substring(rootDirectory.Path.Length); RootDirectory = rootDirectory; }
public Configuration(CodeDirectory projectDirectory, List <Replacement> substitutions, string filters) { var languageService = new LanguageService(); AddNotifications(new Contract() .IsNotNull(projectDirectory, nameof(ProjectDirectory), languageService.GetString(Strings.DirectoryPathMustNotBeEmpty)) .IsTrue(substitutions != null && substitutions.Count > 0, nameof(Substitutions), languageService.GetString(Strings.OverrideListMustNotBeEmpty)) ); AddNotifications(projectDirectory); AddNotifications(substitutions.ToArray()); ProjectDirectory = projectDirectory; Substitutions = substitutions; Filters = String.IsNullOrEmpty(filters) ? "*.*" : filters; }