当前位置: 首页>>代码示例>>C#>>正文


C# StandardValuesCollection类代码示例

本文整理汇总了C#中StandardValuesCollection的典型用法代码示例。如果您正苦于以下问题:C# StandardValuesCollection类的具体用法?C# StandardValuesCollection怎么用?C# StandardValuesCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StandardValuesCollection类属于命名空间,在下文中一共展示了StandardValuesCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetStandardValues

        public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) {
            if (context == null) { return null; }
            if (context.Instance == null) { return null; }

            // Get Model
            DiagrammerEnvironment de = DiagrammerEnvironment.Default;
            if (de == null) { return null; }
            SchemaModel model = de.SchemaModel;
            if (model == null) { return null; }

            // Get Domains
            List<Domain> domains = model.GetDomains();

            // Create List
            List<string> list = new List<string>();

            //
            foreach (Domain domain in domains) {
                list.Add(domain.Name);
            }

            // Sort List and Add (None)
            list.Sort();
            list.Insert(0, Resources.TEXT_NONE_BR);

            // Passes the local integer array.
            StandardValuesCollection svc = new StandardValuesCollection(list);
            return svc;
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:29,代码来源:DomainConverter.cs

示例2: GetStandardValues

        public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            List<string> listToFill = new List<string>();
            listToFill.Clear();
            listToFill.AddRange(FacadeContainer.Self.ApplicationSettings.AvailableBuildTools);
            if (ShowNewApplication)
            {
                listToFill.Add("New Application...");
            }

            if (!string.IsNullOrEmpty(SourceFileExtensionRestriction))
            {
                // Only get build tools that start with the right extension
                string whatToStartWith = "*." + SourceFileExtensionRestriction;

                for (int i = listToFill.Count - 1; i > -1; i--)
                {
                    if (listToFill[i].StartsWith(whatToStartWith) == false)
                    {
                        listToFill.RemoveAt(i);
                    }
                }
            }

            if(ShowNoneOption)
            {
                listToFill.Insert(0, "<None>");
            }


			StandardValuesCollection svc = new StandardValuesCollection(listToFill);

			return svc;
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:34,代码来源:AvailableBuildTools.cs

示例3: GetStandardValues

		public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
		{
			var library = ApplicationServices.Get<IAppModuleInstance>(LipSyncMapDescriptor.ModuleID) as LipSyncMapLibrary;
			List<string> maps = library.Library.Values.Select(data => data.ToString()).ToList();
			StandardValuesCollection values = new StandardValuesCollection(maps);
			return values;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:7,代码来源:PhonemeMappingConverter.cs

示例4: SortedEnumTypeConverter

 public SortedEnumTypeConverter(Type type) : 
     base(type)
 {
     var values = Enum.GetNames(EnumType);
     Array.Sort(values);
     _values = new StandardValuesCollection(values);
 }
开发者ID:Cardanis,项目名称:MonoGame,代码行数:7,代码来源:SortedEnumTypeConverter.cs

示例5: Initialize

 public static void Initialize(ICollection<string> importers)
 {
     var list = new List<string>(importers);
     list.Add(NoValue);
     list.Sort();
     standardValues = new StandardValuesCollection(list);
 }
开发者ID:willcraftia,项目名称:WindowsGame,代码行数:7,代码来源:ContentImporterConverter.cs

示例6: GetStandardValues

      /// <summary>
      /// Gets a collection of standard values for a <see cref="CultureInfo"/> object using the specified context.
      /// </summary>
      /// <param name="context">An <see cref="ITypeDescriptorContext"/> that provides a format context.</param>
      /// <returns>A <see cref="TypeConverter.StandardValuesCollection"/> containing a standard set of valid values,
      /// or null if the data type does not support a standard set of values.</returns>
      public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
      {
         base.GetStandardValues(context);

         if (this.values == null)
         {
            List<CultureInfo> list = new List<CultureInfo>(CultureInfo.GetCultures(CultureTypes.AllCultures));

            list.RemoveAll(c => c.IsNeutralCulture);

            list.Sort((c1, c2) =>
            {
               if (c1 == null)
               {
                  return c2 == null ? 0 : -1;
               }

               if (c2 == null)
               {
                  return 1;
               }

               return CultureInfo.CurrentCulture.CompareInfo.Compare(c1.DisplayName, c2.DisplayName, CompareOptions.StringSort);
            });

            this.values = new StandardValuesCollection(list);
         }

         return this.values;
      }
开发者ID:sulerzh,项目名称:DbExporter,代码行数:36,代码来源:CultureInfoCustomTypeConverter.cs

示例7: GetStandardValues

        public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) {
            if (context == null) { return null; }
            if (context.Instance == null) { return null; }

            // Get Settings
            DiagramPrinterSettings settingsPrinter = context.Instance as DiagramPrinterSettings;
            if (settingsPrinter == null) { return null; }

            // Get Printer Name
            string printerName = settingsPrinter.PrinterName;

            PrintDocument printerDocument = new PrintDocument();
            PrinterSettings printerSettings = printerDocument.PrinterSettings;
            printerSettings.PrinterName = string.IsNullOrEmpty(printerName) ? null : printerName;

            //
            List<string> list = new List<string>();
            foreach (PaperSize paperSize in printerSettings.PaperSizes) {
                list.Add(paperSize.PaperName);
            }

            // Sort
            list.Sort();
            list.Insert(0, Resources.TEXT_DEFAULT_BR);

            // Return List
            StandardValuesCollection svc = new StandardValuesCollection(list);
            return svc;
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:29,代码来源:PrinterPaperSizeConverter.cs

示例8: GetStandardValues

        public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            List<Server> baseServers = new List<Server>
            {
                new Server("useast.battle.net", 6112),
                new Server("uswest.battle.net", 6112),
                new Server("europe.battle.net", 6112),
                new Server("asia.battle.net", 6112)
            };

            List<Server> serverCollection = new List<Server>();
            foreach (Server s in baseServers)
            {
                serverCollection.Add(s);
                try
                {
                    IPHostEntry iphe = Dns.GetHostEntry(s.Host);
                    foreach (IPAddress ipa in iphe.AddressList)
                    {
                        serverCollection.Add(new Server(ipa.ToString(), 6112));
                    }
                }
                catch
                {
                    Debug.WriteLine(s, "Unable to resolve server.");
                }
            }

            StandardValuesCollection svc = new StandardValuesCollection(serverCollection);
            return svc;
        }
开发者ID:Mofsy,项目名称:jinxbot,代码行数:31,代码来源:BattleNetServerTypeConverter.cs

示例9: GetStandardValues

 public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
   if (charSets == null)
     PopulateList(context.Instance);
   StandardValuesCollection coll = new StandardValuesCollection(charSets);
   return coll;
 }
