本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: SortedEnumTypeConverter
public SortedEnumTypeConverter(Type type) :
base(type)
{
var values = Enum.GetNames(EnumType);
Array.Sort(values);
_values = new StandardValuesCollection(values);
}
示例5: Initialize
public static void Initialize(ICollection<string> importers)
{
var list = new List<string>(importers);
list.Add(NoValue);
list.Sort();
standardValues = new StandardValuesCollection(list);
}
示例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;
}
示例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;
}
示例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;
}
示例9: GetStandardValues
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
if (charSets == null)
PopulateList(context.Instance);
StandardValuesCollection coll = new StandardValuesCollection(charSets);
return coll;
}
示例10: GetStandardValues
GetStandardValues(ITypeDescriptorContext context)
{
List<string> converters = GetAvailableConverters();
StandardValuesCollection svc = new StandardValuesCollection(converters);
return svc;
}
示例11: GetStandardValues
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) {
if (_values == null) {
object[] values = new object[] { 0 };
_values = new StandardValuesCollection(values);
}
return _values;
}
示例12: GetStandardValues
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
if(standardValues == null)
{
standardValues = new StandardValuesCollection(values);
}
return standardValues;
}
示例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;
}
示例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);
}
示例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;
}