Imported Upstream version 5.14.0.78

Former-commit-id: 3494343bcc9ddb42b36b82dd9ae7b69e85e0229f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-05-10 08:37:03 +00:00
parent 74b74abd9f
commit 19234507ba
1776 changed files with 67755 additions and 31107 deletions

View File

@ -38,36 +38,10 @@ namespace System.Windows.Forms.Theming
static ThemeElements ()
{
string theme_var;
theme_var = Environment.GetEnvironmentVariable ("MONO_THEME");
if (theme_var == null)
theme_var = "win32";
if (Application.VisualStylesEnabled)
theme = new ThemeElementsVisualStyles ();
else
theme_var = theme_var.ToLower ();
theme = LoadTheme (theme_var);
}
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 ();
theme = new ThemeElementsDefault ();
}
#region Buttons