예제 #1
0
 public void RemoveStyle(GDStyleKey prop)
 {
     for (int i = 0; i < Count; i++)
     {
         if (p_list[i].Key == prop)
         {
             p_list.RemoveAt(i);
             i--;
         }
     }
 }
예제 #2
0
 public bool ContainsStyle(GDStyleKey key)
 {
     foreach (GDTextStyle style in p_list)
     {
         if (style.Key == key)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #3
0
        public object GetValue(GDStyleKey key)
        {
            foreach (GDTextStyle style in p_list)
            {
                if (style.Key == key)
                {
                    return(style.Value);
                }
            }

            return(null);
        }
예제 #4
0
        public GDTextStyle SetStyle(GDStyleKey prop, object value)
        {
            for (int i = 0; i < Count; i++)
            {
                if (p_list[i].Key == prop)
                {
                    p_list[i].Value = value;
                    return(p_list[i]);
                }
            }

            GDTextStyle ns = new GDTextStyle();

            ns.Key   = prop;
            ns.Value = value;
            return(AddStyle(ns));
        }
예제 #5
0
 public GDTextStyle(GDStyleKey key, object value)
 {
     Key   = key;
     Value = value;
 }
예제 #6
0
        private void _HarvestFormatValues(Dictionary <object, int> data, ref int topID, GDStyleKey key)
        {
            if (Format.ContainsStyle(key))
            {
                object obj = Format.GetValue(key);
                if (obj != null)
                {
                    if (!data.ContainsKey(obj))
                    {
                        data.Add(obj, topID);
                        topID++;
                    }
                }
            }

            if (p_nodes != null)
            {
                foreach (GDNode node in p_nodes)
                {
                    node._HarvestFormatValues(data, ref topID, key);
                }
            }
        }