예제 #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            if (this.values == null)
            {
                this.values = new TypeConverter.StandardValuesCollection(new string[] { 
                    "AbsoluteLayout", 
                    "AccordionLayout", 
                    "AnchorLayout", 
                    "BorderLayout", 
                    "BoxLayout", 
                    "CardLayout", 
                    "ColumnLayout", 
                    "ContainerLayout", 
                    "FitLayout", 
                    "FormLayout", 
                    "HBoxLayout", 
                    "MenuLayout",
                    "RowLayout",
                    "TableLayout", 
                    "ToolbarLayout", 
                    "VBoxLayout" 
                });
            }

            return this.values;
        }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     PerformanceCounter counter = (context == null) ? null : (context.Instance as PerformanceCounter);
     string machineName = ".";
     if (counter != null)
     {
         machineName = counter.MachineName;
     }
     if (machineName != this.previousMachineName)
     {
         this.previousMachineName = machineName;
         try
         {
             PerformanceCounter.CloseSharedResources();
             PerformanceCounterCategory[] categories = PerformanceCounterCategory.GetCategories(machineName);
             string[] array = new string[categories.Length];
             for (int i = 0; i < categories.Length; i++)
             {
                 array[i] = categories[i].CategoryName;
             }
             Array.Sort(array, Comparer.Default);
             this.values = new TypeConverter.StandardValuesCollection(array);
         }
         catch (Exception)
         {
             this.values = null;
         }
     }
     return this.values;
 }
예제 #3
0
        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            ClassListAttrible lst = (ClassListAttrible)context.PropertyDescriptor.Attributes[typeof(ClassListAttrible)];
            StandardValuesCollection vals = new TypeConverter.StandardValuesCollection(lst.lists);

            return vals;
        }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     EventLog log = (context == null) ? null : (context.Instance as EventLog);
     string machineName = ".";
     if (log != null)
     {
         machineName = log.MachineName;
     }
     if ((this.values == null) || (machineName != this.oldMachineName))
     {
         try
         {
             EventLog[] eventLogs = EventLog.GetEventLogs(machineName);
             object[] values = new object[eventLogs.Length];
             for (int i = 0; i < values.Length; i++)
             {
                 values[i] = eventLogs[i].Log;
             }
             this.values = new TypeConverter.StandardValuesCollection(values);
             this.oldMachineName = machineName;
         }
         catch (Exception)
         {
         }
     }
     return this.values;
 }
		public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
		{
			INuGenCounter counter = (context == null) ? null : (context.Instance as INuGenCounter);

			String machineName = ".";

			if (context != null)
				machineName = counter.MachineName;

			if (machineName != _previousMachineName)
			{
				_previousMachineName = machineName;

				try
				{
					PerformanceCounter.CloseSharedResources();
					PerformanceCounterCategory[] categories = PerformanceCounterCategory.GetCategories(machineName);
					String[] categoryNames = new String[categories.Length];

					for (Int32 categoryIndex = 0; categoryIndex < categories.Length; categoryIndex++)
					{
						categoryNames[categoryIndex] = categories[categoryIndex].CategoryName;
					}

					Array.Sort(categoryNames, Comparer.Default);
					_previousStandardValues = new TypeConverter.StandardValuesCollection(categoryNames);
				}
				catch
				{
					_previousStandardValues = null;
				}
			}

			return _previousStandardValues;
		}
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (this.values == null)
     {
         this.values = new TypeConverter.StandardValuesCollection(targetValues);
     }
     return this.values;
 }
예제 #7
0
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (values == null)
     {
         values = new TypeConverter.StandardValuesCollection(fontArray);
     }
     return values;
 }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (values == null)
     {
         values = new TypeConverter.StandardValuesCollection(new object[] { true, false });
     }
     return values;
 }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (DirectoryEntryConverter.values == null)
     {
         object[] values = new object[1];
         DirectoryEntryConverter.values = new TypeConverter.StandardValuesCollection(values);
     }
     return DirectoryEntryConverter.values;
 }
