예제 #1
0
        // 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>();
        }
예제 #2
0
        // 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;
        }
예제 #3
0
        // 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;
        }
예제 #4
0
        // 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);
        }
예제 #5
0
 /* 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;
 }
예제 #6
0
 /* 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);
 }
예제 #7
0
 /* 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);
 }