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

            MongoDbGroupObject group = new MongoDbGroupObject();

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

            group = (MongoDbGroupObject)((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)
            {
                MongoDbGroupObject exObject = new MongoDbGroupObject();
                cache.Append(exObject);
                return(Task.FromResult <IExplorerObject>(exObject));
            }

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