Exemplo n.º 1
0
    public CartoElement(Combinator combinator, Node value)
      : base(combinator, value)
    {
      string strValue = value.ToString().Trim();

      if (string.IsNullOrEmpty(strValue))
      {
        m_type = ElementType.Unknown;
        if (strValue != null)
          Value = "\"\"";
      }
      else if (strValue[0] == '#')
      {
        Value = strValue.Remove(0, 1);
        m_type = ElementType.Id;
      }
      else if (strValue[0] == '.')
      {
        Value = strValue.Remove(0, 1);
        m_type = ElementType.Class;
      }
      else if (strValue.Contains('*'))
      {
        m_type = ElementType.Wildchar;
      }
    }
    public CartoFilterElement(Node key, Node op, Node value, Combinator combinator, Env env)
      : base(combinator, value)
    {
      m_key = key;
      m_op = op;
      m_value = value;

      m_id = "[" + m_key.ToString() + "]" + m_op.ToString() + m_value.ToCSS(env).ToString();
    }
Exemplo n.º 3
0
        protected override Node CloneCore()
        {
            if (NodeValue != null)
            {
                return(new Element((Combinator)Combinator.Clone(), NodeValue.Clone()));
            }

            return(new Element((Combinator)Combinator.Clone(), Value));
        }
Exemplo n.º 4
0
 public Element(Combinator combinator, Node value) : this(combinator)
 {
     TextNode textValue = value as TextNode;
     if (textValue != null)
     {
         Value = textValue.Value.Trim();
     }
     else
     {
         NodeValue = value;
     }
 }
Exemplo n.º 5
0
 public Element(Combinator combinator, Node value) : this(combinator)
 {
     TextNode textValue = value as TextNode;
     if (textValue != null && !(value is Quoted))
     {
         Value = textValue.Value.Trim();
     }
     else
     {
         NodeValue = value;
     }
 }
 public Element Element(Combinator combinator, Node value, NodeLocation location)
 {
   return new CartoElement(combinator, value) { Location = location };
 }
 public CartoZoomElement(Node comp, Node number, Combinator combinator, Node value):base(combinator, value)
 {
    m_comp = comp;
    m_value = number;
 }
Exemplo n.º 8
0
 public override string ToCSS(Env env)
 {
     return(Combinator.ToCSS(env) + Value);
 }
Exemplo n.º 9
0
 public Element(Combinator combinator, string value)
 {
     Combinator = combinator ?? new Combinator("");
     Value      = value.Trim();
 }
Exemplo n.º 10
0
 public Element(Combinator combinator, string value)
 {
     Combinator = combinator ?? new Combinator("");
     Value = value == null ? "" : value.Trim();
 }
Exemplo n.º 11
0
 private Element(Combinator combinator)
 {
     Combinator = combinator ?? new Combinator("");
 }
Exemplo n.º 12
0
 public Element(Combinator combinator, string textValue)
     : this(combinator)
 {
     Value = textValue.Trim();
 }
Exemplo n.º 13
0
 private Element(Combinator combinator)
 {
     Combinator = combinator ?? new Combinator("");
 }
Exemplo n.º 14
0
 public Element(Combinator combinator, string textValue) : this(combinator)
 {
     Value = textValue.Trim();
 }
Exemplo n.º 15
0
 public Element(Combinator combinator, Node value) : this(combinator)
 {
     if (value is TextNode textValue && !(value is Quoted))
     {
         Value = textValue.Value.Trim();
     }
 public CartoInvalidElement(Combinator combinator, string text)
   : base(combinator, "Invalid property or value: '" + text +"'")
 {
 }