예제 #10
0
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (this._standardValues == null)
     {
         object[] values = new object[] { BackgroundPosition.TopOrLeft, BackgroundPosition.Center, BackgroundPosition.BottomOrRight };
         this._standardValues = new TypeConverter.StandardValuesCollection(values);
     }
     return this._standardValues;
 }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (this._values == null)
     {
         object[] values = new object[] { 0 };
         this._values = new TypeConverter.StandardValuesCollection(values);
     }
     return this._values;
 }
 /// <summary>
 /// StandardValuesCollection method override
 /// </summary>
 /// <param name="context">ITypeDescriptorContext</param>
 /// <returns>TypeConverter.StandardValuesCollection</returns>
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (_standardValues == null)
     {
         ArrayList list1 = new ArrayList(3);
         list1.Add((bool?)true);
         list1.Add((bool?)false);
         list1.Add((bool?)null);
         _standardValues = new TypeConverter.StandardValuesCollection(list1.ToArray());
     }
     return _standardValues;
 }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (this.values == null)
     {
         object[] values = this.com2Enum.Values;
         if (values != null)
         {
             this.values = new TypeConverter.StandardValuesCollection(values);
         }
     }
     return this.values;
 }
 public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     TypeConverter.StandardValuesCollection standardValues;
     EnumStandardValuesAttribute item = (EnumStandardValuesAttribute)context.PropertyDescriptor.Attributes[typeof(EnumStandardValuesAttribute)];
     if (item == null)
     {
         standardValues = base.GetStandardValues(context);
     }
     else
     {
         standardValues = new TypeConverter.StandardValuesCollection(item.GetValues());
     }
     return standardValues;
 }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     SolutionItem solutionItem = ((SolutionItemIncrementSettings)context.Instance).SolutionItem;
     object[] array = this.CreateList(solutionItem);
     TypeConverter.StandardValuesCollection result;
     if (array != null)
     {
         result = new TypeConverter.StandardValuesCollection(array);
     }
     else
     {
         result = null;
     }
     return result;
 }
예제 #16
0
	GetStandardValues(ITypeDescriptorContext context)
		{
			if (svc == null)
			{
				
				ArrayList drives = new ArrayList();
				foreach (string drive in System.IO.Directory.GetLogicalDrives())
				{
					drives.Add(drive[0]);
					}
				svc = new TypeConverter.StandardValuesCollection(drives);
			}
	

			return svc;
		}
예제 #17
0
        public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            // Adds a "null" values to the standard values if supported and available
            //
            if (underlyingTypeConverter != null &&
                underlyingTypeConverter.GetStandardValuesSupported(context))
            {
                TypeConverter.StandardValuesCollection values = underlyingTypeConverter.GetStandardValues(context);
                if (values != null)
                {
                    ArrayList valuesWithNull = new ArrayList(values);
                    valuesWithNull.Add(null);
                    return(new TypeConverter.StandardValuesCollection(valuesWithNull));
                }
            }

            return(base.GetStandardValues(context));
        }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (this.values == null)
     {
         object[] objArray;
         if (this.types != null)
         {
             objArray = new object[this.types.Length];
             Array.Copy(this.types, objArray, this.types.Length);
         }
         else
         {
             objArray = null;
         }
         this.values = new TypeConverter.StandardValuesCollection(objArray);
     }
     return this.values;
 }
예제 #19
0
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (this.values == null)
     {
         object[] objArray;
         if (this.types != null)
         {
             objArray = new object[this.types.Length];
             Array.Copy(this.types, objArray, this.types.Length);
         }
         else
         {
             objArray = null;
         }
         this.values = new TypeConverter.StandardValuesCollection(objArray);
     }
     return(this.values);
 }
예제 #20
0
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (this.simpleTypeConverter != null)
     {
         TypeConverter.StandardValuesCollection standardValues = this.simpleTypeConverter.GetStandardValues(context);
         if (this.GetStandardValuesSupported(context) && (standardValues != null))
         {
             object[] values = new object[standardValues.Count + 1];
             int      num    = 0;
             values[num++] = null;
             foreach (object obj2 in standardValues)
             {
                 values[num++] = obj2;
             }
             return(new TypeConverter.StandardValuesCollection(values));
         }
     }
     return(base.GetStandardValues(context));
 }
