Beispiel #1
0
        public bool StoreCacheInfo(object obj, SerializationInfo info)
        {
            Type t      = obj.GetType();
            var  objmap = _infoTypeCache[t] as Hashtable;

            if (objmap == null)
            {
                objmap            = new Hashtable();
                _infoTypeCache[t] = objmap;
            }
            var data = objmap[obj] as SerializationInfoCacheList;

            if (data == null)
            {
                data        = new SerializationInfoCacheList(info.MemberCount);
                objmap[obj] = data;
            }

            SerializationInfoEnumerator itr = info.GetEnumerator();

            while (itr.MoveNext())
            {
                data.Add(new SerializationInfoCache(itr.Name, itr.Value, itr.ObjectType));
            }

            return(true);
        }
Beispiel #2
0
        public bool StoreCacheInfo(object obj, SerializationInfo info)
        {
            Type t = obj.GetType();
            var objmap = this._infoTypeCache[t] as Hashtable;
            if (objmap == null)
            {
                objmap = new Hashtable();
                this._infoTypeCache[t] = objmap;
            }

            var data = objmap[obj] as SerializationInfoCacheList;
            if (data == null)
            {
                data = new SerializationInfoCacheList(info.MemberCount);
                objmap[obj] = data;
            }

            SerializationInfoEnumerator itr = info.GetEnumerator();
            while (itr.MoveNext())
            {
                data.Add(new SerializationInfoCache(itr.Name, itr.Value, itr.ObjectType));
            }

            return true;
        }