Beispiel #1
0
        }// GetCachedRemotingAttribute
 
        internal static RemotingCachedData GetReflectionCachedData(RuntimeParameterInfo reflectionObject) 
        {
            RemotingCachedData cache = null; 
            cache = (RemotingCachedData)reflectionObject.RemotingCache[CacheObjType.RemotingData];
            if (cache == null)
            {
                cache = new RemotingCachedData(reflectionObject); 
                reflectionObject.RemotingCache[CacheObjType.RemotingData] = cache;
            } 
 
            return cache;
        } // GetCachedRemotingAttribute 
Beispiel #2
0
        }// GetCachedRemotingAttribute
 
        internal static RemotingCachedData GetReflectionCachedData(MemberInfo mi) 
        {
            RemotingCachedData cache = null; 

            MethodBase mb = null;
            RuntimeType rt = null;
            RuntimeFieldInfo rfi = null; 
            RuntimeEventInfo rei = null;
            RuntimePropertyInfo rpi = null; 
            SerializationFieldInfo sfi = null; 

            if ((mb = mi as MethodBase) != null) 
                return GetReflectionCachedData(mb);
            else if ((rt = mi as RuntimeType) != null)
                return GetReflectionCachedData(rt);
            else if ((rfi = mi as RuntimeFieldInfo) != null) 
            {
                cache = (RemotingCachedData)rfi.RemotingCache[CacheObjType.RemotingData]; 
                if (cache == null) 
                    rfi.RemotingCache[CacheObjType.RemotingData] = cache = new RemotingCachedData(rfi);
            } 
            else if ((rei = mi as RuntimeEventInfo) != null)
            {
                cache = (RemotingCachedData)rei.RemotingCache[CacheObjType.RemotingData];
                if (cache == null) 
                    rei.RemotingCache[CacheObjType.RemotingData] = cache = new RemotingCachedData(rei);
            } 
            else if ((rpi = mi as RuntimePropertyInfo) != null) 
            {
                cache = (RemotingCachedData)rpi.RemotingCache[CacheObjType.RemotingData]; 
                if (cache == null)
                    rpi.RemotingCache[CacheObjType.RemotingData] = cache = new RemotingCachedData(rpi);
            }
            else if ((sfi = mi as SerializationFieldInfo) != null) 
            {
                cache = (RemotingCachedData)sfi.RemotingCache[CacheObjType.RemotingData]; 
                if (cache == null) 
                    sfi.RemotingCache[CacheObjType.RemotingData] = cache = new RemotingCachedData(sfi);
            } 
            else
                throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeReflectionObject"));

            return cache; 
        }// GetCachedRemotingAttribute
 internal static RemotingCachedData GetReflectionCachedData(MemberInfo mi)
 {
     RemotingCachedData data = null;
     MethodBase base2 = null;
     RuntimeType type = null;
     RuntimeFieldInfo ri = null;
     RuntimeEventInfo info2 = null;
     RuntimePropertyInfo info3 = null;
     SerializationFieldInfo info4 = null;
     base2 = mi as MethodBase;
     if (base2 != null)
     {
         return GetReflectionCachedData(base2);
     }
     type = mi as RuntimeType;
     if (type != null)
     {
         return GetReflectionCachedData(type);
     }
     ri = mi as RuntimeFieldInfo;
     if (ri != null)
     {
         data = (RemotingCachedData) ri.RemotingCache[CacheObjType.RemotingData];
         if (data == null)
         {
             ri.RemotingCache[CacheObjType.RemotingData] = data = new RemotingCachedData(ri);
         }
         return data;
     }
     info2 = mi as RuntimeEventInfo;
     if (info2 != null)
     {
         data = (RemotingCachedData) info2.RemotingCache[CacheObjType.RemotingData];
         if (data == null)
         {
             info2.RemotingCache[CacheObjType.RemotingData] = data = new RemotingCachedData(info2);
         }
         return data;
     }
     info3 = mi as RuntimePropertyInfo;
     if (info3 != null)
     {
         data = (RemotingCachedData) info3.RemotingCache[CacheObjType.RemotingData];
         if (data == null)
         {
             info3.RemotingCache[CacheObjType.RemotingData] = data = new RemotingCachedData(info3);
         }
         return data;
     }
     info4 = mi as SerializationFieldInfo;
     if (info4 == null)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeReflectionObject"));
     }
     data = (RemotingCachedData) info4.RemotingCache[CacheObjType.RemotingData];
     if (data == null)
     {
         info4.RemotingCache[CacheObjType.RemotingData] = data = new RemotingCachedData(info4);
     }
     return data;
 }
        }// GetCachedRemotingAttribute
        
        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
 internal static RemotingCachedData GetReflectionCachedData(RuntimeParameterInfo reflectionObject)
 {
     RemotingCachedData data = null;
     data = (RemotingCachedData) reflectionObject.RemotingCache[CacheObjType.RemotingData];
     if (data == null)
     {
         data = new RemotingCachedData(reflectionObject);
         reflectionObject.RemotingCache[CacheObjType.RemotingData] = data;
     }
     return data;
 }