Exemplo n.º 1
0
 private static void LoadHelper(FormStyleLibrary newLibrary)
 {
     if (newLibrary != globalStyleLibrary)
     {
         FormStyleLibrary oldLibrary = globalStyleLibrary;
         globalStyleLibrary = newLibrary;
         OnStyleChanged();
     }
 }
Exemplo n.º 2
0
 internal static FormStyleLibrary Load(Stream stream)
 {
     using (XmlReader reader = XmlReader.Create(stream))
     {
         XmlSerializer    serializer = new XmlSerializer(typeof(FormStyleLibrary));
         FormStyleLibrary library    = (FormStyleLibrary)serializer.Deserialize(reader);
         return(library);
     }
 }
Exemplo n.º 3
0
        private static void LoadHelper(FormStyleLibrary newLibrary)
        {

            if (newLibrary != globalStyleLibrary)
            {
                FormStyleLibrary oldLibrary = globalStyleLibrary;
                globalStyleLibrary = newLibrary;
                OnStyleChanged();
            }
        }
Exemplo n.º 4
0
        internal static FormStyle AddNewStyle()
        {
            FormStyle style = new FormStyle();

            if (globalStyleLibrary == null)
            {
                globalStyleLibrary = new FormStyleLibrary();
            }

            List <string> styleNames = new List <string>(FormStyleManager.GetStyleNames());

            style.Name = "FormStyle";
            for (int i = 1; styleNames.Contains(style.Name); i++)
            {
                style.Name = String.Format("FormStyle{0}", i);
            }

            globalStyleLibrary.Styles.Add(style);
            OnStyleChanged();

            return(style);
        }
Exemplo n.º 5
0
        public static void Load(Stream stream)
        {
            FormStyleLibrary newLibrary = FormStyleLibrary.Load(stream);

            LoadHelper(newLibrary);
        }
Exemplo n.º 6
0
        internal static FormStyle AddNewStyle()
        {
            FormStyle style = new FormStyle();

            if (globalStyleLibrary == null)
                globalStyleLibrary = new FormStyleLibrary();

            List<string> styleNames = new List<string>(FormStyleManager.GetStyleNames());
            style.Name = "FormStyle";
            for (int i = 1; styleNames.Contains(style.Name); i++)
                style.Name = String.Format("FormStyle{0}", i);

            globalStyleLibrary.Styles.Add(style);
            OnStyleChanged();

            return style;
        }