Esempio n. 1
0
        public PmlElement Add(string key, Object value)
        {
            PmlElement el;

            if (value == null)
            {
                el = new PmlNull();
            }
            else if (value is PmlElement)
            {
                el = value as PmlElement;
            }
            else if (value is String)
            {
                el = new PmlString(value as string);
            }
            else if (value is Int32 || value is Int64)
            {
                el = new PmlNumber((Int64)value);
            }
            else if (value is UInt32 || value is UInt32)
            {
                el = new PmlNumber((UInt64)value);
            }
            else
            {
                el = new PmlString(value.ToString());
            }
            return(Add(key, el));
        }
Esempio n. 2
0
 public PmlElement Add(string Key, PmlElement Element)
 {
     if (Element == null)
     {
         Element = new PmlNull();
     }
     pItems.Add(new KeyValuePair <string, PmlElement>(Key, Element));
     return(Element);
 }
Esempio n. 3
0
 public PmlElement Add(string Key, PmlElement Element)
 {
     if (Element == null)
     {
         Element = new PmlNull();
     }
     Add(new KvpType(Key, Element));
     return(Element);
 }