System.Runtime.Remoting.InternalRemotingServices.GetReflectionCachedData C# (CSharp) Method

GetReflectionCachedData() static private method

static private GetReflectionCachedData ( MemberInfo mi ) : RemotingCachedData
mi MemberInfo
return RemotingCachedData
        internal static RemotingCachedData GetReflectionCachedData(MemberInfo mi)
        {
            RemotingCachedData cache = null;
            cache = (RemotingCachedData)mi.Cache[CacheObjType.RemotingData];
            if (cache == null)
            {
                if (mi is MethodBase)
                    cache = new RemotingMethodCachedData(mi);
                else
                    if (mi is Type)
                        cache = new RemotingTypeCachedData(mi);
                    else
                        cache = new RemotingCachedData(mi);

                mi.Cache[CacheObjType.RemotingData] = cache;
            }
            return cache;
        }// GetCachedRemotingAttribute

Same methods

InternalRemotingServices::GetReflectionCachedData ( ParameterInfo reflectionObject ) : RemotingCachedData
InternalRemotingServices::GetReflectionCachedData ( MethodBase mi ) : RemotingMethodCachedData
InternalRemotingServices::GetReflectionCachedData ( Type mi ) : RemotingTypeCachedData

Usage Example

Esempio n. 1
0
        internal static RemotingCachedData GetReflectionCachedData(MemberInfo mi)
        {
            MethodBase mi1;

            if ((mi1 = mi as MethodBase) != (MethodBase)null)
            {
                return((RemotingCachedData)InternalRemotingServices.GetReflectionCachedData(mi1));
            }
            RuntimeType type;

            if ((type = mi as RuntimeType) != (RuntimeType)null)
            {
                return((RemotingCachedData)InternalRemotingServices.GetReflectionCachedData(type));
            }
            RuntimeFieldInfo runtimeFieldInfo;

            if ((FieldInfo)(runtimeFieldInfo = mi as RuntimeFieldInfo) != (FieldInfo)null)
            {
                return((RemotingCachedData)runtimeFieldInfo.RemotingCache);
            }
            SerializationFieldInfo serializationFieldInfo;

            if ((FieldInfo)(serializationFieldInfo = mi as SerializationFieldInfo) != (FieldInfo)null)
            {
                return((RemotingCachedData)serializationFieldInfo.RemotingCache);
            }
            throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeReflectionObject"));
        }
All Usage Examples Of System.Runtime.Remoting.InternalRemotingServices::GetReflectionCachedData