コード例 #1
0
 internal GalleryContext(string account, string workspace, SandboxCollection sandboxes,
     WorkspacesContextConnector workspaces, AppsContextConnector apps)
 {
     this.Account = account;
     this.Workspace = workspace;
     this.Sandboxes = sandboxes;
     this.workspaces = workspaces;
     this.apps = apps;
 }
コード例 #2
0
        protected static async Task<IGalleryContext> ConnectAsync(IExtendedWorkspacesClient extendedWorkspacesClient,
            Uri appsEndpoint, string authenticationToken, string account, string workspace, SandboxCollection sandboxes, 
            string serviceName, string[] excludePrefixes, CancellationToken cancellationToken)
        {
            workspace = workspace ?? DefaultWorkspace;
            excludePrefixes = excludePrefixes ?? EmptyStringArray;

            var workspacesContextConnector = new WorkspacesContextConnector(extendedWorkspacesClient, account, workspace,
                sandboxes, serviceName, excludePrefixes);

            var apps = await workspacesContextConnector.GetAppsAsync(cancellationToken).ConfigureAwait(false);

            var appsConnector = new AppsConnector(appsEndpoint, authenticationToken);
            var appsClient = new AppsClient(appsConnector);

            var sandboxesClient = new SandboxesClient(appsConnector);
            var appsContextConnector = new AppsContextConnector(appsClient, sandboxesClient, apps, sandboxes,
                serviceName, excludePrefixes);

            return new GalleryContext(account, workspace, sandboxes, workspacesContextConnector, appsContextConnector);
        }