public static void Refresh()
        {
            var styleFileList = new List<string>();

            var styleFiles = Directory.GetFiles(Environment.CurrentDirectory, "*.style");
            foreach (var styleFile in styleFiles)
                styleFileList.Add(styleFile);

            // The Terrarium directory may not exist...
            try
            {
                var terrariumDocumentsDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal) +
                                                  "\\Terrarium";
                styleFiles = Directory.GetFiles(terrariumDocumentsDirectory, "*.style");
                foreach (var styleFile in styleFiles)
                    styleFileList.Add(styleFile);
            }
            catch
            {
            }

            var styleList = new List<GlassStyle>();

            var defaultStyle = new GlassStyle {Name = "(Default)"};
            styleList.Add(defaultStyle);
            styleList.Add(SystemStyle);

            foreach (var styleFile in styleFileList)
            {
                var style = LoadStyle(styleFile);
                styleList.Add(style);
            }

            Styles = styleList.ToArray();
        }
Example #2
0
 static GlassStyleManager()
 {
     // We only create it once so that we can change the colors
     // that clients will be referencing on the fly
     SystemStyle = new GlassStyle {Name = "(System)"};
     UseStyles = true;
     Active = new GlassStyle();
 }
 static GlassStyleManager()
 {
     // We only create it once so that we can change the colors
     // that clients will be referencing on the fly
     SystemStyle = new GlassStyle {
         Name = "(System)"
     };
     UseStyles = true;
     Active    = new GlassStyle();
 }
        static GlassStyleManager()
        {
            // We only create it once so that we can change the colors
            // that clients will be referencing on the fly
            systemStyle = new GlassStyle();
            systemStyle.Name = "(System)";

            useStyles = true;
            activeStyle = new GlassStyle();
            RefreshSystemStyle();
        }
        public static void Refresh()
        {
            var styleFileList = new List <string>();

            var styleFiles = Directory.GetFiles(Environment.CurrentDirectory, "*.style");

            foreach (var styleFile in styleFiles)
            {
                styleFileList.Add(styleFile);
            }

            // The Terrarium directory may not exist...
            try
            {
                var terrariumDocumentsDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal) +
                                                  "\\Terrarium";
                styleFiles = Directory.GetFiles(terrariumDocumentsDirectory, "*.style");
                foreach (var styleFile in styleFiles)
                {
                    styleFileList.Add(styleFile);
                }
            }
            catch
            {
            }

            var styleList = new List <GlassStyle>();

            var defaultStyle = new GlassStyle {
                Name = "(Default)"
            };

            styleList.Add(defaultStyle);
            styleList.Add(SystemStyle);

            foreach (var styleFile in styleFileList)
            {
                var style = LoadStyle(styleFile);
                styleList.Add(style);
            }

            Styles = styleList.ToArray();
        }
 public static void SetStyle( string styleName )
 {
     foreach( GlassStyle style in loadedStyles )
     {
         if ( style.Name == styleName )
         {
             activeStyle = style;
             break;
         }
     }
 }
        public static void Refresh()
        {
            ArrayList styleFileList = new ArrayList();

            string[] styleFiles = Directory.GetFiles( Environment.CurrentDirectory, "*.style" );
            foreach( string styleFile in styleFiles )
                styleFileList.Add( styleFile );

            // The Terrarium directory may not exist...
            try
            {
                string terrariumDocumentsDirectory = Environment.GetFolderPath( Environment.SpecialFolder.Personal ) + "\\Terrarium";
                styleFiles = Directory.GetFiles( terrariumDocumentsDirectory, "*.style" );
                foreach( string styleFile in styleFiles )
                    styleFileList.Add( styleFile );
            }
            catch{}

            ArrayList styleList = new ArrayList();

            GlassStyle defaultStyle = new GlassStyle();
            defaultStyle.Name = "(Default)";
            styleList.Add( defaultStyle );

            styleList.Add( systemStyle);

            foreach( string styleFile in styleFileList )
            {
                GlassStyle style = GlassStyleManager.LoadStyle( styleFile );
                styleList.Add( style );
            }

            loadedStyles = (GlassStyle[])styleList.ToArray(typeof(GlassStyle));
        }