Esempio n. 1
0
 /// <summary>
 /// Visits the unset attribute entry.
 /// </summary>
 /// <param name="attributeEntry">The attribute entry.</param>
 public virtual void VisitUnsetAttributeEntry(UnsetAttributeEntry attributeEntry)
 {
     if (attributeEntry == null)
     {
         return;
     }
     _writer.WriteLine(":{0}!:", attributeEntry.Name);
     _writer.WriteLine();
 }
Esempio n. 2
0
        private static AttributeEntry ParseAttributeEntry(string input)
        {
            var match = PatternMatcher.AttributeEntry.Match(input);

            if (!match.Success)
            {
                throw new ArgumentException("not an attribute entry");
            }

            var            name = match.Groups["name"].Value.ToLowerInvariant();
            AttributeEntry attributeEntry;

            if (name.StartsWith("!"))
            {
                attributeEntry = new UnsetAttributeEntry(name.Substring(1));
            }
            else if (name.EndsWith("!"))
            {
                attributeEntry = new UnsetAttributeEntry(name.Substring(0, name.Length - 1));
            }
            else
            {
                switch (name)
                {
                case "author":
                    attributeEntry = new AuthorInfoAttributeEntry(match.Groups["value"].Value);
                    break;

                default:
                    attributeEntry = new AttributeEntry(name, match.Groups["value"].Value);
                    break;
                }
            }

            return(attributeEntry);
        }
Esempio n. 3
0
 /// <summary>
 /// Visits the unset attribute entry.
 /// </summary>
 /// <param name="attributeEntry">The attribute entry.</param>
 public virtual void VisitUnsetAttributeEntry(UnsetAttributeEntry attributeEntry)
 {
 }