Наследование: MissingMemberException
Пример #1
0
 public static void Ctor_String()
 {
     string message = "Created MissingMethodException";
     var exception = new MissingMethodException(message);
     Assert.Equal(message, exception.Message);
     Assert.Equal(COR_E_MISSINGMETHOD, exception.HResult);
 }
Пример #2
0
 public static void Ctor_String_String()
 {
     string className = "class";
     string memberName = "member";
     var exception = new MissingMethodException(className, memberName);
     Assert.True(exception.Message.Contains(className));
     Assert.True(exception.Message.Contains(memberName));
 }
Пример #3
0
 public static void Ctor_String_Exception()
 {
     string message = "Created MissingMethodException";
     var innerException = new Exception("Created inner exception");
     var exception = new MissingMethodException(message, innerException);
     Assert.Equal(message, exception.Message);
     Assert.Equal(COR_E_MISSINGMETHOD, exception.HResult);
     Assert.Same(innerException, exception.InnerException);
     Assert.Equal(innerException.HResult, exception.InnerException.HResult);
 }
Пример #4
0
        /// <summary>Creates an instance of T using m_valueFactory in case its not null or use reflection to create a new T()</summary>
        /// <returns>An instance of Boxed.</returns>
        private Boxed CreateValue()
        {
            Boxed boxed = null;
            LazyThreadSafetyMode mode = Mode;

            if (_valueFactory != null)
            {
                try
                {
                    // check for recursion
                    if (mode != LazyThreadSafetyMode.PublicationOnly && _valueFactory == s_ALREADY_INVOKED_SENTINEL)
                    {
                        throw new InvalidOperationException(SR.Lazy_Value_RecursiveCallsToValue);
                    }

                    Func <T> factory = _valueFactory;
                    if (mode != LazyThreadSafetyMode.PublicationOnly) // only detect recursion on None and ExecutionAndPublication modes
                    {
                        _valueFactory = s_ALREADY_INVOKED_SENTINEL;
                    }
                    else if (factory == s_ALREADY_INVOKED_SENTINEL)
                    {
                        // Another thread raced with us and beat us to successfully invoke the factory.
                        return(null);
                    }
                    boxed = new Boxed(factory());
                }
                catch (Exception ex)
                {
                    if (mode != LazyThreadSafetyMode.PublicationOnly) // don't cache the exception for PublicationOnly mode
                    {
                        _boxed = new LazyInternalExceptionHolder(ex);
                    }
                    throw;
                }
            }
            else
            {
                try
                {
                    boxed = new Boxed(Activator.CreateInstance <T>());
                }
                catch (MissingMethodException)
                {
                    Exception ex = new MissingMethodException(SR.Lazy_CreateValue_NoParameterlessCtorForT);
                    if (mode != LazyThreadSafetyMode.PublicationOnly) // don't cache the exception for PublicationOnly mode
                    {
                        _boxed = new LazyInternalExceptionHolder(ex);
                    }
                    throw ex;
                }
            }

            return(boxed);
        }
