private PropertySheet ParseIncludedSheet(string importedAsFilename, string actualFilename, string textContent) {
            var includedSheet = new PropertySheet {
                Filename = actualFilename,
                ImportedAsFilename = importedAsFilename
            };

            // parse the contents of that file into the current property sheet.
            new PropertySheetParser(textContent, actualFilename, includedSheet).Parse();

            // make sure each rule has the parent propertysheet set to the master.
            // since the exposed Rules collection is recursive, this sets the value all the way down...
            foreach (var r in includedSheet.Rules) {
                r.ParentPropertySheet = _propertySheet;
            }
            return includedSheet;
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Rules must be created by the property sheet only.
 /// </summary>
 /// <param name="propertySheet"> </param>
 internal Rule(PropertySheet propertySheet)
 {
     Name = "*";
     ParentPropertySheet = propertySheet;
 }
Exemplo n.º 3
0
 public void AddImportedSheet(PropertySheet importedSheet) {
     _importedSheets.Insert(0, importedSheet);
 }
 public static PropertySheet Parse(string propertySheetText, string originalFilename, PropertySheet propertySheet = null) {
     var p = new PropertySheetParser(propertySheetText, originalFilename, propertySheet ?? new PropertySheet());
     return p.Parse();
 }
 protected PropertySheetParser(string text, string originalFilename, PropertySheet propertySheet) {
     _propertySheetText = text;
     _propertySheet = propertySheet;
     _filename = originalFilename;
 }