コード例 #1
0
 private void AddCloud(ManageCloudsData cloud)
 {
     cloudsToRemove.Remove(cloud.ID);
     if (false == cloudData.Contains(cloud))
     {
         cloudData.Add(cloud);
     }
 }
コード例 #2
0
        private void worker_DoRegistrationWork(object sender, DoWorkEventArgs e)
        {
            ManageCloudsData selected = SelectedCloud;

            IsSelectedCloudAccountRegistered = selected.IsAccountRegistered = false;
            ProviderResponse <bool> result = provider.RegisterAccount(selected.ServerUrl, selected.Email, selected.Password);

            e.Result = result;
        }
コード例 #3
0
        private void worker_DoValidationWork(object sender, DoWorkEventArgs e)
        {
            var worker = (BackgroundWorker)sender;
            ManageCloudsData selected = SelectedCloud;

            IsSelectedCloudAccountValid = selected.IsAccountValid = false;
            ProviderResponse <bool> result = provider.ValidateAccount(selected.ServerUrl, selected.Email, selected.Password);

            e.Result = result;
        }
コード例 #4
0
        public ManageCloudsData AddCloud()
        {
            var newCloud = new ManageCloudsData(Guid.NewGuid())
            {
                ServerName = "New Server",
                ServerUrl  = "http://api.vcap.me",
                Email      = "*****@*****.**",
            };

            AddCloud(newCloud);
            return(newCloud);
        }
コード例 #5
0
        private void worker_RegistrationCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            var worker = (BackgroundWorker)sender;

            IsBusy = false;
            ManageCloudsData selected = SelectedCloud;
            var result = (ProviderResponse <bool>)e.Result;

            if (result.Response)
            {
                IsSelectedCloudAccountRegistered = selected.IsAccountRegistered = true;
            }
            else
            {
                IsSelectedCloudAccountRegistered = selected.IsAccountRegistered = false;
                ErrorMessage = result.Message;
            }
        }
コード例 #6
0
 public void AddDefaultCloud(ManageCloudsData cloud)
 {
     AddCloud(cloud);
 }