예제 #21
0
        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            var conn_attr = context.
                PropertyDescriptor.Attributes[typeof(ConnectionListAttribute)];

            var list = new List<string>();
            StandardValuesCollection vals = new StandardValuesCollection(list);
            if ( conn_attr != null )
            {
                ConnectionListAttribute lst = (ConnectionListAttribute)conn_attr;

                foreach( var conn in DBGlobalService.CurrentProject.Connections)
                {
                    list.Add(conn.Name);
                }

                vals = new TypeConverter.StandardValuesCollection(list);
            }

            return vals;
        }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (this.values == null)
     {
         ArrayList list = new ArrayList();
         foreach (PropertyInfo info in this.GetProperties())
         {
             object[] index = null;
             list.Add(info.GetValue(null, index));
         }
         this.values = new TypeConverter.StandardValuesCollection(list.ToArray());
     }
     return this.values;
 }
예제 #23
0
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (values == null)
     {
         lock (ValuesLock)
         {
             if (values == null)
             {
                 ArrayList list = new ArrayList();
                 list.AddRange(Colors.Values);
                 list.AddRange(SystemColors.Values);
                 int count = list.Count;
                 for (int i = 0; i < (count - 1); i++)
                 {
                     for (int j = i + 1; j < count; j++)
                     {
                         if (list[i].Equals(list[j]))
                         {
                             list.RemoveAt(j);
                             count--;
                             j--;
                         }
                     }
                 }
                 list.Sort(0, list.Count, new ColorComparer());
                 values = new TypeConverter.StandardValuesCollection(list.ToArray());
             }
         }
     }
     return values;
 }
예제 #24
0
    /// <summary>
    /// Obtient la collection des valeurs standard : la liste des noms des fonts installées 
    /// </summary>
    /// <param name="context">contexte d'utilisation</param>
    /// <returns>la collection des noms des fonts installées</returns>
    public override TypeConverter.StandardValuesCollection GetStandardValues( ITypeDescriptorContext context ) {
      if ( standardValues == null ) {
        FontFamily[] families = FontFamily.Families;
        Hashtable hashtable = new Hashtable();
        for ( int i = 0 ; i < families.Length ; i++ ) {
          string name = families[ i ].Name;
          hashtable[ name.ToLower( System.Globalization.CultureInfo.InvariantCulture ) ] = name;
        }

        object[] array;
        if ( includeNoneAsStandardValue ) {
          array = new object[ hashtable.Values.Count + 1 ];
          array[ array.Length - 1 ] = string.Empty;
        }
        else
          array = new object[ hashtable.Values.Count ];

        hashtable.Values.CopyTo( array, 0 );
        Array.Sort( array, Comparer.Default );
        standardValues = new TypeConverter.StandardValuesCollection( array );
      }
      return standardValues;
    }
예제 #25
0
 /// <summary>
 /// Handler pour la prise en charge d'un changement dans les fonts installées.
 /// </summary>
 /// <param name="sender">émetteur de l'événement</param>
 /// <param name="e">descripteur de l'événement</param>
 private void OnInstalledFontsChanged( object sender, EventArgs e ) {
   standardValues = null;
 }
 public LanguageExtenders(IServiceProvider serviceProvider, CultureInfo[] supportedCultures)
 {
     this._serviceProvider = serviceProvider;
     this._host = serviceProvider.GetService(typeof(IDesignerHost)) as IDesignerHost;
     this._language = CultureInfo.InvariantCulture;
     if (supportedCultures != null)
     {
         this._supportedCultures = new TypeConverter.StandardValuesCollection(supportedCultures);
     }
 }
