public static MongoInfoFactory Create(uint id, int type)
 {
     var factory = new MongoInfoFactory();
     if (type == (int)MongoTreeNodeType.Server)
     {
         factory.MongoInfo = new MongoServerInfo(id);
     }
     else if (type == (int)MongoTreeNodeType.Database)
     {
         factory.MongoInfo = new MongoDatabaseInfo(id);
     }
     else if (type == (int)MongoTreeNodeType.Collection)
     {
         factory.MongoInfo = new MongoCollectionInfo(id);
     }
     return factory;
 }
예제 #2
0
        public static MongoInfoFactory Create(uint id, int type)
        {
            var factory = new MongoInfoFactory();

            if (type == (int)MongoTreeNodeType.Server)
            {
                factory.MongoInfo = new MongoServerInfo(id);
            }
            else if (type == (int)MongoTreeNodeType.Database)
            {
                factory.MongoInfo = new MongoDatabaseInfo(id);
            }
            else if (type == (int)MongoTreeNodeType.Collection)
            {
                factory.MongoInfo = new MongoCollectionInfo(id);
            }
            return(factory);
        }