public override Target this[string id]
        {
            get
            {
                Target target = null;
                if (_plusTree == null)
                {
                    return(target);
                }
                if (_targetCache != null)
                {
                    target = _targetCache[id];
                    if (target != null)
                    {
                        return(target);
                    }
                }

                if (_plusTree.ContainsKey(id))
                {
                    target = (Target)_plusTree[id];
                    if (target != null && _targetCache != null)
                    {
                        _targetCache.Add(target);
                    }
                }

                return(target);
            }
        }
Example #2
0
        public override Target this[string id]
        {
            get
            {
                Target target = null;
                if (_plusTree == null)
                {
                    return(target);
                }
                if (_quickStorage != null)
                {
                    target = _quickStorage[id];
                    if (target != null)
                    {
                        return(target);
                    }
                }
                if (_targetCache != null)
                {
                    target = _targetCache[id];
                    if (target != null)
                    {
                        return(target);
                    }
                }

                if (_plusTree.ContainsKey(id))
                {
                    target = TargetsReader.Read(_plusTree[id]);
                    if (target != null && _targetCache != null)
                    {
                        _targetCache.Add(target);
                    }
                }

                return(target);
            }
        }