コード例 #1
0
        public async Task <Try <ICloudProxy> > CreateCloudConnectionAsync(IClientCredentials credentials)
        {
            Preconditions.CheckNotNull(credentials, nameof(credentials));

            ConnectedDevice        device             = this.CreateOrUpdateConnectedDevice(credentials.Identity);
            Try <ICloudConnection> newCloudConnection = await device.CreateOrUpdateCloudConnection(c => this.CreateOrUpdateCloudConnection(c, credentials));

            Events.NewCloudConnection(credentials.Identity, newCloudConnection);
            Try <ICloudProxy> cloudProxyTry = GetCloudProxyFromCloudConnection(newCloudConnection, credentials.Identity);

            return(cloudProxyTry);
        }