diff --git a/Rally.RestApi.UiForWpf/SsoWindow.xaml.cs b/Rally.RestApi.UiForWpf/SsoWindow.xaml.cs index 3685f8c..36b4938 100644 --- a/Rally.RestApi.UiForWpf/SsoWindow.xaml.cs +++ b/Rally.RestApi.UiForWpf/SsoWindow.xaml.cs @@ -1,4 +1,5 @@ -using mshtml; +using System.Reflection; +using mshtml; using Rally.RestApi.Auth; using System; using System.Collections.Generic; @@ -39,6 +40,21 @@ public SsoWindow() { InitializeComponent(); browser.LoadCompleted += browser_LoadCompleted; + //browser.Navigated += (a, b) => HideScriptErrors(browser, true); + } + + private void HideScriptErrors(WebBrowser browser, bool hide) + { + var fiComWebBrowser = typeof(WebBrowser).GetField("_axIWebBrowser2", BindingFlags.Instance | BindingFlags.NonPublic); + if (fiComWebBrowser == null) return; + var objComWebBrowser = fiComWebBrowser.GetValue(browser); + if (objComWebBrowser == null) + { + browser.Navigated += (o, s) => HideScriptErrors(browser, hide); + return; + } + objComWebBrowser.GetType() + .InvokeMember("Silent", BindingFlags.SetProperty, null, objComWebBrowser, new object[] { hide }); } #endregion diff --git a/Rally.RestApi/Json/DynamicJsonObject.cs b/Rally.RestApi/Json/DynamicJsonObject.cs index 35f8ade..73a7bd3 100644 --- a/Rally.RestApi/Json/DynamicJsonObject.cs +++ b/Rally.RestApi/Json/DynamicJsonObject.cs @@ -120,6 +120,10 @@ private object FormatSetValue(object value) { return value; } + if (value is DateTime) + { + return ((DateTime)value).ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'"); + } throw new ArgumentException("Attempt to set property to an unsupported type."); }