public override Task <bool> ExecuteInternal(object parameter)
        {
            var cred = new Views.Credentials("Storage account name:",
                                             "Storage account key:",
                                             "Connect to Storage account",
                                             Preferences.Instance.LoginName,
                                             Preferences.Instance.AuthKey);

            if (cred.ShowDialog() == true)
            {
                Vm.Login(cred.ShortField.Text, cred.LongField.Text);
                Preferences.Instance.LoginName = cred.ShortField.Text;
                Preferences.Instance.AuthKey   = cred.LongField.Text;
                return(True);
            }
            return(False);
        }
示例#2
0
        public override async Task <bool> ExecuteInternal(object parameter)
        {
            var b = Vm.CurrentBlob.Blob as CloudBlob;

            if (b != null)
            {
                var nameAndDetails = new Views.Credentials("Snapshot name", "Snapshot description", "Create snapshot");
                if (nameAndDetails.ShowDialog() == true)
                {
                    var snap     = b.Snapshot();
                    var snapHash = snap.GetTimeStampHash();
                    await((SetMetadataCommand)Vm.SetMetadataCommand).SetSnapshotDetails(snapHash, Vm.CurrentBlob, nameAndDetails);
                    Vm.CurrentBlob.SetActiveSnapshot(snapHash);
                    Vm.ReloadContainer();
                    return(true);
                }
                return(false);
            }
            else
            {
                throw new NotSupportedException("Blob type is not supported: " + Vm.CurrentBlob.Blob.GetType().FullName);
            }
        }