// Group: Functions // __________________________________________________________________________ public ProjectConfig(Config.Source source) { this.source = source; projectConfigFolder = new Path(); workingDataFolder = new Path(); projectInfo = new ProjectInfo(); tabWidth = 0; documentedOnly = false; autoGroup = true; shrinkFiles = true; projectConfigFolderPropertyLocation = Source.NotDefined; workingDataFolderPropertyLocation = Source.NotDefined; tabWidthPropertyLocation = Source.NotDefined; documentedOnlyPropertyLocation = Source.NotDefined; autoGroupPropertyLocation = Source.NotDefined; shrinkFilesPropertyLocation = Source.NotDefined; inputTargets = new List <Targets.InputBase>(); filterTargets = new List <Targets.FilterBase>(); outputTargets = new List <Targets.OutputBase>(); }
// Group: Functions // __________________________________________________________________________ /* Constructor: Error * A constructor for an error that occurs in a specific file. */ public Error(string message, Path file = default(Path), int lineNumber = 0, Config.Source configSource = Config.Source.NotDefined, string property = null) { this.message = message; this.file = file; this.lineNumber = lineNumber; this.configSource = configSource; this.property = property; }
// Group: Functions // __________________________________________________________________________ /* Constructor: PropertyLocation */ public PropertyLocation(Config.Source source, Path fileName = default(Path), int lineNumber = 0) { #if DEBUG if (IsFileBased(source)) { if (fileName == null) { throw new Exception("Must provide a file name for " + source + " PropertyLocations."); } } else { if (fileName != null || lineNumber != 0) { throw new Exception("Cannot provide a file name or line number for " + source + " PropertyLocations."); } } #endif this.source = source; this.fileName = fileName; this.lineNumber = lineNumber; }
// Group: Static Functions // __________________________________________________________________________ /* Function: IsFileBased * Returns whether the passed <Config.Source> is file-based. */ public static bool IsFileBased(Config.Source configSource) { return(configSource >= Source.LowestFileValue && configSource <= Source.HighestFileValue); }
/* Function: Add * Adds an error occurring in a particular file to the list. */ public void Add(string message, Path file = default(Path), int lineNumber = 0, Config.Source configSource = Config.Source.NotDefined, string property = null) { list.Add(new Error(message, file, lineNumber, configSource, property)); sorted = false; }
/* Function: Matches * Whether the error occurs in the passed location. */ public bool Matches(Path file = default(Path), int lineNumber = 0, Config.Source configSource = Config.Source.NotDefined, string property = null) { return(this.file == file && this.lineNumber == lineNumber && this.configSource == configSource && this.property == property); }
/* Function: AddError * Adds an error to the list, automatically filling in the file and line number properties based on the last call to <Get()>. */ public void AddError(string errorMessage, Config.Source configSource = Config.Source.NotDefined, string property = null) { errorList.Add(errorMessage, fileName, lineNumber, configSource, property); }