void InitArgs(Type objType)
 {
     if (objType == Globals.TypeOfDateTimeOffsetAdapter)
     {
         objLocal = DateTimeOffsetAdapter.GetDateTimeOffsetAdapter((DateTimeOffset)obj);
     }
     else
     {
         objLocal = CodeInterpreter.ConvertValue(obj, typeof(object), objType);
     }
 }
예제 #2
0
        private static object ResolveAdapterType(object obj, ClassDataContract classContract)
        {
            Type type = obj.GetType();

            if (type == Globals.TypeOfDateTimeOffset)
            {
                obj = DateTimeOffsetAdapter.GetDateTimeOffsetAdapter((DateTimeOffset)obj);
            }
            else if (type == Globals.TypeOfMemoryStream)
            {
                obj = MemoryStreamAdapter.GetMemoryStreamAdapter((MemoryStream)obj);
            }
            return(obj);
        }
예제 #3
0
        private object ResolveAdapterType(object obj, ClassDataContract classContract)
        {
            Type type = obj.GetType();

            if (type == Globals.TypeOfDateTimeOffset)
            {
                obj = DateTimeOffsetAdapter.GetDateTimeOffsetAdapter((DateTimeOffset)obj);
            }
            else if (type.IsGenericType && type.GetGenericTypeDefinition() == Globals.TypeOfKeyValuePair)
            {
                obj = classContract.KeyValuePairAdapterConstructorInfo.Invoke(new object[] { obj });
            }

            return(obj);
        }