示例#1
0
        async public Task <IExplorerObject> CreateInstanceByFullName(string FullName, ISerializableExplorerObjectCache cache)
        {
            if (cache.Contains(FullName))
            {
                return(cache[FullName]);
            }

            TileCacheGroupExplorerObject group = new TileCacheGroupExplorerObject();

            if (FullName.IndexOf(group.FullName) != 0 || FullName.Length < group.FullName.Length + 2)
            {
                return(null);
            }

            group = (TileCacheGroupExplorerObject)((cache.Contains(group.FullName)) ? cache[group.FullName] : group);

            var childObjects = await group.ChildObjects();

            if (childObjects != null)
            {
                foreach (IExplorerObject exObject in childObjects)
                {
                    if (exObject.FullName == FullName)
                    {
                        cache.Append(exObject);
                        return(exObject);
                    }
                }
            }

            return(null);
        }
示例#2
0
        public IExplorerObject CreateInstanceByFullName(string FullName, ISerializableExplorerObjectCache cache)
        {
            if (cache.Contains(FullName))
            {
                return(cache[FullName]);
            }

            if (this.FullName == FullName)
            {
                TileCacheGroupExplorerObject exObject = new TileCacheGroupExplorerObject();
                cache.Append(exObject);
                return(exObject);
            }

            return(null);
        }