Пример #1
0
 /// <summary>
 /// constructs a method item from a method base by determining the method name and its parameters.
 /// </summary>
 /// <param name="methodBase"></param>
 public MethodItem(System.Reflection.MethodBase methodBase)
     : this(methodBase.Name, GetMethodParameterNames(methodBase))
 {
 }
 public MsgPack_Serialization_EnumInt16Serializer(MsgPack.Serialization.SerializationContext context) :
     base(context, MsgPack.Serialization.EnumSerializationMethod.ByName)
 {
     this._methodBaseComplexType_get_History0 = typeof(MsgPack.Serialization.ComplexType).GetMethod("get_History", (System.Reflection.BindingFlags.Instance
                                                                                                                    | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_AddOnlyCollection_DateTimeField1 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_AddOnlyCollection_DateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                      | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_AddOnlyCollection_MessagePackObjectField2 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_AddOnlyCollection_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                                        | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_AddOnlyCollection_ObjectField3 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_AddOnlyCollection_ObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                  | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ArrayListField4 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ArrayListField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                    | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_Collection_MessagePackObjectField5 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_Collection_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                          | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_CollectionDateTimeField6 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_CollectionDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                      | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_CollectionObjectField7 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_CollectionObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                  | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_Dictionary_MessagePackObject_MessagePackObjectField8 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_Dictionary_MessagePackObject_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                                                              | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_DictionaryObjectObjectField9 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_DictionaryObjectObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                              | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_DictionaryStringDateTimeField10 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_DictionaryStringDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                   | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_HashSet_MessagePackObjectField11 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_HashSet_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                     | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_HashSetDateTimeField12 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_HashSetDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                 | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_HashSetObjectField13 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_HashSetObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                             | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_HashtableField14 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_HashtableField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                     | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ICollection_MessagePackObjectField15 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ICollection_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                             | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ICollectionDateTimeField16 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ICollectionDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                         | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ICollectionObjectField17 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ICollectionObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                     | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_IDictionary_MessagePackObject_MessagePackObjectField18 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_IDictionary_MessagePackObject_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                                                                 | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_IDictionaryObjectObjectField19 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_IDictionaryObjectObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                 | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_IDictionaryStringDateTimeField20 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_IDictionaryStringDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                     | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_IList_MessagePackObjectField21 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_IList_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                 | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_IListDateTimeField22 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_IListDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                             | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_IListObjectField23 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_IListObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                         | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ISet_MessagePackObjectField24 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ISet_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                               | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ISetDateTimeField25 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ISetDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                           | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ISetObjectField26 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ISetObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                       | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_List_MessagePackObjectField27 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_List_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                               | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ListDateTimeField28 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ListDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                           | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ListObjectField29 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ListObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                       | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ObservableCollection_MessagePackObjectField30 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ObservableCollection_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                                               | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ObservableCollectionDateTimeField31 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ObservableCollectionDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                           | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ObservableCollectionObjectField32 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ObservableCollectionObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                       | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_StringKeyedCollection_DateTimeField33 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_StringKeyedCollection_DateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                               | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_StringKeyedCollection_MessagePackObjectField34 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_StringKeyedCollection_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                                                 | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_StringKeyedCollection_ObjectField35 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_StringKeyedCollection_ObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                           | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeWithDataContract_get_History36 = typeof(MsgPack.Serialization.ComplexTypeWithDataContract).GetMethod("get_History", (System.Reflection.BindingFlags.Instance
                                                                                                                                                     | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeWithDataContractWithOrder_get_History37 = typeof(MsgPack.Serialization.ComplexTypeWithDataContractWithOrder).GetMethod("get_History", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                       | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeWithNonSerialized_get_History38 = typeof(MsgPack.Serialization.ComplexTypeWithNonSerialized).GetMethod("get_History", (System.Reflection.BindingFlags.Instance
                                                                                                                                                       | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeWithoutAnyAttribute_get_History39 = typeof(MsgPack.Serialization.ComplexTypeWithoutAnyAttribute).GetMethod("get_History", (System.Reflection.BindingFlags.Instance
                                                                                                                                                           | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
 }
Пример #3
0
        public override void Execute(MethodInfo aMethod, ILOpCode aOpCode)
        {
            DoNullReferenceCheck(Assembler, DebugEnabled, 0);
            OpType xType     = ( OpType )aOpCode;
            string BaseLabel = GetLabel(aMethod, aOpCode) + ".";

            string xTypeID = GetTypeIDLabel(xType.Value);

            var xTypeSize = SizeOfType(xType.Value);

            string mReturnNullLabel = BaseLabel + "_ReturnNull";

            new CPUx86.Compare {
                DestinationReg = CPUx86.Registers.ESP, DestinationIsIndirect = true, SourceValue = 0
            };
            new CPUx86.ConditionalJump {
                Condition = CPUx86.ConditionalTestEnum.Zero, DestinationLabel = mReturnNullLabel
            };
            new CPUx86.Mov {
                DestinationReg = CPUx86.Registers.EAX, SourceReg = CPUx86.Registers.ESP, SourceIsIndirect = true
            };
            new CPUx86.Push {
                DestinationReg = CPUx86.Registers.EAX, DestinationIsIndirect = true
            };
            new CPUx86.Push {
                DestinationRef = Cosmos.Assembler.ElementReference.New(xTypeID), DestinationIsIndirect = true
            };
            System.Reflection.MethodBase xMethodIsInstance = ReflectionUtilities.GetMethodBase(typeof(VTablesImpl), "IsInstance", "System.Int32", "System.Int32");
            new Call(Assembler).Execute(aMethod, new OpMethod(ILOpCode.Code.Call, 0, 0, xMethodIsInstance, aOpCode.CurrentExceptionHandler));

            new Label(BaseLabel + "_After_IsInstance_Call");
            new CPUx86.Pop {
                DestinationReg = CPUx86.Registers.EAX
            };
            new CPUx86.Compare {
                DestinationReg = CPUx86.Registers.EAX, SourceValue = 0
            };
            new CPUx86.ConditionalJump {
                Condition = CPUx86.ConditionalTestEnum.Equal, DestinationLabel = mReturnNullLabel
            };
            new CPUx86.Pop {
                DestinationReg = CPUx86.Registers.EAX
            };
            uint xSize = xTypeSize;

            if (xSize % 4 > 0)
            {
                xSize += 4 - (xSize % 4);
            }
            int xItems = ( int )xSize / 4;

            for (int i = xItems - 1; i >= 0; i--)
            {
                new CPUx86.Push {
                    DestinationReg = CPUx86.Registers.EAX, DestinationIsIndirect = true, DestinationDisplacement = ((i * 4) + ObjectImpl.FieldDataOffset)
                };
            }
            new CPUx86.Jump {
                DestinationLabel = GetLabel(aMethod, aOpCode.NextPosition)
            };
            new Label(mReturnNullLabel);
            new CPUx86.Add {
                DestinationReg = CPUx86.Registers.ESP, SourceValue = 4
            };
            new CPUx86.Push {
                DestinationValue = 0
            };
        }
Пример #4
0
        } // Invoke

        // This is called for all remoted calls on a TP except Ctors
        // The method called may be Sync, Async or OneWay(special case of Async)
        // In the Async case we come here for both BeginInvoke & EndInvoke
        internal virtual IMessage InternalInvoke(
            IMethodCallMessage reqMcmMsg, bool useDispatchMessage, int callType)
        {
            Message reqMsg = reqMcmMsg as Message;

            if ((reqMsg == null) && (callType != Message.Sync))
            {
                // Only the synchronous call type is supported for messages that
                //   aren't of type Message.
                throw new RemotingException(
                          Environment.GetResourceString("Remoting_Proxy_InvalidCallType"));
            }

            IMessage retMsg        = null;
            Thread   currentThread = Thread.CurrentThread;

            // pick up call context from the thread
            LogicalCallContext cctx = currentThread.GetLogicalCallContext();

            Identity       idObj    = IdentityObject;
            ServerIdentity serverID = idObj as ServerIdentity;

            if ((null != serverID) && idObj.IsFullyDisconnected())
            {
                throw new ArgumentException(
                          String.Format(Environment.GetResourceString("Remoting_ServerObjectNotFound"), reqMcmMsg.Uri));
            }

            // Short-circuit calls to Object::GetType and Object::GetHashCode
            MethodBase mb = reqMcmMsg.MethodBase;

            if (_getTypeMethod == mb)
            {
                // Time to load the true type of the remote object....
                Type t = GetProxiedType();
                return(new ReturnMessage(t, null, 0, cctx, reqMcmMsg));
            }

            if (_getHashCodeMethod == mb)
            {
                int hashCode = idObj.GetHashCode();
                return(new ReturnMessage(hashCode, null, 0, cctx, reqMcmMsg));
            }

            // check for channel sink
            if (idObj.ChannelSink == null)
            {
                throw new RemotingException(
                          Environment.GetResourceString("Remoting_Proxy_NoChannelSink"));
            }

            // Set the identity in the message object
            IInternalMessage iim = (IInternalMessage)reqMcmMsg;

            iim.IdentityObject = idObj;

            if (null != serverID)
            {
                Message.DebugOut("Setting serveridentity on message \n");
                iim.ServerIdentityObject = serverID;
            }
            else
            {
                // We need to set the URI only for identities that
                // are not the server identities. The uri is used to
                // dispatch methods for objects outside the appdomain.
                // Inside the appdomain (xcontext case) we dispatch
                // by getting the server object from the server identity.
                iim.SetURI(idObj.URI);
            }

            Message.DebugOut("InternalInvoke. Dispatching based on class type\n");
            AsyncResult ar = null;

            switch (callType)
            {
            case Message.Sync:
                Message.DebugOut("RemotingProxy.Invoke Call: SyncProcessMsg\n");
                BCLDebug.Assert(!useDispatchMessage, "!useDispatchMessage");
                bool         bSkipContextChain = false;
                Context      currentContext    = currentThread.GetCurrentContextInternal();
                IMessageSink nextSink          = idObj.EnvoyChain;

                // if we are in the default context, there can be no
                // client context chain, so we can skip the intermediate
                // calls if there are no envoy sinks

                if (currentContext.IsDefaultContext)
                {
                    if (nextSink is EnvoyTerminatorSink)
                    {
                        bSkipContextChain = true;

                        // jump directly to the channel sink
                        nextSink = idObj.ChannelSink;
                    }
                }

                retMsg = CallProcessMessage(nextSink,
                                            reqMcmMsg,
                                            idObj.ProxySideDynamicSinks,
                                            currentThread,
                                            currentContext,
                                            bSkipContextChain);

                break;

            case Message.BeginAsync:
            case Message.BeginAsync | Message.OneWay:
                // For async calls we clone the call context from the thread
                // This is a limited clone (we dont deep copy the user data)
                cctx = (LogicalCallContext)cctx.Clone();
                iim.SetCallContext(cctx);

                ar = new AsyncResult(reqMsg);

                InternalInvokeAsync(ar, reqMsg, useDispatchMessage, callType);

                Message.DebugOut("Propagate out params for BeginAsync\n");
                retMsg = new ReturnMessage(ar, null, 0, null /*cctx*/, reqMsg);
                break;

            case Message.OneWay:
                // For async calls we clone the call context from the thread
                // This is a limited clone (we dont deep copy the user data)
                cctx = (LogicalCallContext)cctx.Clone();
                iim.SetCallContext(cctx);
                InternalInvokeAsync(null, reqMsg, useDispatchMessage, callType);
                retMsg = new ReturnMessage(null, null, 0, null /*cctx*/, reqMcmMsg);
                break;

            case (Message.EndAsync | Message.OneWay):
                retMsg = new ReturnMessage(null, null, 0, null /*cctx*/, reqMcmMsg);
                break;

            case Message.EndAsync:
                // For endAsync, we merge back the returned callContext
                // into the thread's callContext
                retMsg = RealProxy.EndInvokeHelper(reqMsg, true);
                break;
            }

            return(retMsg);
        }
Пример #5
0
 /// <summary>
 /// Pushes a pointer to the native code implementing the given method onto the evaluation
 /// stack.  The virtual qualifier will be ignored, if present.
 /// </summary>
 /// <param name="method"> The method to retrieve a pointer for. </param>
 public override void LoadStaticMethodPointer(System.Reflection.MethodBase method)
 {
     Log("ldftn", method);
     this.generator.LoadStaticMethodPointer(method);
 }
Пример #6
0
 public static bool IsOneWay(System.Reflection.MethodBase method)
 {
     return(default(bool));
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="eventID"></param>
        /// <param name="methodBase"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        public static Exception HandleComponentException(int eventID, System.Reflection.MethodBase methodBase, Exception ex)
        {
            string s = methodBase.DeclaringType.FullName + "." + methodBase.Name;

            return(HandleComponentException(eventID, methodBase.DeclaringType.FullName + "." + methodBase.Name, ex));
        }
Пример #8
0
 /// <summary>
 /// Pops the method arguments off the stack, calls the given method, then pushes the result
 /// to the stack (if there was one).  This operation cannot be used to call static methods.
 /// Virtual overrides are obeyed and a null check is performed.
 /// </summary>
 /// <param name="method"> The method to call. </param>
 /// <exception cref="ArgumentException"> The method is static. </exception>
 public override void CallVirtual(System.Reflection.MethodBase method)
 {
     Log("callvirt", method);
     this.generator.CallVirtual(method);
 }
Пример #9
0
        public static void logResults(System.Reflection.MethodBase method, Results result, string message)
        {
            string stringMethod = "";
            bool   isNullMethod = true;

            if (method != null)
            {
                stringMethod = method.ToString();
                isNullMethod = false;
            }
            var    sb        = new StringBuilder();
            string date      = DateTime.Now.ToString();
            int    index     = date.IndexOf(" ");
            string subString = date.Substring(0, index);
            string nwDate    = Regex.Replace(subString, "/", "");

            logFileName = "WebsiteRegressionProduction_TestCycle." + nwDate;
            string currentLogFile = logFileLocation + @"\" + logFileName;

            try
            {
                if (!Directory.Exists(logFileLocation))
                {
                    Directory.CreateDirectory(logFileLocation);
                }
                if (!File.Exists(currentLogFile))
                {
                    File.WriteAllText(currentLogFile,
                                      "DATE-TIME\t\t\t\tACTION\t\t\tTEST CLASS\t\t\tTEST NAME\t\t\t\t\t\tTEST STATUS\t\tERROR MESSAGES\n\n",
                                      Encoding.ASCII);
                }
                if (!isNullMethod)
                {
                    if (stringMethod.Contains("ConfigurationFiles"))
                    {
                        sb.Append("\n\n\n");
                    }
                }
                sb.Append(String.Format("{0} : Test Executed: {1} : {2} : {3} : {4}\n\n", DateTime.Now.ToString(),
                                        method.ReflectedType.Name, method, result, message));
                using (var stream = File.AppendText(currentLogFile))
                {
                    stream.Write(sb.ToString());
                }
            }
            catch (IOException e)
            {
                Console.WriteLine(e.Message);
                Console.Read();
            }
            catch (Exception e)
            {
                if (!Directory.Exists(logFileLocation))
                {
                    Directory.CreateDirectory(logFileLocation);
                }
                if (!File.Exists(currentLogFile))
                {
                    File.WriteAllText(currentLogFile,
                                      "DATE-TIME\t\t\t\tACTION\t\t\tTEST CLASS\t\t\tTEST NAME\t\t\t\t\t\tTEST STATUS\t\tERROR MESSAGES\n\n",
                                      Encoding.ASCII);
                }
                sb.Append("Exception Occured in the Logger: " + e.Message);
                using (var stream = File.AppendText(currentLogFile))
                {
                    stream.Write(sb.ToString());
                }
            }
        }
Пример #10
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
        /// the stack boundary into the logging system for this call.</param>
        /// <remarks>
        /// <para>
        /// Initializes a new instance of the <see cref="LocationInfo" />
        /// class based on the current thread.
        /// </para>
        /// </remarks>
        public LocationInfo(Type callerStackBoundaryDeclaringType)
        {
            // Initialize all fields
            m_className  = NA;
            m_fileName   = NA;
            m_lineNumber = NA;
            m_methodName = NA;
            m_fullInfo   = NA;

#if !(NETCF || NETSTANDARD1_3) // StackTrace isn't fully implemented for NETSTANDARD1_3 https://github.com/dotnet/corefx/issues/1797
            if (callerStackBoundaryDeclaringType != null)
            {
                try
                {
                    StackTrace st         = new StackTrace(true);
                    int        frameIndex = 0;

                    // skip frames not from fqnOfCallingClass
                    while (frameIndex < st.FrameCount)
                    {
                        StackFrame frame = st.GetFrame(frameIndex);
                        if (frame != null && frame.GetMethod().DeclaringType == callerStackBoundaryDeclaringType)
                        {
                            break;
                        }
                        frameIndex++;
                    }

                    // skip frames from fqnOfCallingClass
                    while (frameIndex < st.FrameCount)
                    {
                        StackFrame frame = st.GetFrame(frameIndex);
                        if (frame != null && frame.GetMethod().DeclaringType != callerStackBoundaryDeclaringType)
                        {
                            break;
                        }
                        frameIndex++;
                    }

                    if (frameIndex < st.FrameCount)
                    {
                        // take into account the frames we skip above
                        int       adjustedFrameCount = st.FrameCount - frameIndex;
                        ArrayList stackFramesList    = new ArrayList(adjustedFrameCount);
                        m_stackFrames = new StackFrameItem[adjustedFrameCount];
                        for (int i = frameIndex; i < st.FrameCount; i++)
                        {
                            stackFramesList.Add(new StackFrameItem(st.GetFrame(i)));
                        }

                        stackFramesList.CopyTo(m_stackFrames, 0);

                        // now frameIndex is the first 'user' caller frame
                        StackFrame locationFrame = st.GetFrame(frameIndex);

                        if (locationFrame != null)
                        {
                            System.Reflection.MethodBase method = locationFrame.GetMethod();

                            if (method != null)
                            {
                                m_methodName = method.Name;
                                if (method.DeclaringType != null)
                                {
                                    m_className = method.DeclaringType.FullName;
                                }
                            }
                            m_fileName   = locationFrame.GetFileName();
                            m_lineNumber = locationFrame.GetFileLineNumber().ToString(System.Globalization.NumberFormatInfo.InvariantInfo);

                            // Combine all location info
                            m_fullInfo = m_className + '.' + m_methodName + '(' + m_fileName + ':' + m_lineNumber + ')';
                        }
                    }
                }
                catch (System.Security.SecurityException)
                {
                    // This security exception will occur if the caller does not have
                    // some undefined set of SecurityPermission flags.
                    LogLog.Debug(declaringType, "Security exception while trying to get caller stack frame. Error Ignored. Location Information Not Available.");
                }
            }
#endif
        }
Пример #11
0
 public static void logResults(System.Reflection.MethodBase method, Results result)
 {
     logResults(method, result, "");
 }
Пример #12
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
        /// the stack boundary into the logging system for this call.</param>
        /// <remarks>
        /// <para>
        /// Initializes a new instance of the <see cref="LocationInfo" />
        /// class based on the current thread.
        /// </para>
        /// </remarks>
        public LocationInfo(Type callerStackBoundaryDeclaringType)
        {
            // Initialize all fields
            m_className  = NA;
            m_fileName   = NA;
            m_lineNumber = NA;
            m_methodName = NA;
            m_fullInfo   = NA;

#if !NETCF
            if (callerStackBoundaryDeclaringType != null)
            {
                try
                {
                    StackTrace st         = new StackTrace(true);
                    int        frameIndex = 0;

                    // skip frames not from fqnOfCallingClass
                    while (frameIndex < st.FrameCount)
                    {
                        StackFrame frame = st.GetFrame(frameIndex);
                        if (frame != null && frame.GetMethod().DeclaringType == callerStackBoundaryDeclaringType)
                        {
                            break;
                        }
                        frameIndex++;
                    }

                    // skip frames from fqnOfCallingClass
                    while (frameIndex < st.FrameCount)
                    {
                        StackFrame frame = st.GetFrame(frameIndex);
                        if (frame != null && frame.GetMethod().DeclaringType != callerStackBoundaryDeclaringType)
                        {
                            break;
                        }
                        frameIndex++;
                    }

                    if (frameIndex < st.FrameCount)
                    {
                        // now frameIndex is the first 'user' caller frame
                        StackFrame locationFrame = st.GetFrame(frameIndex);

                        if (locationFrame != null)
                        {
                            System.Reflection.MethodBase method = locationFrame.GetMethod();

                            if (method != null)
                            {
                                m_methodName = method.Name;
                                if (method.DeclaringType != null)
                                {
                                    m_className = method.DeclaringType.FullName;
                                }
                            }
                            m_fileName   = locationFrame.GetFileName();
                            m_lineNumber = locationFrame.GetFileLineNumber().ToString(System.Globalization.NumberFormatInfo.InvariantInfo);

                            // Combine all location info
                            m_fullInfo = m_className + '.' + m_methodName + '(' + m_fileName + ':' + m_lineNumber + ')';
                        }
                    }
                }
                catch (System.Security.SecurityException)
                {
                    // This security exception will occur if the caller does not have
                    // some undefined set of SecurityPermission flags.
                    LogLog.Debug("LocationInfo: Security exception while trying to get caller stack frame. Error Ignored. Location Information Not Available.");
                }
            }
#endif
        }
Пример #13
0
 /// <summary>
 /// Отправка генерируемых программой ошибок внешнего окружения
 /// </summary>
 /// <param name="title">Заголовок ошибки</param>
 /// <param name="message">Сообщение</param>
 /// <param name="assemblyName">Сборка, в которой вызвана ошибка</param>
 /// <param name="methodBase">Метод, в котором вызвана ошибка </param>
 public static void WriteExtExToLog(string title, string message, System.Reflection.AssemblyName assemblyName, System.Reflection.MethodBase methodBase)
 {
     Logger.WriteEx(new LogicalException(title, message, assemblyName, methodBase.Name, Priority.ExternalError));
 }
Пример #14
0
 public Node(byte[] key, System.Reflection.MethodBase value, int level)
 {
     this.key = key;
     this.value = value;
     this.next = new Node[level];
 }
Пример #15
0
 public static string MethodToString(System.Reflection.MethodBase Method)
 {
 }
Пример #16
0
 public LuaInterface.LuaFunction Expose(string path, object target, System.Reflection.MethodBase function)
 {
     return(lua.RegisterFunction(path, target, function));
 }
Пример #17
0
 public override bool Rewrite(Meta.CodeDescriptor decompilee, System.Reflection.MethodBase callee, StackElement[] args, IDecompiler stack, SysDOM.IFunctionBuilder builder)
 {
     stack.Push(LiteralReference.CreateConstant(false), false);
     System.Diagnostics.Debugger.Break();
     return(true);
 }
Пример #18
0
 /// <summary>
 /// Pushes a RuntimeMethodHandle corresponding to the given method onto the evaluation
 /// stack.
 /// </summary>
 /// <param name="method"> The method to convert to a RuntimeMethodHandle. </param>
 public override void LoadToken(System.Reflection.MethodBase method)
 {
     Log("ldtoken", method);
     this.generator.LoadToken(method);
 }
Пример #19
0
 public MsgPack_Serialization_AnnotatedClassSerializer(MsgPack.Serialization.SerializationContext context) :
     base(context)
 {
     this._serializer0 = context.GetSerializer <int>();
     this._serializer1 = context.GetSerializer <System.Collections.Generic.List <int> >();
     this._fieldAnnotatedClass_NonPublicField0 = typeof(MsgPack.Serialization.AnnotatedClass).GetField("NonPublicField", (System.Reflection.BindingFlags.Instance
                                                                                                                          | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)));
     this._fieldAnnotatedClass_NonSerializedNonPublicField1 = typeof(MsgPack.Serialization.AnnotatedClass).GetField("NonSerializedNonPublicField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                    | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)));
     this._methodBaseComplexType_get_History0 = typeof(MsgPack.Serialization.ComplexType).GetMethod("get_History", (System.Reflection.BindingFlags.Instance
                                                                                                                    | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_AddOnlyCollection_DateTimeField1 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_AddOnlyCollection_DateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                      | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_AddOnlyCollection_MessagePackObjectField2 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_AddOnlyCollection_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                                        | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_AddOnlyCollection_ObjectField3 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_AddOnlyCollection_ObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                  | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ArrayListField4 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ArrayListField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                    | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_Collection_MessagePackObjectField5 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_Collection_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                          | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_CollectionDateTimeField6 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_CollectionDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                      | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_CollectionObjectField7 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_CollectionObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                  | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_Dictionary_MessagePackObject_MessagePackObjectField8 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_Dictionary_MessagePackObject_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                                                              | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_DictionaryObjectObjectField9 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_DictionaryObjectObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                              | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_DictionaryStringDateTimeField10 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_DictionaryStringDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                   | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_HashSet_MessagePackObjectField11 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_HashSet_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                     | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_HashSetDateTimeField12 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_HashSetDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                 | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_HashSetObjectField13 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_HashSetObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                             | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_HashtableField14 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_HashtableField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                     | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ICollection_MessagePackObjectField15 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ICollection_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                             | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ICollectionDateTimeField16 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ICollectionDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                         | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ICollectionObjectField17 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ICollectionObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                     | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_IDictionary_MessagePackObject_MessagePackObjectField18 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_IDictionary_MessagePackObject_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                                                                 | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_IDictionaryObjectObjectField19 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_IDictionaryObjectObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                 | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_IDictionaryStringDateTimeField20 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_IDictionaryStringDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                     | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_IList_MessagePackObjectField21 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_IList_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                 | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_IListDateTimeField22 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_IListDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                             | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_IListObjectField23 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_IListObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                         | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ISet_MessagePackObjectField24 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ISet_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                               | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ISetDateTimeField25 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ISetDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                           | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ISetObjectField26 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ISetObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                       | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_List_MessagePackObjectField27 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_List_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                               | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ListDateTimeField28 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ListDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                           | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ListObjectField29 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ListObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                       | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ObservableCollection_MessagePackObjectField30 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ObservableCollection_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                                               | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ObservableCollectionDateTimeField31 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ObservableCollectionDateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                           | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_ObservableCollectionObjectField32 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_ObservableCollectionObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                       | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_StringKeyedCollection_DateTimeField33 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_StringKeyedCollection_DateTimeField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                               | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_StringKeyedCollection_MessagePackObjectField34 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_StringKeyedCollection_MessagePackObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                                                 | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeGenerated_get_StringKeyedCollection_ObjectField35 = typeof(MsgPack.Serialization.ComplexTypeGenerated).GetMethod("get_StringKeyedCollection_ObjectField", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                           | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeWithDataContract_get_History36 = typeof(MsgPack.Serialization.ComplexTypeWithDataContract).GetMethod("get_History", (System.Reflection.BindingFlags.Instance
                                                                                                                                                     | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeWithDataContractWithOrder_get_History37 = typeof(MsgPack.Serialization.ComplexTypeWithDataContractWithOrder).GetMethod("get_History", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                       | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeWithNonSerialized_get_History38 = typeof(MsgPack.Serialization.ComplexTypeWithNonSerialized).GetMethod("get_History", (System.Reflection.BindingFlags.Instance
                                                                                                                                                       | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseComplexTypeWithoutAnyAttribute_get_History39 = typeof(MsgPack.Serialization.ComplexTypeWithoutAnyAttribute).GetMethod("get_History", (System.Reflection.BindingFlags.Instance
                                                                                                                                                           | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBasePlainClass_get_CollectionReadOnlyProperty40 = typeof(MsgPack.Serialization.PlainClass).GetMethod("get_CollectionReadOnlyProperty", (System.Reflection.BindingFlags.Instance
                                                                                                                                                         | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseAnnotatedClass_get_NonPublicProperty41 = typeof(MsgPack.Serialization.AnnotatedClass).GetMethod("get_NonPublicProperty", (System.Reflection.BindingFlags.Instance
                                                                                                                                               | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
     this._methodBaseAnnotatedClass_set_NonPublicProperty42 = typeof(MsgPack.Serialization.AnnotatedClass).GetMethod("set_NonPublicProperty", (System.Reflection.BindingFlags.Instance
                                                                                                                                               | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[] {
         typeof(int)
     }, null);
     this._methodBaseAnnotatedClass_get_CollectionReadOnlyProperty43 = typeof(MsgPack.Serialization.AnnotatedClass).GetMethod("get_CollectionReadOnlyProperty", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                 | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[0], null);
 }
Пример #20
0
 /// <summary>
 /// Pushes a pointer to the native code implementing the given method onto the evaluation
 /// stack.  This method cannot be used to retrieve a pointer to a static method.
 /// </summary>
 /// <param name="method"> The method to retrieve a pointer for. </param>
 /// <exception cref="ArgumentException"> The method is static. </exception>
 public override void LoadVirtualMethodPointer(System.Reflection.MethodBase method)
 {
     Log("ldvirtftn", method);
     this.generator.LoadVirtualMethodPointer(method);
 }
Пример #21
0
 public MsgPack_Serialization_PolymorphicMemberTypeKnownType_Tuple_Tuple7FirstPolymorphicPrivateSetterPropertyAndConstructorSerializer(MsgPack.Serialization.SerializationContext context) :
     base(context)
 {
     MsgPack.Serialization.PolymorphismSchema   schema0           = default(MsgPack.Serialization.PolymorphismSchema);
     MsgPack.Serialization.PolymorphismSchema[] tupleItemsSchema0 = default(MsgPack.Serialization.PolymorphismSchema[]);
     tupleItemsSchema0 = new MsgPack.Serialization.PolymorphismSchema[7];
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema0 = default(MsgPack.Serialization.PolymorphismSchema);
     System.Collections.Generic.Dictionary <byte, System.Type> tupleItemSchemaTypeMap0 = default(System.Collections.Generic.Dictionary <byte, System.Type>);
     tupleItemSchemaTypeMap0 = new System.Collections.Generic.Dictionary <byte, System.Type>(2);
     tupleItemSchemaTypeMap0.Add(1, typeof(MsgPack.Serialization.DirectoryEntry));
     tupleItemSchemaTypeMap0.Add(0, typeof(MsgPack.Serialization.FileEntry));
     tupleItemSchema0     = MsgPack.Serialization.PolymorphismSchema.ForPolymorphicObject(typeof(MsgPack.Serialization.FileSystemEntry), tupleItemSchemaTypeMap0);
     tupleItemsSchema0[0] = tupleItemSchema0;
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema1 = default(MsgPack.Serialization.PolymorphismSchema);
     tupleItemSchema1     = null;
     tupleItemsSchema0[1] = tupleItemSchema1;
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema2 = default(MsgPack.Serialization.PolymorphismSchema);
     tupleItemSchema2     = null;
     tupleItemsSchema0[2] = tupleItemSchema2;
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema3 = default(MsgPack.Serialization.PolymorphismSchema);
     tupleItemSchema3     = null;
     tupleItemsSchema0[3] = tupleItemSchema3;
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema4 = default(MsgPack.Serialization.PolymorphismSchema);
     tupleItemSchema4     = null;
     tupleItemsSchema0[4] = tupleItemSchema4;
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema5 = default(MsgPack.Serialization.PolymorphismSchema);
     tupleItemSchema5     = null;
     tupleItemsSchema0[5] = tupleItemSchema5;
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema6 = default(MsgPack.Serialization.PolymorphismSchema);
     tupleItemSchema6     = null;
     tupleItemsSchema0[6] = tupleItemSchema6;
     schema0           = MsgPack.Serialization.PolymorphismSchema.ForPolymorphicTuple(typeof(System.Tuple <MsgPack.Serialization.FileSystemEntry, string, string, string, string, string, string>), tupleItemsSchema0);
     this._serializer0 = context.GetSerializer <string>(schema0);
     MsgPack.Serialization.PolymorphismSchema   schema1           = default(MsgPack.Serialization.PolymorphismSchema);
     MsgPack.Serialization.PolymorphismSchema[] tupleItemsSchema1 = default(MsgPack.Serialization.PolymorphismSchema[]);
     tupleItemsSchema1 = new MsgPack.Serialization.PolymorphismSchema[7];
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema7 = default(MsgPack.Serialization.PolymorphismSchema);
     System.Collections.Generic.Dictionary <byte, System.Type> tupleItemSchema7TypeMap0 = default(System.Collections.Generic.Dictionary <byte, System.Type>);
     tupleItemSchema7TypeMap0 = new System.Collections.Generic.Dictionary <byte, System.Type>(2);
     tupleItemSchema7TypeMap0.Add(1, typeof(MsgPack.Serialization.DirectoryEntry));
     tupleItemSchema7TypeMap0.Add(0, typeof(MsgPack.Serialization.FileEntry));
     tupleItemSchema7     = MsgPack.Serialization.PolymorphismSchema.ForPolymorphicObject(typeof(MsgPack.Serialization.FileSystemEntry), tupleItemSchema7TypeMap0);
     tupleItemsSchema1[0] = tupleItemSchema7;
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema8 = default(MsgPack.Serialization.PolymorphismSchema);
     tupleItemSchema8     = null;
     tupleItemsSchema1[1] = tupleItemSchema8;
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema9 = default(MsgPack.Serialization.PolymorphismSchema);
     tupleItemSchema9     = null;
     tupleItemsSchema1[2] = tupleItemSchema9;
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema10 = default(MsgPack.Serialization.PolymorphismSchema);
     tupleItemSchema10    = null;
     tupleItemsSchema1[3] = tupleItemSchema10;
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema11 = default(MsgPack.Serialization.PolymorphismSchema);
     tupleItemSchema11    = null;
     tupleItemsSchema1[4] = tupleItemSchema11;
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema12 = default(MsgPack.Serialization.PolymorphismSchema);
     tupleItemSchema12    = null;
     tupleItemsSchema1[5] = tupleItemSchema12;
     MsgPack.Serialization.PolymorphismSchema tupleItemSchema13 = default(MsgPack.Serialization.PolymorphismSchema);
     tupleItemSchema13    = null;
     tupleItemsSchema1[6] = tupleItemSchema13;
     schema1           = MsgPack.Serialization.PolymorphismSchema.ForPolymorphicTuple(typeof(System.Tuple <MsgPack.Serialization.FileSystemEntry, string, string, string, string, string, string>), tupleItemsSchema1);
     this._serializer1 = context.GetSerializer <System.Tuple <MsgPack.Serialization.FileSystemEntry, string, string, string, string, string, string> >(schema1);
     this._methodBasePolymorphicMemberTypeKnownType_Tuple_Tuple7FirstPolymorphicPrivateSetterPropertyAndConstructor_set_Tuple7FirstPolymorphic0 = typeof(MsgPack.Serialization.PolymorphicMemberTypeKnownType_Tuple_Tuple7FirstPolymorphicPrivateSetterPropertyAndConstructor).GetMethod("set_Tuple7FirstPolymorphic", (System.Reflection.BindingFlags.Instance
                                                                                                                                                                                                                                                                                                                        | (System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)), null, new System.Type[] {
         typeof(System.Tuple <MsgPack.Serialization.FileSystemEntry, string, string, string, string, string, string>)
     }, null);
 }
Пример #22
0
 /// <summary>
 /// Tests to see if this rule applies to the given member.
 /// </summary>
 /// <remarks>
 /// This type is available to support the configuration subsystem. Use
 /// <see cref="Microsoft.Practices.Unity.InterceptionExtension.CustomAttributeMatchingRule"/> instead.
 /// </remarks>
 public bool Matches(System.Reflection.MethodBase member)
 {
     throw new System.InvalidOperationException(Resources.PlaceholderRule);
 }
Пример #23
0
 public static string GetPropertyName(this System.Reflection.MethodBase methodBase)
 {
     return(methodBase.Name.Substring(4));
 }
Пример #24
0
        /// <summary>
        /// This method will be used to log exceptions
        /// </summary>
        /// <param name="eGlobalErr">Global Error thrown by Custom Code</param>
        /// <param name="priorityLevel">Priority Level of the Error Low,Medium,High,Critical</param>
        /// <param name="inputFriendlyMessage">Needed if the message is a customized error message thrown from a plugin or custom step</param>
        /// <param name="service">Organization Service</param>
        /// <returns>Returns the friendly message to be shown to the user</returns>
        public static void LogException(Exception eGlobalErr, PriorityLevel priorityLevel, string inputFriendlyMessage, IOrganizationService service)
        {
            string result = string.Empty;

            try
            {
                string methodName     = string.Empty;
                string errMessage     = string.Empty;
                string innerException = string.Empty;

                try
                {
                    // Load information about the calling function
                    System.Diagnostics.StackFrame sf = new System.Diagnostics.StackFrame(1);
                    System.Reflection.MethodBase  mb = sf.GetMethod();
                    //string assemblyName = mb.DeclaringType.Assembly.GetName().Name;
                    methodName = mb.DeclaringType.Name + "." + mb.Name + "()";

                    throw eGlobalErr;
                }
                catch (System.Web.Services.Protocols.SoapException err)
                {
                    errMessage     = err.Message;
                    innerException = err.Detail.InnerXml;
                }
                catch (System.Data.SqlClient.SqlException err)
                {
                    errMessage = err.Message;
                    if (err.InnerException != null)
                    {
                        innerException = err.InnerException.Message;
                    }
                }
                catch (System.IO.IOException err)
                {
                    errMessage = err.Message;
                    if (err.InnerException != null)
                    {
                        innerException = err.InnerException.Message;
                    }
                }
                catch (Exception err)
                {
                    errMessage = err.Message;
                    if (err.InnerException != null)
                    {
                        innerException = err.InnerException.Message;
                    }
                }
                //set log exception request
                Entity logExceptionRequest = new Entity("e4d_exception");
                logExceptionRequest["e4d_name"]       = errMessage.Substring(0, 100);
                logExceptionRequest["e4d_message"]    = errMessage;
                logExceptionRequest["e4d_priority"]   = new OptionSetValue((int)priorityLevel);
                logExceptionRequest["e4d_stacktrace"] = eGlobalErr.StackTrace;
                logExceptionRequest["e4d_method"]     = methodName;
                logExceptionRequest["e4d_type"]       = new OptionSetValue(1);
                if (!string.IsNullOrEmpty(inputFriendlyMessage))
                {
                    logExceptionRequest["e4d_friendlymessage"] = inputFriendlyMessage;
                }
                else
                {
                    logExceptionRequest["e4d_friendlymessage"] = "Default";
                }
                logExceptionRequest["e4d_innerexception"] = innerException;
                service.Create(logExceptionRequest);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #25
0
 public abstract void RegisterFunction(string functionName, object target, System.Reflection.MethodBase function);
Пример #26
0
 // Max 2 calls from  original caller !
 private string debugInfo()
 {
     System.Diagnostics.StackFrame sf = new System.Diagnostics.StackFrame(2, true);
     System.Reflection.MethodBase  mb = sf.GetMethod();
     return(string.Concat(mb.DeclaringType.Name, ":", mb.Name));
 }
Пример #27
0
 internal static void NotImplemented(System.Reflection.MethodBase method, object details = null)
 {
     System.Diagnostics.Debug.WriteLine("Not Implemented: " + method.ReflectedType.Name + "." + method.Name + (details == null ? String.Empty : " (" + details.ToString() + ")"));
 }
Пример #28
0
 public override void RuntimeInitialize(System.Reflection.MethodBase method)
 {
     base.RuntimeInitialize(method);
     this.argumentService = new TraceArgumentService();
     this.traceService    = new TraceService();
 }
Пример #29
0
 /// <summary>
 /// Outputs an instruction and a method to the log.
 /// </summary>
 /// <param name="instruction"> The instruction to output. </param>
 /// <param name="method"> The method to output. </param>
 private void Log(string instruction, System.Reflection.MethodBase method)
 {
     LogInstruction(instruction, string.Format("{0}/{1}", method, method.DeclaringType));
 }
Пример #30
0
 public void SetInfo(ICLRtypeProvider provider)
 {
     Debug.Assert(m_infoMethod == null);
     m_infoMethod = provider.CreateCLRMethod(this);
 }
Пример #31
0
 /// <summary>
 /// Pops the method arguments off the stack, calls the given method, then pushes the result
 /// to the stack (if there was one).  This operation can be used to call instance methods,
 /// but virtual overrides will not be called and a null check will not be performed at the
 /// callsite.
 /// </summary>
 /// <param name="method"> The method to call. </param>
 public override void CallStatic(System.Reflection.MethodBase method)
 {
     Log("call", method);
     this.generator.CallStatic(method);
 }
Пример #32
0
 private uint GetArgumentStartOffset(MethodBase aMethod, int aArgument)
 {
     return 0;
 }
Пример #33
0
        IILReader CreateReader(System.Reflection.MethodBase methodBase)
        {
            var cfg = ILReader.Configuration.Resolve(methodBase);

            return(cfg.GetReader(methodBase));
        }