예제 #1
0
        public object this[string uri]
        {
            get
            {
                if (store != null)
                {
                    if (!String.IsNullOrEmpty(uri))
                    {
                        byte[] data = StringHelper.GetBytes(uri);

                        if (data != null)
                        {
                            long recordID = indices[data];

                            if (recordID != BadRecordID)
                            {
                                ICacheRecord record = store[recordID];

                                if (record != null)
                                {
                                    return(CacheHelper.Unpack(record.Data));
                                }
                            }
                        }
                    }
                }

                return(null);
            }
        }
예제 #2
0
        public object this[byte[] key]
        {
            get
            {
                if (store != null)
                {
                    long recordID = indices[key];

                    if (recordID != BadRecordID)
                    {
                        ICacheRecord record = store[recordID];

                        if (record != null)
                        {
                            return(CacheHelper.Unpack(record.Data));
                        }
                    }
                }

                return(null);
            }
        }