Пример #1
0
        public object Clone()
        {
            ClassStyleModel newStyleMdl = new ClassStyleModel(this.Parent);

            newStyleMdl.FromXml(this.ToXml());
            return(newStyleMdl);
        }
Пример #2
0
        public ClassStyleModel ApplyInlineStyle(string inlineStyle)
        {
            ClassStyleModel newStyleMdl = new ClassStyleModel(this.Parent);

            newStyleMdl.FromXml(this.ToXml());

            if (!string.IsNullOrEmpty(inlineStyle))
            {
                string[] attributes = inlineStyle.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < attributes.Length; i++)
                {
                    string[] components = attributes[i].Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
                    if (components.Length == 2)
                    {
                        newStyleMdl[components[0].Trim()] = components[1].Trim();
                    }
                }
            }

            return(newStyleMdl);
        }
Пример #3
0
 public bool Compare(ClassStyleModel style)
 {
     // Get the keys of the collection
     return(DictionaryHelper.DictionaryEqual <string, string>(style.DictAttributeList, this.DictAttributeList));
 }