Merge pull request #558 from mkorkalo/master
[mono.git] / mcs / class / corlib / System.Runtime.CompilerServices / ContractHelper.cs
index 34b32cca843993aa100acefdf4ba719a92d25a9b..25ff7fdee7dd32b52c3ff4b03592f3563d7dc0a7 100644 (file)
@@ -39,24 +39,7 @@ namespace System.Runtime.CompilerServices
 {
        public static class ContractHelper
        {
-#if MOONLIGHT
-               const string SystemWindowsBrowser = ", System.Windows.Browser, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e";
-               const string HtmlPage = "System.Windows.Browser.HtmlPage" + SystemWindowsBrowser;
-               const string HtmlWindow = "System.Windows.Browser.HtmlWindow" + SystemWindowsBrowser;
-               static MethodInfo alert;
-               static object window;
-
-               static ContractHelper ()
-               {
-                       Type htmlpage = Type.GetType (HtmlPage);
-                       MethodInfo get_window = htmlpage.GetMethod ("get_Window", BindingFlags.Static | BindingFlags.Public);
-                       window = get_window.Invoke (null, null);
-                       Type htmlwindow = Type.GetType (HtmlWindow);
-                       alert = htmlwindow.GetMethod ("Alert", BindingFlags.Instance | BindingFlags.Public);
-               }
-#endif
-
-               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
+               [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)]
                [DebuggerNonUserCode]
                public static string RaiseContractFailedEvent (ContractFailureKind failureKind, string userMessage, string conditionText, Exception innerException)
                {
@@ -140,12 +123,6 @@ namespace System.Runtime.CompilerServices
                        if (displayMessage != null) {
                                msg.Append (displayMessage);
                        }
-#if MOONLIGHT
-                       // Silverlight shows a dialog that let you Abort (kill process/browser), Retry or Ignore
-                       // Moonlight will simply warn and ignore (at least until FailFast is implemented)
-                       // using reflection into System.Windows.Browser to popup an browser alert
-                       alert.Invoke (window, new object [] { msg.ToString () });
-#else
                        if (Environment.UserInteractive) {
                                // FIXME: This should trigger an assertion.
                                // But code will never get here at the moment, as Environment.UserInteractive currently
@@ -155,7 +132,6 @@ namespace System.Runtime.CompilerServices
                                // Note that FailFast() currently throws a NotImplementedException()
                                Environment.FailFast(msg.ToString()/*, new ExecutionEngineException()*/);
                        }
-#endif
                }
 
        }