Esempio n. 1
0
 public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
 {
     if (context != null)
     {
         AppSettingsExpressionEditor.AppSettingsExpressionEditorSheet instance = (AppSettingsExpressionEditor.AppSettingsExpressionEditorSheet)context.Instance;
         KeyValueConfigurationCollection appSettings = instance._owner.GetAppSettings(instance.ServiceProvider);
         if (appSettings != null)
         {
             return(appSettings.Count > 0);
         }
     }
     return(base.GetStandardValuesSupported(context));
 }
Esempio n. 2
0
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (context != null)
     {
         AppSettingsExpressionEditor.AppSettingsExpressionEditorSheet instance = (AppSettingsExpressionEditor.AppSettingsExpressionEditorSheet)context.Instance;
         KeyValueConfigurationCollection appSettings = instance._owner.GetAppSettings(instance.ServiceProvider);
         if (appSettings != null)
         {
             ArrayList values = new ArrayList(appSettings.AllKeys);
             values.Sort();
             values.Add(string.Empty);
             return(new TypeConverter.StandardValuesCollection(values));
         }
     }
     return(base.GetStandardValues(context));
 }