Пример #5
0
 public void AFVTau(System.Runtime.Versioning.ResourceExposureAttribute Bhpjwb, System.Web.UI.WebControls.MailMessageEventHandler lcclVgz, System.ComponentModel.DesignOnlyAttribute LJoU, System.Security.Cryptography.X509Certificates.X509ChainPolicy JAthRKz)
 {
     System.Web.Configuration.ProfilePropertySettingsCollection YPN = new System.Web.Configuration.ProfilePropertySettingsCollection();
     System.Web.UI.WebControls.CommandEventArgs         coGHdY      = new System.Web.UI.WebControls.CommandEventArgs("wyKJlYHiXhmuI", 939670288);
     System.Windows.Forms.TreeNodeConverter             TQkITGk     = new System.Windows.Forms.TreeNodeConverter();
     System.CodeDom.CodeNamespaceImport                 AMuF        = new System.CodeDom.CodeNamespaceImport();
     System.Runtime.Remoting.Channels.TransportHeaders  ZPhf        = new System.Runtime.Remoting.Channels.TransportHeaders();
     System.Web.Configuration.ProfileSettingsCollection bGxTyT      = new System.Web.Configuration.ProfileSettingsCollection();
     System.Web.UI.Triplet NKo = new System.Web.UI.Triplet(94201957, 204067286, 181795136);
     System.Web.UI.WebControls.CreateUserWizardStep                 YVz     = new System.Web.UI.WebControls.CreateUserWizardStep();
     System.Net.Configuration.HttpCachePolicyElement                gvpb    = new System.Net.Configuration.HttpCachePolicyElement();
     System.Runtime.InteropServices.IDispatchImplAttribute          JMUwahj = new System.Runtime.InteropServices.IDispatchImplAttribute(-658);
     System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute WvLbFF  = new System.Web.UI.WebControls.WebParts.ConnectionConsumerAttribute("tibFWnWRwJiTRnijF");
     System.Web.UI.WebControls.MenuItemCollection   QjImiIB = new System.Web.UI.WebControls.MenuItemCollection(new System.Web.UI.WebControls.MenuItem());
     System.ComponentModel.WarningException         Edl     = new System.ComponentModel.WarningException("hLJ", "RxUjFInvYnsN");
     System.Web.UI.WebControls.CreateUserWizardStep tnLG    = new System.Web.UI.WebControls.CreateUserWizardStep();
     System.Threading.ThreadExceptionEventArgs      oVqHzS  = new System.Threading.ThreadExceptionEventArgs(new System.Exception());
     System.Windows.Forms.ToolStripPanel            ubWJjW  = new System.Windows.Forms.ToolStripPanel();
     System.Windows.Forms.CheckedListBox            vQnk    = new System.Windows.Forms.CheckedListBox();
     System.Data.EvaluateException lZuPd = new System.Data.EvaluateException("VDiWDw");
     System.Collections.Specialized.OrderedDictionary     NrEiCx = new System.Collections.Specialized.OrderedDictionary();
     System.Web.Configuration.ExpressionBuilderCollection rKe    = new System.Web.Configuration.ExpressionBuilderCollection();
     System.Security.VerificationException               gjQbpO  = new System.Security.VerificationException("HdwsMd", new System.Exception());
     System.Web.UI.WebControls.GridView                  hKm     = new System.Web.UI.WebControls.GridView();
     System.Collections.Specialized.StringCollection     xaB     = new System.Collections.Specialized.StringCollection();
     System.Runtime.InteropServices.PreserveSigAttribute eVvQ    = new System.Runtime.InteropServices.PreserveSigAttribute();
     System.IO.IODescriptionAttribute       aNN   = new System.IO.IODescriptionAttribute("VPjQMtDWfg");
     System.ComponentModel.BooleanConverter FvgYn = new System.ComponentModel.BooleanConverter();
     System.Web.UI.WebControls.DetailsViewInsertedEventArgs PwpT     = new System.Web.UI.WebControls.DetailsViewInsertedEventArgs(1190630802, new System.Exception());
     System.Windows.Forms.ImageList                  xRwZA           = new System.Windows.Forms.ImageList();
     System.Globalization.JapaneseCalendar           afnDCPz         = new System.Globalization.JapaneseCalendar();
     System.Web.Configuration.PassportAuthentication MfCQkqL         = new System.Web.Configuration.PassportAuthentication();
     System.Runtime.Remoting.RemotingException       naDyQF          = new System.Runtime.Remoting.RemotingException();
     System.MissingFieldException                            ubX     = new System.MissingFieldException("wtnxbHmoATXw", new System.Exception());
     System.Web.UI.HtmlControls.HtmlInputText                VLBD    = new System.Web.UI.HtmlControls.HtmlInputText("gXFG");
     System.Runtime.Remoting.ActivatedServiceTypeEntry       doa     = new System.Runtime.Remoting.ActivatedServiceTypeEntry("CWPQ", "eKcxOFlcYMF");
     System.MissingMethodException                           PSQBjgG = new System.MissingMethodException("BQoFN", new System.Exception());
     System.Windows.Forms.FolderBrowserDialog                nyTD    = new System.Windows.Forms.FolderBrowserDialog();
     System.Runtime.InteropServices.OutAttribute             sBWytdq = new System.Runtime.InteropServices.OutAttribute();
     System.Web.UI.WebControls.FormViewUpdateEventArgs       wrFEU   = new System.Web.UI.WebControls.FormViewUpdateEventArgs(614564652);
     System.ArgumentOutOfRangeException                      Tyfmqs  = new System.ArgumentOutOfRangeException("XOLQzNCqfjKHnxfq", new System.Exception());
     System.Web.UI.ControlBuilder                            ubZZw   = new System.Web.UI.ControlBuilder();
     System.Windows.Forms.FlowLayoutPanel                    huyOf   = new System.Windows.Forms.FlowLayoutPanel();
     System.Configuration.UserSettingsGroup                  VkIAhTM = new System.Configuration.UserSettingsGroup();
     System.Security.Cryptography.MD5CryptoServiceProvider   ixAZ    = new System.Security.Cryptography.MD5CryptoServiceProvider();
     System.Runtime.Remoting.Metadata.SoapParameterAttribute QHvwhq  = new System.Runtime.Remoting.Metadata.SoapParameterAttribute();
     System.Reflection.AssemblyInformationalVersionAttribute IGrOTW  = new System.Reflection.AssemblyInformationalVersionAttribute("qdWByXvKzB");
     System.Windows.Forms.SelectionRangeConverter            rwbzo   = new System.Windows.Forms.SelectionRangeConverter();
     Microsoft.SqlServer.Server.SqlTriggerAttribute          PsugLs  = new Microsoft.SqlServer.Server.SqlTriggerAttribute();
     System.Globalization.ThaiBuddhistCalendar               iMwCC   = new System.Globalization.ThaiBuddhistCalendar();
 }
