Ejemplo n.º 1
0
 public void RemoveConnectionItem(ConnectionItemViewModel connectionItem)
 {
     if (this.ConnectionItem == connectionItem)
     {
         this.ConnectionItem = null;
     }
     this.ConnectionItems.Remove(connectionItem);
 }
 public void Assign(ConnectionItemViewModel connectionInfo)
 {
     this.name                  = connectionInfo.name;
     this.address               = connectionInfo.address;
     this.dataBaseName          = connectionInfo.dataBaseName;
     this.userID                = connectionInfo.userID;
     this.password              = connectionInfo.password;
     this.themeColor            = connectionInfo.themeColor;
     this.theme                 = connectionInfo.theme;
     this.IsDefault             = connectionInfo.IsDefault;
     this.LastConnectedDateTime = connectionInfo.LastConnectedDateTime;
     this.Refresh();
     this.RefreshIsCurrentThemeProperty();
 }
Ejemplo n.º 3
0
        public async void EditConnectionItem(ConnectionItemViewModel connectionItem)
        {
            var dialog = new ConnectionItemEditViewModel(this, connectionItem.Clone());

            if (await dialog.ShowDialogAsync() == true)
            {
                connectionItem.Assign(dialog.ConnectionInfo);
                this.ConnectionItems.Write();
                if (this.ConnectionItem == connectionItem)
                {
                    FirstFloor.ModernUI.Presentation.AppearanceManager.Current.AccentColor = connectionItem.ThemeColor;
                    FirstFloor.ModernUI.Presentation.AppearanceManager.Current.ThemeSource = Themes[connectionItem.Theme];
                    this.SetPassword(this.ConnectionItem.Password, true);
                }
            }
        }