Ejemplo n.º 1
0
        /// <summary>
        /// Trägt zusätzliche Konfigurationsoptionen in die Liste aller Konfigurationseinträge ein.
        /// </summary>
        public override void FillOptions()
        {
            // Request all
            var profiles = VCRNETRestProxy.GetProfilesSync(EndPoint).Select(profile => profile.name).ToArray();

            // Process all
            foreach (var profile in profiles)
            {
                // Format to use
                string format = Properties.Resources.OptionProfile;

                // See if this is active
                if (string.IsNullOrEmpty(Profile) && ProfileManager.ProfileNameComparer.Equals(profiles[0], profile))
                {
                    format = Properties.Resources.OptionProfileActive;
                }
                else if (ProfileManager.ProfileNameComparer.Equals(Profile, profile))
                {
                    format = Properties.Resources.OptionProfileActive;
                }
                else
                {
                    format = Properties.Resources.OptionProfile;
                }

                // Register - Clone() is important since anonymous delegate would bind profile to the last iteration value for ALL items
                Parent.AddOption(new OptionDisplay(string.Format(format, profile), () => ChangeProfile(profile)));
            }

            // Forward
            m_CurrentConnector.FillOptions();
        }