public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { if ((value == null)) { return(null); } TransactionKind valueCasted = ((TransactionKind)(value)); if ((valueCasted == TransactionKind.TokenExchange)) { return("tokenExchange"); } if ((valueCasted == TransactionKind.Other)) { return("other"); } if ((valueCasted == TransactionKind.TaxChargePayment)) { return("taxChargePayment"); } if ((valueCasted == TransactionKind.TokenCancellation)) { return("tokenCancellation"); } if ((valueCasted == TransactionKind.TokenSalePayment)) { return("tokenSalePayment"); } if ((valueCasted == TransactionKind.ServiceChargePayment)) { return("serviceChargePayment"); } if ((valueCasted == TransactionKind.AccountPayment)) { return("accountPayment"); } if ((valueCasted == TransactionKind.TokenGrant)) { return("tokenGrant"); } if ((valueCasted == TransactionKind.DiversePayment)) { return("diversePayment"); } if ((valueCasted == TransactionKind.TokenFreeIssue)) { return("tokenFreeIssue"); } if ((valueCasted == TransactionKind.MeterConfigurationToken)) { return("meterConfigurationToken"); } if ((valueCasted == TransactionKind.AuxiliaryChargePayment)) { return("auxiliaryChargePayment"); } if ((valueCasted == TransactionKind.TransactionReversal)) { return("transactionReversal"); } throw new ArgumentOutOfRangeException("value"); }
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) { return(true); }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) { return(sourceType == typeof(string)); }
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { return(baseConverter.GetStandardValues(context)); }
// Public Instance Methods public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, Attribute[] attributes) { return(TypeDescriptor.GetProperties(typeof(DockPaddingEdges), attributes)); }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { return(baseConverter.ConvertFrom(context, culture, value)); }
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) { return(baseConverter.GetCreateInstanceSupported(context)); }
/// <summary> /// Overrides <see cref="TypeConverter.GetStandardValuesSupported"/>. /// </summary> /// <returns>Returns true.</returns> public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) { return true; }
public override StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { return(new StandardValuesCollection(new Dialect[] { Dialect.Core, Dialect.VO, Dialect.Vulcan, Dialect.Harbour, Dialect.XPP, Dialect.FoxPro })); }
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService editorService = null; if (null != context && null != context.Instance) { MESSeries pcc = context.Instance as MESSeries; if (null != pcc && null != pcc.SourceField) { editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService != null) { FieldTreeViewData sfAll = (PMS.Libraries.ToolControls.PMSPublicInfo.CurrentPrjInfo.GetCurrentReportDataDefine()) as FieldTreeViewData; RelationFieldChoose rfc = new RelationFieldChoose(editorService); rfc.strRField = pcc.BindingField; List <PmsField> lp = new List <PmsField>(); List <SourceField> lpdb = pcc.SourceField.GetSubSourceField(sfAll); foreach (SourceField pdb in lpdb) { try { if (!string.IsNullOrEmpty(pdb.DataType)) { string typ = pdb.DataType.ToUpper(); if (typ.Equals("INT", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("FLOAT", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("REAL", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("INT32", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("INT16", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("INT64", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("SYSTEM.SINGLE", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("SYSTEM.DOUBLE", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("SYSTEM.INT32", StringComparison.InvariantCultureIgnoreCase) || typ.Equals("SYSTEM.DECIMAL", StringComparison.InvariantCultureIgnoreCase)) { if (pcc.seriesDataForAppearance != null && !pcc.seriesDataForAppearance.Contains(pdb.RecordField)) { PmsField pf = new PmsField(); pf.fieldName = pdb.RecordField; pf.fieldDescription = pdb.Name; lp.Add(pf); } } } } catch { } } rfc.pmsFieldList = lp; editorService.DropDownControl(rfc); if (!string.IsNullOrEmpty(rfc.strRField)) { value = rfc.strRField; } return(value); } } } return(base.EditValue(context, provider, value)); }
/// <summary> /// Overrides <see cref="TypeConverter.GetStandardValues"/>. /// </summary> /// <returns>Returns valid control <see cref="Control"/> ID <see cref="String"/> array.</returns> public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { if (context == null || context.Container == null) { return null; } object[] standardValues = this.GetControls(context.Container); if (standardValues != null) { return new StandardValuesCollection(standardValues); } return null; }
[RefreshProperties(RefreshProperties.All)] public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { if (context == null || provider == null || context.Instance == null) { return(base.EditValue(provider, value)); } oEditorService = (System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (oEditorService != null) { // Get the Back reference to the Custom Property CustomProperty.CustomPropertyDescriptor oDescriptor = (CustomProperty.CustomPropertyDescriptor)context.PropertyDescriptor; CustomProperty cp = (CustomProperty)oDescriptor.CustomProperty; // Declare attributes UIListboxDatasource datasource; UIListboxValueMember valuemember; UIListboxDisplayMember displaymember; // Get attributes datasource = (UIListboxDatasource)context.PropertyDescriptor.Attributes[typeof(UIListboxDatasource)]; valuemember = (UIListboxValueMember)context.PropertyDescriptor.Attributes[typeof(UIListboxValueMember)]; displaymember = (UIListboxDisplayMember)context.PropertyDescriptor.Attributes[typeof(UIListboxDisplayMember)]; oList.BorderStyle = BorderStyle.None; oList.IntegralHeight = true; if (datasource != null) { oList.DataSource = datasource.Value; } if (displaymember != null) { oList.DisplayMember = displaymember.Value; } if (valuemember != null) { oList.ValueMember = valuemember.Value; } if (value != null) { if (value.GetType().Name == "String") { oList.Text = (string)value; } else { oList.SelectedItem = value; } } oList.SelectedIndexChanged += new System.EventHandler(this.SelectedItem); oEditorService.DropDownControl(oList); if (oList.SelectedIndices.Count == 1) { cp.SelectedItem = oList.SelectedItem; cp.SelectedValue = oSelectedValue; value = oList.Text; } oEditorService.CloseDropDown(); } else { return(base.EditValue(provider, value)); } return(value); }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { var v = (Vector2)value; return($"{v.X};{v.Y}"); }
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { if ((value == null)) { return(default(TransactionKind)); } string valueString = value.ToString(); if ((valueString == "tokenExchange")) { return(TransactionKind.TokenExchange); } if ((valueString == "other")) { return(TransactionKind.Other); } if ((valueString == "taxChargePayment")) { return(TransactionKind.TaxChargePayment); } if ((valueString == "tokenCancellation")) { return(TransactionKind.TokenCancellation); } if ((valueString == "tokenSalePayment")) { return(TransactionKind.TokenSalePayment); } if ((valueString == "serviceChargePayment")) { return(TransactionKind.ServiceChargePayment); } if ((valueString == "accountPayment")) { return(TransactionKind.AccountPayment); } if ((valueString == "tokenGrant")) { return(TransactionKind.TokenGrant); } if ((valueString == "diversePayment")) { return(TransactionKind.DiversePayment); } if ((valueString == "tokenFreeIssue")) { return(TransactionKind.TokenFreeIssue); } if ((valueString == "meterConfigurationToken")) { return(TransactionKind.MeterConfigurationToken); } if ((valueString == "auxiliaryChargePayment")) { return(TransactionKind.AuxiliaryChargePayment); } if ((valueString == "transactionReversal")) { return(TransactionKind.TransactionReversal); } return(default(TransactionKind)); }
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) { return(baseConverter.CanConvertFrom(context, srcType)); }
public override StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { return(new StandardValuesCollection(new Platform[] { Platform.AnyCPU, Platform.x86, Platform.x64, Platform.Arm, Platform.Itanium })); }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { return(baseConverter.CanConvertTo(context, destinationType)); }
public override StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { return(new StandardValuesCollection(new DebugType[] { DebugType.None, DebugType.Full, DebugType.Pdbonly, DebugType.Portable, DebugType.Embedded })); }
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) { return(baseConverter.CreateInstance(context, dictionary)); }
public override StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { return(new StandardValuesCollection(new RunPostBuildEvent[] { RunPostBuildEvent.Always, RunPostBuildEvent.OnBuildSuccess, RunPostBuildEvent.OnOutputUpdated })); }
public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) { return(baseConverter.GetProperties(context, value, attributeVar)); }
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) { return(new StandardValuesCollection(new OutputType[] { OutputType.Exe, OutputType.Library, OutputType.WinExe })); }
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) { return(baseConverter.GetStandardValuesSupported(context)); }
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { return(base.EditValue(context, provider, value)); }
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) { return(true); }
// Indicates whether the UITypeEditor provides a form-based (modal) dialog, // drop down dialog, or no UI outside of the properties window. public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context) { return(UITypeEditorEditStyle.DropDown); }
public override UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context) { return(UITypeEditorEditStyle.Modal); }
/// <summary> /// Indicates whether the UITypeEditor supports painting a /// representation of a property's value. /// </summary> /// <param name="context"></param> /// <returns></returns> public override bool GetPaintValueSupported(System.ComponentModel.ITypeDescriptorContext context) { return(false); }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { return(destinationType == typeof(string)); }
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { return(etoConverter.ConvertTo(null, culture, value, destinationType)); }