开发者ID:jimmy00784,项目名称:mysql-connector-net,代码行数:7,代码来源:CharacterSetTypeConverter.cs

示例10: GetStandardValues

                     GetStandardValues(ITypeDescriptorContext context)
        {
            List<string> converters = GetAvailableConverters();

            StandardValuesCollection svc = new StandardValuesCollection(converters);

            return svc;
        } 
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:8,代码来源:AvailableCustomVariableTypeConverters.cs

示例11: GetStandardValues

        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) {
            if (_values == null) {
                object[] values = new object[] { 0 };

                _values = new StandardValuesCollection(values);
            }
            return _values;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:DataSourceCacheDurationConverter.cs

示例12: GetStandardValues

		public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
		{
			if(standardValues == null)
			{
				standardValues = new StandardValuesCollection(values);
			}
			return standardValues;
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:TargetConverter.cs

示例13: GetStandardValues

 /// <summary>
 ///    <para>Gets a collection of standard values for the Boolean data type.</para>
 /// </summary>
 public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     if (s_values == null)
     {
         s_values = new StandardValuesCollection(new object[] { true, false });
     }
     return s_values;
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:11,代码来源:BooleanConverter.cs

示例14: Initialize

 public static void Initialize(ICollection<string> processors)
 {
     var names = processors;
     var list = new List<string>(names);
     list.Remove(PassThroughProcessorValue);
     list.Add(NoValue);
     list.Sort();
     standardValues = new StandardValuesCollection(list);
 }
开发者ID:willcraftia,项目名称:WindowsGame,代码行数:9,代码来源:ContentProcessorConverter.cs

示例15: GetStandardValues

		public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context)
		{
			// Passes the local integer array.
			ArrayList values = new ArrayList();
			foreach (DictionaryEntry entry in templateType.Pairs) {
				values.Add(entry.Key);
			}
			StandardValuesCollection svc = new StandardValuesCollection(values);
			return svc;
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:10,代码来源:TemplateTypeConverter.cs


注:本文中的StandardValuesCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。