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

            CosmoDbGroupObject group = new CosmoDbGroupObject();

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

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

            foreach (IExplorerObject exObject in await group.ChildObjects())
            {
                if (exObject.FullName == FullName)
                {
                    cache.Append(exObject);
                    return(exObject);
                }
            }
            return(null);
        }
Example #2
0
        public Task <IExplorerObject> CreateInstanceByFullName(string FullName, ISerializableExplorerObjectCache cache)
        {
            if (cache.Contains(FullName))
            {
                return(Task.FromResult <IExplorerObject>(cache[FullName]));
            }

            if (this.FullName == FullName)
            {
                CosmoDbGroupObject exObject = new CosmoDbGroupObject();
                cache.Append(exObject);
                return(Task.FromResult <IExplorerObject>(exObject));
            }

            return(Task.FromResult <IExplorerObject>(null));
        }