Пример #1
0
            private async void btnDeactivate_Click(object sender, EventArgs e)
            {
                if (!this.IsLoggedOn)
                {
                    MessageBox.Show("You have to be logged on in order to deactivate the device.");
                    return;
                }

                this.DisableUI();
                try
                {
                    IStoreOperationsManager storeOperationsManager = this.currentManagerFactory.GetManager <IStoreOperationsManager>();
                    await storeOperationsManager.DeactivateDevice("testDevice.DeviceId");

                    this.appStorage.Remove(this.currentDeviceActivationInfo);
                    this.currentDeviceActivationInfo = null;
                    this.Log("Deactivation succeeded.");
                }
                catch (Exception ex)
                {
                    this.Log(ex.ToString());
                }
                finally
                {
                    this.RefreshActivationStorageInformation();
                    this.RefreshLogOnInformation();
                    this.RefreshUI();
                    this.btnLogOff_Click(sender, e);
                }
            }