예제 #1
0
        public void ParseWidthAttributeTest()
        {
            //Parse tokens
            MarkupParser   markupParser         = new MarkupParser(Init("120"));
            WidthAttribute parsedWidthAttribute = markupParser.ParseWidthAttribute();

            //Check Id Attribute
            Assert.AreEqual(120, parsedWidthAttribute.GetWidth());
        }
예제 #2
0
        /// <summary>
        /// Parser for WidthAttribute
        /// </summary>
        /// <returns>Parsed HeightAttribute</returns>
        public WidthAttribute ParseWidthAttribute()
        {
            WidthAttribute widthAttribute = new WidthAttribute();

            //Get height
            CurrentToken = TokenStream.NextToken();
            widthAttribute.SetWidth(ObjectToInt(CurrentToken.GetValue()));

            return(widthAttribute);
        }
예제 #3
0
 /// <summary>
 /// Interpret WidthAttribute
 /// </summary>
 /// <param name="attribute">WidthAttribute to interpret</param>
 public override void Visit(WidthAttribute attribute)
 {   //Add height attribute
     Current.AddAttribute("width", attribute.GetWidth().ToString());
 }
예제 #4
0
        public static IAttrSet Width(this IAttrSet attrSet, decimal value)
        {
            WidthAttribute a = new WidthAttribute(value);

            return(attrSet.Add(a));
        }
예제 #5
0
        public void ConstructorWithParameterTest()
        {
            var item = new WidthAttribute(1.1);

            Assert.AreEqual(1.1, item.Width);
        }
예제 #6
0
 public virtual void Visit(WidthAttribute attribute)
 {
     VisitSubNodes(attribute);
 }