diff options
author | Bret Johnson <bretjohn@microsoft.com> | 2018-02-25 04:21:21 +0300 |
---|---|---|
committer | Bret Johnson <bretjohn@microsoft.com> | 2018-02-25 04:21:21 +0300 |
commit | ac1bbda68027293e7a8c2d82465f0c5058e67159 (patch) | |
tree | 975e87fae708707df2376a3ead98a1999879b39d | |
parent | dd52b48a9768047c81544eba08d01f3e1e929ea7 (diff) |
Updated to better match Proppy code styleadd-vs-theme-support
-rw-r--r-- | VisualStudioIntegration/VisualStudioTheme.cs | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/VisualStudioIntegration/VisualStudioTheme.cs b/VisualStudioIntegration/VisualStudioTheme.cs index 1c76b3c..48f4357 100644 --- a/VisualStudioIntegration/VisualStudioTheme.cs +++ b/VisualStudioIntegration/VisualStudioTheme.cs @@ -43,26 +43,26 @@ namespace Xamarin.PropertyEditing.VisualStudioIntegration /// </example>
public class VisualStudioTheme
{
- static readonly Guid categoryCider = new Guid ("92d153ee-57d7-431f-a739-0931ca3f7f70");
- static readonly Guid categoryEnvironment = new Guid ("624ed9c3-bdfd-41fa-96c3-7c824ea32e3d");
- static readonly Guid categorySearch = new Guid("f1095fad-881f-45f1-8580-589e10325eb8");
- static readonly Guid categoryTreeView = new Guid("92ecf08e-8b13-4cf4-99e9-ae2692382185");
-
- IVsUIShell5 vsUiShell5;
- ResourceDictionary resourceDictionary;
-
public ResourceDictionary CreateResourceDictionary (IServiceProvider serviceProvider)
{
- vsUiShell5 = serviceProvider.GetService (typeof (IVsUIShell)) as IVsUIShell5;
- if (vsUiShell5 == null)
+ this.vsUiShell5 = serviceProvider.GetService (typeof (IVsUIShell)) as IVsUIShell5;
+ if (this.vsUiShell5 == null)
throw new Exception ("Couldn't get IVsUIShell5 service");
- resourceDictionary = new ResourceDictionary ();
- AddBrushes();
- return resourceDictionary;
+ this.resourceDictionary = new ResourceDictionary ();
+ AddBrushes ();
+ return this.resourceDictionary;
}
- void AddBrushes ()
+ private static readonly Guid categoryCider = new Guid ("92d153ee-57d7-431f-a739-0931ca3f7f70");
+ private static readonly Guid categoryEnvironment = new Guid ("624ed9c3-bdfd-41fa-96c3-7c824ea32e3d");
+ private static readonly Guid categorySearch = new Guid("f1095fad-881f-45f1-8580-589e10325eb8");
+ private static readonly Guid categoryTreeView = new Guid("92ecf08e-8b13-4cf4-99e9-ae2692382185");
+
+ private IVsUIShell5 vsUiShell5;
+ private ResourceDictionary resourceDictionary;
+
+ private void AddBrushes ()
{
AddBrush ("FocusVisualBorderBrush", "VS.Cider.ToolWindowTextColor");
@@ -199,7 +199,7 @@ namespace Xamarin.PropertyEditing.VisualStudioIntegration "VS.Environment.ScrollBarArrowDisabledBackgroundColor");
}
- void AddBrush (string ourKey, string vsKey)
+ private void AddBrush (string ourKey, string vsKey)
{
int lastPeriod = vsKey.LastIndexOf ('.');
if (lastPeriod == -1)
@@ -219,6 +219,7 @@ namespace Xamarin.PropertyEditing.VisualStudioIntegration else throw new Exception ($"Unknown theme brush category: {categoryName}");
string longBrushName = vsKey.Substring (lastPeriod + 1);
+
string shortBrushName;
__THEMEDCOLORTYPE colorType;
if (longBrushName.EndsWith ("TextColor")) {
@@ -236,7 +237,7 @@ namespace Xamarin.PropertyEditing.VisualStudioIntegration Color color = Color.FromArgb (bytes[3], bytes[2], bytes[1], bytes[0]);
SolidColorBrush brush = new SolidColorBrush (color);
- resourceDictionary.Add (ourKey, brush);
+ this.resourceDictionary.Add (ourKey, brush);
}
}
}
|