Ejemplo n.º 1
0
        public DatabaseNode(HostNode owner, GroupedConnection groupedConnection, IManagementActionsController managementActionsController, IExplicitConnectionCache explicitConnectionCache, IImplicitConnectionCache implicitConnectionCache, DispatcherScheduler dispatcherScheduler)
        {
            Owner = owner;
            ReadOnlyObservableCollection <CollectionNode> nodes;

            _disposable = explicitConnectionCache.BuildChildNodes(
                implicitConnectionCache,
                groupedConnection.Key,
                GroupedConnectionKeyLevel.CollectionId,
                groupedCn =>
                new CollectionNode(this, groupedCn[GroupedConnectionKeyLevel.CollectionId], managementActionsController),
                CollectionSortComparer,
                dispatcherScheduler,
                out nodes);
            Collections = nodes;

            DatabaseId = groupedConnection[GroupedConnectionKeyLevel.DatabaseId];

            CreateCollectionCommand = new Command(_ => managementActionsController.AddCollection(this));
            DeleteDatabaseCommand   = new Command(_ => managementActionsController.DeleteDatabase(this));
        }
Ejemplo n.º 2
0
 public async Task <ManagementActionAddResult> AddDatabase(HostNode host)
 {
     return(await AddDatabase(host.Host, host.AuthorisationKey));
 }