예제 #1
0
 public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
 {
     if (context != null)
     {
         ConnectionStringsExpressionEditor.ConnectionStringsExpressionEditorSheet instance = (ConnectionStringsExpressionEditor.ConnectionStringsExpressionEditorSheet)context.Instance;
         ConnectionStringSettingsCollection connectionStringSettingsCollection             = instance._owner.GetConnectionStringSettingsCollection(instance.ServiceProvider);
         if (connectionStringSettingsCollection != null)
         {
             return(connectionStringSettingsCollection.Count > 0);
         }
     }
     return(base.GetStandardValuesSupported(context));
 }
예제 #2
0
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (context != null)
     {
         ConnectionStringsExpressionEditor.ConnectionStringsExpressionEditorSheet instance = (ConnectionStringsExpressionEditor.ConnectionStringsExpressionEditorSheet)context.Instance;
         ConnectionStringSettingsCollection connectionStringSettingsCollection             = instance._owner.GetConnectionStringSettingsCollection(instance.ServiceProvider);
         if (connectionStringSettingsCollection != null)
         {
             ArrayList values = new ArrayList();
             foreach (ConnectionStringSettings settings in connectionStringSettingsCollection)
             {
                 values.Add(settings.Name);
             }
             values.Sort();
             values.Add(string.Empty);
             return(new TypeConverter.StandardValuesCollection(values));
         }
     }
     return(base.GetStandardValues(context));
 }