예제 #27
0
파일: Helpers.cs 프로젝트: tbener/DiGit
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (this.values == null)
     {
         ArrayList list = new ArrayList();
         foreach (object obj2 in this.KeyNames.Values)
         {
             list.Add(obj2);
         }
         list.Sort(this);
         this.values = new TypeConverter.StandardValuesCollection(list.ToArray());
     }
     return this.values;
 }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (this.values == null)
     {
         Type reflectionType = TypeDescriptor.GetReflectionType(this.type);
         if (reflectionType == null)
         {
             reflectionType = this.type;
         }
         FieldInfo[] fields = reflectionType.GetFields(BindingFlags.Public | BindingFlags.Static);
         ArrayList list = null;
         if ((fields != null) && (fields.Length > 0))
         {
             list = new ArrayList(fields.Length);
         }
         if (list != null)
         {
             foreach (FieldInfo info in fields)
             {
                 BrowsableAttribute attribute = null;
                 foreach (Attribute attribute2 in info.GetCustomAttributes(typeof(BrowsableAttribute), false))
                 {
                     attribute = attribute2 as BrowsableAttribute;
                 }
                 if ((attribute == null) || attribute.Browsable)
                 {
                     object obj2 = null;
                     try
                     {
                         if (info.Name != null)
                         {
                             obj2 = Enum.Parse(this.type, info.Name);
                         }
                     }
                     catch (ArgumentException)
                     {
                     }
                     if (obj2 != null)
                     {
                         list.Add(obj2);
                     }
                 }
             }
             IComparer comparer = this.Comparer;
             if (comparer != null)
             {
                 list.Sort(comparer);
             }
         }
         Array values = (list != null) ? ((Array) list.ToArray()) : null;
         this.values = new TypeConverter.StandardValuesCollection(values);
     }
     return this.values;
 }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     TypeConverter.StandardValuesCollection valuess = this._standardValues;
     if (this._standardValues == null)
     {
         DataTable elements = new OleDbEnumerator().GetElements();
         DataColumn column2 = elements.Columns["SOURCES_NAME"];
         DataColumn column = elements.Columns["SOURCES_TYPE"];
         List<string> values = new List<string>(elements.Rows.Count);
         foreach (DataRow row in elements.Rows)
         {
             int num = (int) row[column];
             if ((1 == num) || (3 == num))
             {
                 string item = (string) row[column2];
                 if (!OleDbConnectionString.IsMSDASQL(item.ToLower(CultureInfo.InvariantCulture)) && (0 > values.IndexOf(item)))
                 {
                     values.Add(item);
                 }
             }
         }
         valuess = new TypeConverter.StandardValuesCollection(values);
         this._standardValues = valuess;
     }
     return valuess;
 }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     TypeConverter.StandardValuesCollection valuess = this._standardValues;
     if (valuess == null)
     {
         Array values = Enum.GetValues(typeof(OleDbConnectionStringBuilder.OleDbServiceValues));
         Array.Sort(values, 0, values.Length);
         valuess = new TypeConverter.StandardValuesCollection(values);
         this._standardValues = valuess;
     }
     return valuess;
 }
 private void OnInstalledFontsChanged(object sender, EventArgs e)
 {
     this.values = null;
 }
예제 #32
0
        //转为下拉框

        public TypeConverter.StandardValuesCollection GetValues()
        {
            if (m_CollectionValue == null)
            {
                int ncount = 0;
                if (ComboValues == null || ComboValues.Count <= 0)
                    return null;

                string[] comvalue = new string[ComboValues.Count];
                
                ArrayList a_combovalues = new ArrayList(ComboValues);
                StringComparer comboComp = new StringComparer();
                a_combovalues.Sort(comboComp);

                foreach (DictionaryEntry kv in /*ComboValues*/a_combovalues)
                {
                    comvalue[ncount++] = (string)kv.Key;
                }

                m_CollectionValue = new TypeConverter.StandardValuesCollection(comvalue);
            }
            return m_CollectionValue;
        }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (this.values == null)
     {
         FontFamily[] families = FontFamily.Families;
         Hashtable hashtable = new Hashtable();
         for (int i = 0; i < families.Length; i++)
         {
             string name = families[i].Name;
             hashtable[name.ToLower(CultureInfo.InvariantCulture)] = name;
         }
         object[] array = new object[hashtable.Values.Count];
         hashtable.Values.CopyTo(array, 0);
         Array.Sort(array, Comparer.Default);
         this.values = new TypeConverter.StandardValuesCollection(array);
     }
     return this.values;
 }