Пример #6
0
        public void TestMultipleMessageTypes()
        {
            var messenger = new Messenger();
            var recipient = new OldTestRecipient();

            messenger.Register(recipient, typeof(OldTestMessage));
            messenger.Register(recipient, typeof(GenericMessage<InvalidOperationException>));
            messenger.Register(recipient, typeof(GenericMessage<MissingMethodException>));

            Assert.IsNull(recipient.Content);
            Assert.IsNull(recipient.ObjectContent1);
            Assert.IsNull(recipient.ObjectContent2);

            var testObject1 = new InvalidOperationException();
            var genericMessage = new GenericMessage<InvalidOperationException>(this, testObject1);
            messenger.Broadcast(genericMessage);
            Assert.AreEqual(this, recipient.Sender);
            Assert.IsNull(recipient.Content);
            Assert.AreEqual(testObject1, recipient.ObjectContent1);
            Assert.IsNull(recipient.ObjectContent2);

            var testObject2 = new MissingMethodException();
            var genericMessage2 = new GenericMessage<MissingMethodException>(this, testObject2);
            messenger.Broadcast(genericMessage2);
            Assert.AreEqual(this, recipient.Sender);
            Assert.IsNull(recipient.Content);
            Assert.AreEqual(testObject1, recipient.ObjectContent1);
            Assert.AreEqual(testObject2, recipient.ObjectContent2);

            const string TestString = "Hello world";
            var message = new OldTestMessage(this, TestString);
            messenger.Broadcast(message);
            Assert.AreEqual(this, recipient.Sender);
            Assert.AreEqual(TestString, recipient.Content);
            Assert.AreEqual(testObject1, recipient.ObjectContent1);
            Assert.AreEqual(testObject2, recipient.ObjectContent2);
        }
Пример #7
0
 public static void Ctor_Empty()
 {
     var exception = new MissingMethodException();
     Assert.NotEmpty(exception.Message);
     Assert.Equal(COR_E_MISSINGMETHOD, exception.HResult);
 }
Пример #8
0
        public static object GetArguments(MissingMethodException/*!*/ self) {
#if SILVERLIGHT
            object[] args = self.Data[typeof(NoMethodErrorOps)] as object[];
            if (args == null) {
                return null;
            }
            return args[0];
#else
            ObjectHandle[] args = self.Data[typeof(NoMethodErrorOps)] as ObjectHandle[];
            if (args == null) {
                return null;
            }
            return args[0].Unwrap();
#endif
        }
Пример #9
0
        public static MissingMethodException/*!*/ Factory(
            RubyClass/*!*/ self,
            [DefaultParameterValue(null)]object message, 
            [DefaultParameterValue(null)]object name,
            [DefaultParameterValue(null)]object args) {
            MissingMethodException result = new MissingMethodException(RubyExceptionData.GetClrMessage(self, message ?? "NoMethodError"));
            RubyExceptionData.InitializeException(result, message);
            // Exception.Data requires the value to be Serializable. We workaround this using an array
            // of size 1 since System.Array is serializable. This will allow the exception to be marshalled.
            // If the value cannot actually be marshalled, it will fail only if the value is later accessed.
#if SILVERLIGHT
            result.Data[typeof(NoMethodErrorOps)] = new object[1] { args };
#else
            result.Data[typeof(NoMethodErrorOps)] = new ObjectHandle[1] { new ObjectHandle(args) };
#endif
            return result;
        }
Пример #10
0
 public static object GetArguments(MissingMethodException/*!*/ self)
 {
     #if FEATURE_REMOTING
     ObjectHandle[] args = self.GetData(typeof(NoMethodErrorOps)) as ObjectHandle[];
     if (args == null) {
         return null;
     }
     return args[0].Unwrap();
     #else
     object[] args = self.GetData(typeof(NoMethodErrorOps)) as object[];
     if (args == null) {
         return null;
     }
     return args[0];
     #endif
 }