/// <summary> /// Constructs a panel /// </summary> /// <param name="wizard">The connecting wizard</param> /// <param name="instance_source_type">Instance source type</param> public ConnectingRefreshableProfileListSelectPanel(ConnectWizard wizard, InstanceSourceType instance_source_type) : base(wizard, instance_source_type) { // Trigger initial load. OnPropertyChanged(this, new PropertyChangedEventArgs(nameof(SelectedInstance))); // Register to receive property change events and reload the profile list. PropertyChanged += OnPropertyChanged; }
public static string GetLocalizableName(this InstanceSourceType value) { switch (value) { case InstanceSourceType.SecureInternet: return(Resources.Strings.InstanceSourceTypeSecureInternet); case InstanceSourceType.InstituteAccess: return(Resources.Strings.InstanceSourceTypeInstituteAccess); default: return(Enum.GetName(typeof(InstanceSourceType), value)); } }
/// <summary> /// Constructs a panel /// </summary> /// <param name="wizard">The connecting wizard</param> /// <param name="instance_source_type">Instance source type</param> public ConnectingSelectPanel(ConnectWizard wizard, InstanceSourceType instance_source_type) : base(wizard) { InstanceSourceType = instance_source_type; PropertyChanged += (object sender, PropertyChangedEventArgs e) => { if (e.PropertyName == nameof(SelectedInstance)) { RaisePropertyChanged(nameof(ForgetSelectedInstanceLabel)); } else if (e.PropertyName == nameof(SelectedProfile)) { RaisePropertyChanged(nameof(ForgetSelectedProfileLabel)); } }; }
/// <summary> /// Constructs a panel /// </summary> /// <param name="wizard">The connecting wizard</param> /// <param name="instance_source_type">Instance source type</param> public ConnectingRefreshableProfileSelectPanel(ConnectWizard wizard, InstanceSourceType instance_source_type) : base(wizard, instance_source_type) { PropertyChanged += (object sender, PropertyChangedEventArgs e) => { if (e.PropertyName == nameof(ProfileList) && ProfileList != null && ProfileList.Count == 1 && Wizard.Error == null) { // The profile list has been loaded with exactly one profile available. // And there is no error condition to report. // Therefore, auto-select the profile and connect! SelectedProfile = ProfileList[0]; if (ConnectSelectedProfile.CanExecute()) { ConnectSelectedProfile.Execute(); } } }; }
/// <summary> /// Constructs a panel /// </summary> /// <param name="wizard">The connecting wizard</param> /// <param name="instance_source_type">Instance source type</param> public ConnectingInstanceAndProfileSelectPanel(ConnectWizard wizard, InstanceSourceType instance_source_type) : base(wizard, instance_source_type) { }