From 8935aadac03e5e1a340e22046bb840d1e223a1f7 Mon Sep 17 00:00:00 2001 From: devgopher Date: Tue, 19 Jan 2016 18:08:59 +0300 Subject: [PATCH 1/3] issue #740 --- .../TypeScript/Project/Src/TypeScriptProject.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/AddIns/BackendBindings/TypeScript/Project/Src/TypeScriptProject.cs b/src/AddIns/BackendBindings/TypeScript/Project/Src/TypeScriptProject.cs index d017aabca7..ab92e6cacc 100644 --- a/src/AddIns/BackendBindings/TypeScript/Project/Src/TypeScriptProject.cs +++ b/src/AddIns/BackendBindings/TypeScript/Project/Src/TypeScriptProject.cs @@ -128,14 +128,23 @@ namespace ICSharpCode.TypeScriptBinding false); } + bool CheckIfProjNull( ) { + return msbuildProject == null; + } + bool GetBooleanProperty(string name, bool defaultValue) { + if (CheckIfProjNull()) + return defaultValue; string propertyValue = msbuildProject.GetEvaluatedProperty(name); return ConvertBooleanValue(propertyValue, defaultValue); } string GetStringProperty(string name, string defaultValue) { + if (CheckIfProjNull()) + return defaultValue; + string propertyValue = msbuildProject.GetEvaluatedProperty(name); if (!String.IsNullOrEmpty(propertyValue)) { return propertyValue; From e39a246c4434986f5734bf832dbe6ff3e3f9edd3 Mon Sep 17 00:00:00 2001 From: devgopher Date: Tue, 19 Jan 2016 18:29:36 +0300 Subject: [PATCH 2/3] Revert "WpfWorkbench: cosmetic" This reverts commit 0ba9b280370ca95c7a1ac689fd3d58f0fba0682a. --- .../SharpDevelop/Workbench/WpfWorkbench.cs | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/Main/SharpDevelop/Workbench/WpfWorkbench.cs b/src/Main/SharpDevelop/Workbench/WpfWorkbench.cs index 8e9c63af93..2dab222965 100644 --- a/src/Main/SharpDevelop/Workbench/WpfWorkbench.cs +++ b/src/Main/SharpDevelop/Workbench/WpfWorkbench.cs @@ -282,9 +282,9 @@ namespace ICSharpCode.SharpDevelop.Workbench get { SD.MainThread.VerifyAccess(); return (from window in WorkbenchWindowCollection - where window.ViewContents.Count > 0 - select window.ViewContents[0] - ).ToList().AsReadOnly(); + where window.ViewContents.Count > 0 + select window.ViewContents[0] + ).ToList().AsReadOnly(); } } @@ -719,7 +719,7 @@ namespace ICSharpCode.SharpDevelop.Workbench { #if DEBUG if (enableFocusDebugOutput) - LoggingService.DebugFormatted(format, args); + LoggingService.DebugFormatted(format, args); #endif } @@ -728,55 +728,55 @@ namespace ICSharpCode.SharpDevelop.Workbench void WpfWorkbench_PreviewGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) { - FocusDebug("GotKeyboardFocus: oldFocus={0}, newFocus={1}", e.OldFocus, e.NewFocus); + FocusDebug("GotKeyboardFocus: oldFocus={0}, newFocus={1}", e.OldFocus, e.NewFocus); } void WpfWorkbench_PreviewLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) { - FocusDebug("LostKeyboardFocus: oldFocus={0}, newFocus={1}", e.OldFocus, e.NewFocus); + FocusDebug("LostKeyboardFocus: oldFocus={0}, newFocus={1}", e.OldFocus, e.NewFocus); } protected override void OnPreviewKeyDown(KeyEventArgs e) { - base.OnPreviewKeyDown(e); - if (!e.Handled && e.Key == Key.D && e.KeyboardDevice.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt)) { - enableFocusDebugOutput = !enableFocusDebugOutput; + base.OnPreviewKeyDown(e); + if (!e.Handled && e.Key == Key.D && e.KeyboardDevice.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt)) { + enableFocusDebugOutput = !enableFocusDebugOutput; - StringWriter output = new StringWriter(); - output.WriteLine("Keyboard.FocusedElement = " + GetElementName(Keyboard.FocusedElement)); - output.WriteLine("ActiveContent = " + GetElementName(this.ActiveContent)); - output.WriteLine("ActiveViewContent = " + GetElementName(this.ActiveViewContent)); - output.WriteLine("ActiveWorkbenchWindow = " + GetElementName(this.ActiveWorkbenchWindow)); - ((AvalonDockLayout)workbenchLayout).WriteState(output); - LoggingService.Debug(output.ToString()); - e.Handled = true; - } - if (!e.Handled && e.Key == Key.F && e.KeyboardDevice.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt)) { - if (TextOptions.GetTextFormattingMode(this) == TextFormattingMode.Display) - TextOptions.SetTextFormattingMode(this, TextFormattingMode.Ideal); - else - TextOptions.SetTextFormattingMode(this, TextFormattingMode.Display); - SD.StatusBar.SetMessage("TextFormattingMode=" + TextOptions.GetTextFormattingMode(this)); - } - if (!e.Handled && e.Key == Key.R && e.KeyboardDevice.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt)) { - switch (TextOptions.GetTextRenderingMode(this)) { - case TextRenderingMode.Auto: - case TextRenderingMode.ClearType: - TextOptions.SetTextRenderingMode(this, TextRenderingMode.Grayscale); - break; - case TextRenderingMode.Grayscale: - TextOptions.SetTextRenderingMode(this, TextRenderingMode.Aliased); - break; - default: - TextOptions.SetTextRenderingMode(this, TextRenderingMode.ClearType); - break; - } - SD.StatusBar.SetMessage("TextRenderingMode=" + TextOptions.GetTextRenderingMode(this)); - } - if (!e.Handled && e.Key == Key.G && e.KeyboardDevice.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt)) { - GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced); - SD.StatusBar.SetMessage("Total memory = " + (GC.GetTotalMemory(true) / 1024 / 1024f).ToString("f1") + " MB"); - } + StringWriter output = new StringWriter(); + output.WriteLine("Keyboard.FocusedElement = " + GetElementName(Keyboard.FocusedElement)); + output.WriteLine("ActiveContent = " + GetElementName(this.ActiveContent)); + output.WriteLine("ActiveViewContent = " + GetElementName(this.ActiveViewContent)); + output.WriteLine("ActiveWorkbenchWindow = " + GetElementName(this.ActiveWorkbenchWindow)); + ((AvalonDockLayout)workbenchLayout).WriteState(output); + LoggingService.Debug(output.ToString()); + e.Handled = true; + } + if (!e.Handled && e.Key == Key.F && e.KeyboardDevice.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt)) { + if (TextOptions.GetTextFormattingMode(this) == TextFormattingMode.Display) + TextOptions.SetTextFormattingMode(this, TextFormattingMode.Ideal); + else + TextOptions.SetTextFormattingMode(this, TextFormattingMode.Display); + SD.StatusBar.SetMessage("TextFormattingMode=" + TextOptions.GetTextFormattingMode(this)); + } + if (!e.Handled && e.Key == Key.R && e.KeyboardDevice.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt)) { + switch (TextOptions.GetTextRenderingMode(this)) { + case TextRenderingMode.Auto: + case TextRenderingMode.ClearType: + TextOptions.SetTextRenderingMode(this, TextRenderingMode.Grayscale); + break; + case TextRenderingMode.Grayscale: + TextOptions.SetTextRenderingMode(this, TextRenderingMode.Aliased); + break; + default: + TextOptions.SetTextRenderingMode(this, TextRenderingMode.ClearType); + break; + } + SD.StatusBar.SetMessage("TextRenderingMode=" + TextOptions.GetTextRenderingMode(this)); + } + if (!e.Handled && e.Key == Key.G && e.KeyboardDevice.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt)) { + GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced); + SD.StatusBar.SetMessage("Total memory = " + (GC.GetTotalMemory(true) / 1024 / 1024f).ToString("f1") + " MB"); + } } #endif