System.Windows.Forms.Theming.ThemeElements.LoadTheme C# (CSharp) Method

LoadTheme() private static method

private static LoadTheme ( string themeName ) : ThemeElementsDefault
themeName string
return ThemeElementsDefault
		private static ThemeElementsDefault LoadTheme (string themeName) 
		{
			if (themeName == "visualstyles")
				if (Application.VisualStylesEnabled)
					return new ThemeElementsVisualStyles ();
				else
					return new ThemeElementsDefault ();
			Assembly ass = Assembly.GetExecutingAssembly ();
			string iname = typeof(ThemeElements).FullName;
			string assemblyname = iname + themeName;
			Type type = ass.GetType (assemblyname, false, true);
			if (type != null) {
				object o = ass.CreateInstance (type.FullName);
				if (o != null)
					return (ThemeElementsDefault) o;
			}
			return new ThemeElementsDefault ();
		}