コード例 #1
0
ファイル: BindingHelper.cs プロジェクト: AleksMorozova/prizm
 private static void Invert(object sender, ConvertEventArgs e)
 {
     if (e.DesiredType == typeof(bool))
     {
         e.Value = !((bool)e.Value);
     }
 }
コード例 #2
0
		private static void OnKeyModifierBindingConvert(object sender, ConvertEventArgs e)
		{
			if (e.Value is XKeys && e.DesiredType == typeof (ModifierFlags))
			{
				ModifierFlags result = ModifierFlags.None;
				XKeys value = (XKeys) e.Value;
				if ((value & XKeys.Control) == XKeys.Control)
					result = result | ModifierFlags.Control;
				if ((value & XKeys.Alt) == XKeys.Alt)
					result = result | ModifierFlags.Alt;
				if ((value & XKeys.Shift) == XKeys.Shift)
					result = result | ModifierFlags.Shift;
				e.Value = result;
			}
			else if (e.Value is ModifierFlags && e.DesiredType == typeof (XKeys))
			{
				XKeys result = XKeys.None;
				ModifierFlags value = (ModifierFlags) e.Value;
				if ((value & ModifierFlags.Control) == ModifierFlags.Control)
					result = result | XKeys.Control;
				if ((value & ModifierFlags.Alt) == ModifierFlags.Alt)
					result = result | XKeys.Alt;
				if ((value & ModifierFlags.Shift) == ModifierFlags.Shift)
					result = result | XKeys.Shift;
				e.Value = result;
			}
		}
コード例 #3
0
		private void OnFormatQuality(object sender, ConvertEventArgs e)
		{
			if (e.DesiredType != typeof(string))
				return;

			e.Value = String.Format("({0})", (int)e.Value);
		}
コード例 #4
0
        void CheckBoxNeverEnd_Format(object sender, ConvertEventArgs e)
        {
            // from object to control

            // Never Ending should be checked when there is no end date
            if (e.DesiredType == typeof(bool))
                e.Value = (e.Value == null);
        }
コード例 #5
0
        public static void DecimalToFloatString(object sender, ConvertEventArgs cevent)
        {
            // The method converts only to string type. Test this using the DesiredType.
            if (cevent.DesiredType != typeof(string)) return;

            if(!string.IsNullOrEmpty(cevent.Value.ToString()))
                cevent.Value = ((decimal)cevent.Value).ToString("###,###,###.00");
        }
コード例 #6
0
		private void DecimalToCurrencyString(object sender, ConvertEventArgs e)
		{
			if (e.DesiredType == typeof(string))
			{
				// Use the ToString method to format the value as currency ("c").
				e.Value = ((decimal)e.Value).ToString("c");
			}
		}
コード例 #7
0
ファイル: BindToImage.cs プロジェクト: ehershey/development
		private void ImageToFile(object sender, ConvertEventArgs e)
		{
			if (e.DesiredType == typeof(string))
			{
				// Substitute the filename.
				e.Value = picProduct.Tag;
			}
		}
コード例 #8
0
        public static void CurrencyFormat(object sender, ConvertEventArgs e)
        {
            if (e.Value is System.DBNull)
            {
                return;
            }

            e.Value = (Convert.ToDouble(e.Value)).ToString("C");
        }
コード例 #9
0
        public static void DateFormat(object sender, ConvertEventArgs e)
        {
            if (e.Value is System.DBNull)
            {
                return;
            }

            e.Value = Convert.ToDateTime(e.Value).ToShortDateString();
        }
コード例 #10
0
 public static void CurrencyStringToDecimal(object sender, ConvertEventArgs cevent)
 {
     // The method converts back to decimal type only.
     if (cevent.DesiredType != typeof(decimal)) return;
     if (!string.IsNullOrEmpty(cevent.Value.ToString()))
     // Converts the string back to decimal using the static Parse method.
     cevent.Value = Decimal.Parse(cevent.Value.ToString(),
     NumberStyles.Currency, null);
 }
コード例 #11
0
        public static void DecimalToCurrencyString(object sender, ConvertEventArgs cevent)
        {
            // The method converts only to string type. Test this using the DesiredType.
            if (cevent.DesiredType != typeof(string)) return;

            // Use the ToString method to format the value as currency ("c").
            if (!string.IsNullOrEmpty(cevent.Value.ToString()))
            cevent.Value = ((decimal)cevent.Value).ToString("c");
        }
コード例 #12
0
        public static void FloatStringToDecimal(object sender, ConvertEventArgs cevent)
        {
            // The method converts back to decimal type only.
            if (cevent.DesiredType != typeof(decimal)) return;

            // Converts the string back to decimal using the static Parse method.
            cevent.Value = Decimal.Parse(cevent.Value.ToString(),
            NumberStyles.Any, null);
        }
コード例 #13
0
 protected override void OnFormat(ConvertEventArgs cevent)
 {
     if (this._converter != null)
     {
         var converterdValue = this._converter.Convert(cevent.Value, cevent.DesiredType, _converterParameter,
                                                       _converterCulture);
         cevent.Value = converterdValue;
     }
     else base.OnFormat(cevent);
 }
コード例 #14
0
		void OnPortBindingFormat(object sender, ConvertEventArgs e)
		{
			if (e.DesiredType != typeof(string))
				return;

			if ((int)e.Value <= 0)
				e.Value = "";
			else
				e.Value = e.Value.ToString();
		}
コード例 #15
0
        void IsShredHostRunningFormat(object sender, ConvertEventArgs e)
        {
            // The method converts only to string type. Test this using the DesiredType.
            if (e.DesiredType != typeof(string)) return;

            // Use the ToString method to format the value as currency ("c").
            if (true == ((bool)e.Value))
                e.Value = (string)"ShredHost is Running";
            else
                e.Value = (string)"ShredHost is Stopped";
        }
コード例 #16
0
        public static void PercentFormat(object sender, ConvertEventArgs e)
        {
            if (e.Value is System.DBNull)
            {
                return;
            }

            double percentValue = Convert.ToDouble(e.Value);
            percentValue = percentValue / 100;
            e.Value = percentValue.ToString("P0");
        }
コード例 #17
0
 void CheckBoxNeverEnd_Parse(object sender, ConvertEventArgs e)
 {
     // from control to object
     if (e.DesiredType == typeof(DateTime?) && e.Value is bool)
     {
         //e.Value = ((bool)e.Value == true ? (DateTime?)null : DateTime.Today);
         if ((bool)e.Value == true)
             e.Value = null;
         //else
         //    e.Value = ((Schedule)((BindingSource)((Binding)sender).DataSource).Current).EndDate;
     }
 }
コード例 #18
0
        void EndDate_Format(object sender, ConvertEventArgs e)
        {
            // from object to control
            DateTime? val = e.Value as DateTime?;

            // if desired type is DateTime then we're binding Value
            // if desired type is Boolean then we're binding Enabled
            if (e.DesiredType == typeof(DateTime))
                e.Value = (val.HasValue ? e.Value : dtpEndDate.Value);
            else if (e.DesiredType == typeof(bool))
                e.Value = val.HasValue;
        }
コード例 #19
0
		void OnRadioBindingParse(object sender, ConvertEventArgs e)
		{
			if (e.DesiredType != typeof(DateFormatApplicationComponent.DateFormatOptions))
				return;

			if (_radioCustom.Checked)
				e.Value = DateFormatApplicationComponent.DateFormatOptions.Custom;
			else if (_radioSystemLongDate.Checked)
				e.Value = DateFormatApplicationComponent.DateFormatOptions.SystemLong;
			else
				e.Value = DateFormatApplicationComponent.DateFormatOptions.SystemShort;
		}
コード例 #20
0
        private object FormatObject(object value)
        {
            if (this.ControlAtDesignTime())
            {
                return(value);
            }
            System.Type propertyType = this.propInfo.PropertyType;
            if (this.formattingEnabled)
            {
                ConvertEventArgs args = new ConvertEventArgs(value, propertyType);
                this.OnFormat(args);
                if (args.Value != value)
                {
                    return(args.Value);
                }
                TypeConverter sourceConverter = null;
                if (this.bindToObject.FieldInfo != null)
                {
                    sourceConverter = this.bindToObject.FieldInfo.Converter;
                }
                return(Formatter.FormatObject(value, propertyType, sourceConverter, this.propInfoConverter, this.formatString, this.formatInfo, this.nullValue, this.dsNullValue));
            }
            ConvertEventArgs cevent = new ConvertEventArgs(value, propertyType);

            this.OnFormat(cevent);
            object obj2 = cevent.Value;

            if (propertyType == typeof(object))
            {
                return(value);
            }
            if ((obj2 != null) && (obj2.GetType().IsSubclassOf(propertyType) || (obj2.GetType() == propertyType)))
            {
                return(obj2);
            }
            TypeConverter converter2 = TypeDescriptor.GetConverter((value != null) ? value.GetType() : typeof(object));

            if ((converter2 != null) && converter2.CanConvertTo(propertyType))
            {
                return(converter2.ConvertTo(value, propertyType));
            }
            if (value is IConvertible)
            {
                obj2 = Convert.ChangeType(value, propertyType, CultureInfo.CurrentCulture);
                if ((obj2 != null) && (obj2.GetType().IsSubclassOf(propertyType) || (obj2.GetType() == propertyType)))
                {
                    return(obj2);
                }
            }
            throw new FormatException(System.Windows.Forms.SR.GetString("ListBindingFormatFailed"));
        }
コード例 #21
0
        void OnFormat(object sender, ConvertEventArgs e)
        {
            if (_keyProperty > 0)
            {
                _errorProvider.SetError(_comboBox, "");
                return;
            }

            if (string.IsNullOrEmpty(_comboBox.Text))
            {
                e.Value = "";
                _errorProvider.SetError(_comboBox, string.Format("{0} required.", _friendlyName));
            }
        }
コード例 #22
0
 /// <include file='doc\ListBinding.uex' path='docs/doc[@for="Binding.OnFormat"]/*' />
 protected virtual void OnFormat(ConvertEventArgs cevent)
 {
     if (onFormat != null)
     {
         onFormat(this, cevent);
     }
     if (!formattingEnabled)
     {
         if (!(cevent.Value is System.DBNull) && cevent.DesiredType != null && !cevent.DesiredType.IsInstanceOfType(cevent.Value) && (cevent.Value is IConvertible))
         {
             cevent.Value = Convert.ChangeType(cevent.Value, cevent.DesiredType, CultureInfo.CurrentCulture);
         }
     }
 }
コード例 #23
0
		private void CurrencyStringToDecimal(object sender, ConvertEventArgs e)
		{
			if (e.DesiredType == typeof(decimal))
			{
				// Convert the string back to decimal using the static Parse method.
				try
				{
					e.Value = Decimal.Parse(e.Value.ToString());
				}
				catch
				{
					e.Value = previousUnitCost;
				}
			}
		}
コード例 #24
0
		void OnPortBindingParse(object sender, ConvertEventArgs e)
		{
			if (e.DesiredType != typeof(int))
				return;

			int value;
			if (!(e.Value is string) || !int.TryParse((string)e.Value, out value))
			{
				e.Value = 0;
			}
			else
			{
				e.Value = value;
			}
		}
コード例 #25
0
        // will throw when fail
        // we will not format the object when the control is in design time.
        // this is because if we bind a boolean property on a control
        // to a row that is full of DBNulls then we cause problems in the shell.
        private object FormatObject(object value)
        {
            if (ControlAtDesignTime())
            {
                return(value);
            }
            object ret;
            Type   type = propInfo.PropertyType;

            if (type == typeof(object))
            {
                return(value);
            }

            // first try: use the Format event
            ConvertEventArgs e = new ConvertEventArgs(value, type);

            OnFormat(e);
            ret = e.Value;

            if (ret.GetType().IsSubclassOf(type) || ret.GetType() == type)
            {
                return(ret);
            }

            // second try: use type converter for the desiredType
            TypeConverter typeConverter = TypeDescriptor.GetConverter(value.GetType());

            if (typeConverter != null && typeConverter.CanConvertTo(type))
            {
                ret = typeConverter.ConvertTo(value, type);
                return(ret);
            }

            // last try: use Convert.ChangeType
            if (value is IConvertible)
            {
                ret = Convert.ChangeType(value, type);
                if (ret.GetType().IsSubclassOf(type) || ret.GetType() == type)
                {
                    return(ret);
                }
            }

            // time to fail:
            throw new FormatException(SR.GetString(SR.ListBindingFormatFailed));
        }
コード例 #26
0
		private void CurrencyStringToDecimal(object sender, ConvertEventArgs e)
		{
			if (e.DesiredType == typeof(decimal))
			{
				// Convert the string back to decimal using the static Parse method.
				try
				{
					previousValue = e.Value;
					e.Value = Decimal.Parse(e.Value.ToString(),
							   System.Globalization.NumberStyles.Currency, null);
				}
				catch
				{
					e.Value = previousValue;
				}
			}
		}
コード例 #27
0
        private object ParseObject(object value)
        {
            System.Type bindToType = this.bindToObject.BindToType;
            if (this.formattingEnabled)
            {
                ConvertEventArgs args = new ConvertEventArgs(value, bindToType);
                this.OnParse(args);
                object objB = args.Value;
                if (!object.Equals(value, objB))
                {
                    return(objB);
                }
                TypeConverter targetConverter = null;
                if (this.bindToObject.FieldInfo != null)
                {
                    targetConverter = this.bindToObject.FieldInfo.Converter;
                }
                return(Formatter.ParseObject(value, bindToType, (value == null) ? this.propInfo.PropertyType : value.GetType(), targetConverter, this.propInfoConverter, this.formatInfo, this.nullValue, this.GetDataSourceNullValue(bindToType)));
            }
            ConvertEventArgs cevent = new ConvertEventArgs(value, bindToType);

            this.OnParse(cevent);
            if ((cevent.Value != null) && ((cevent.Value.GetType().IsSubclassOf(bindToType) || (cevent.Value.GetType() == bindToType)) || (cevent.Value is DBNull)))
            {
                return(cevent.Value);
            }
            TypeConverter converter2 = TypeDescriptor.GetConverter((value != null) ? value.GetType() : typeof(object));

            if ((converter2 != null) && converter2.CanConvertTo(bindToType))
            {
                return(converter2.ConvertTo(value, bindToType));
            }
            if (value is IConvertible)
            {
                object obj3 = Convert.ChangeType(value, bindToType, CultureInfo.CurrentCulture);
                if ((obj3 != null) && (obj3.GetType().IsSubclassOf(bindToType) || (obj3.GetType() == bindToType)))
                {
                    return(obj3);
                }
            }
            return(null);
        }
コード例 #28
0
        private object ParseData(object data, Type data_type)
        {
            ConvertEventArgs e = new ConvertEventArgs(data, data_type);

            OnParse(e);
            if (data_type.IsInstanceOfType(e.Value))
            {
                return(e.Value);
            }
            if (e.Value == Convert.DBNull)
            {
                return(e.Value);
            }
            if (e.Value == null)
            {
                bool nullable = data_type.IsGenericType && !data_type.ContainsGenericParameters &&
                                data_type.GetGenericTypeDefinition() == typeof(Nullable <>);
                return(data_type.IsValueType && !nullable ? Convert.DBNull : null);
            }

            return(ConvertData(e.Value, data_type));
        }
コード例 #29
0
ファイル: BindToImage.cs プロジェクト: ehershey/development
		private void FileToImage(object sender, ConvertEventArgs e)
		{
			if (e.DesiredType == typeof(Image))
			{
				// Store the filename.
				picProduct.Tag = e.Value;

				// Look up the corresponding file, and create an Image object.
				try
				{
					lblStatus.Text = "Retrieved picture " + e.Value;
					e.Value = Image.FromFile(Application.StartupPath + "\\" + e.Value);
				}
				catch (Exception err)
				{
					lblStatus.Text = "Could not find picture " + e.Value;

					// You could return an error picture here.
					// This code uses a blank 1x1 pixel image.
					e.Value = new Bitmap(1,1);
				}
			}
		}
コード例 #30
0
        private void DateFormat(object sender, System.Windows.Forms.ConvertEventArgs e)
        {
            if (e.DesiredType != typeof(string))
            {
                return;
            }

            try
            {
                if (e.Value == null)
                {
                    e.Value = String.Empty;
                }
                else
                {
                    e.Value = Convert.ToDateTime(e.Value).ToShortDateString();
                }
            }
            catch (Exception)
            {
                e.Value = String.Empty;
            }
        }
コード例 #31
0
        void OnParse(object sender, ConvertEventArgs e)
        {
            if (_nameValueList.Key(_comboBox.Text) > 0)
            {
                _errorProvider.SetError(_comboBox, "");
                return;
            }

            if (_nameValueList.Key(e.Value.ToString()) > 0)
            {
                _comboBox.Text = e.Value.ToString();
                _errorProvider.SetError(_comboBox, "");
                return;
            }

            _keyProperty = 0;
            if (string.IsNullOrEmpty(_comboBox.Text))
            {
                _errorProvider.SetError(_comboBox, string.Format("{0} required.",_friendlyName));
            }
            else
                _errorProvider.SetError(_comboBox, string.Format("{0} isn't a valid {1}.", e.Value, _friendlyName));

        }
コード例 #32
0
 private void OnParse(object sender, ConvertEventArgs e)
 {
 }
コード例 #33
0
 //=====================================================================
 /// <summary>
 /// This converts null values to a default type for the bound radio button list
 /// </summary>
 /// <param name="sender">The sender of the event</param>
 /// <param name="e">The event arguments</param>
 private void ContactType_Format(object sender, ConvertEventArgs e)
 {
     if(e.Value == null || e.Value == DBNull.Value)
         e.Value = "B";
 }
コード例 #34
0
        private object FormatObject(object value)
        {
            // We will not format the object when the control is in design time.
            // This is because if we bind a boolean property on a control to a
            // row that is full of DBNulls then we cause problems in the shell.
            if (ControlAtDesignTime())
            {
                return(value);
            }

            Type type = propInfo.PropertyType;

            if (formattingEnabled)
            {
                // -------------------------------
                // Behavior for Whidbey and beyond
                // -------------------------------

                // Fire the Format event so that user code gets a chance to supply the formatted value for us
                ConvertEventArgs e = new ConvertEventArgs(value, type);
                OnFormat(e);

                if (e.Value != value)
                {
                    // If event handler replaced parsed value with formatted value, use that
                    return(e.Value);
                }
                else
                {
                    // Otherwise format the parsed value ourselves
                    TypeConverter fieldInfoConverter = null;
                    if (bindToObject.FieldInfo != null)
                    {
                        fieldInfoConverter = bindToObject.FieldInfo.Converter;
                    }
                    return(Formatter.FormatObject(value, type, fieldInfoConverter, propInfoConverter, formatString, formatInfo, nullValue, dsNullValue));
                }
            }
            else
            {
                // ----------------------------
                // Behavior for RTM and Everett  [DO NOT MODIFY!]
                // ----------------------------

                // first try: use the Format event
                ConvertEventArgs e = new ConvertEventArgs(value, type);
                OnFormat(e);
                object ret = e.Value;

                // Approved breaking-change behavior between RTM and Everett: Fire the Format event even if the control property is of type
                // Object (RTM used to skip the event for properties of this type).

                if (type == typeof(object))
                {
                    return(value);
                }

                // stop now if we have a value of a compatible type
                if (ret != null && (ret.GetType().IsSubclassOf(type) || ret.GetType() == type))
                {
                    return(ret);
                }
                // second try: use type converter for the desiredType
                TypeConverter typeConverter = TypeDescriptor.GetConverter(value != null ? value.GetType() : typeof(object));
                if (typeConverter != null && typeConverter.CanConvertTo(type))
                {
                    ret = typeConverter.ConvertTo(value, type);
                    return(ret);
                }
                // last try: use Convert.ChangeType
                if (value is IConvertible)
                {
                    ret = Convert.ChangeType(value, type, CultureInfo.CurrentCulture);
                    if (ret != null && (ret.GetType().IsSubclassOf(type) || ret.GetType() == type))
                    {
                        return(ret);
                    }
                }

                // time to fail:
                throw new FormatException(SR.ListBindingFormatFailed);
            }
        }
コード例 #35
0
        private object ParseObject(object value)
        {
            Type type = this.bindToObject.BindToType;

            if (formattingEnabled)
            {
                // -------------------------------
                // Behavior for Whidbey and beyond
                // -------------------------------

                // Fire the Parse event so that user code gets a chance to supply the parsed value for us
                ConvertEventArgs e = new ConvertEventArgs(value, type);
                OnParse(e);

                object newValue = e.Value;

                if (!object.Equals(value, newValue))
                {
                    // If event handler replaced formatted value with parsed value, use that
                    return(newValue);
                }
                else
                {
                    // Otherwise parse the formatted value ourselves
                    TypeConverter fieldInfoConverter = null;
                    if (bindToObject.FieldInfo != null)
                    {
                        fieldInfoConverter = bindToObject.FieldInfo.Converter;
                    }
                    return(Formatter.ParseObject(value, type, (value == null ? propInfo.PropertyType : value.GetType()), fieldInfoConverter, propInfoConverter, formatInfo, nullValue, GetDataSourceNullValue(type)));
                }
            }
            else
            {
                // ----------------------------
                // Behavior for RTM and Everett  [DO NOT MODIFY!]
                // ----------------------------

                ConvertEventArgs e = new ConvertEventArgs(value, type);
                // first try: use the OnParse event
                OnParse(e);
                //
                if (e.Value != null && (e.Value.GetType().IsSubclassOf(type) || e.Value.GetType() == type || e.Value is System.DBNull))
                {
                    return(e.Value);
                }
                // second try: use the TypeConverter
                TypeConverter typeConverter = TypeDescriptor.GetConverter(value != null ? value.GetType() : typeof(object));
                if (typeConverter != null && typeConverter.CanConvertTo(type))
                {
                    return(typeConverter.ConvertTo(value, type));
                }
                // last try: use Convert.ToType
                if (value is IConvertible)
                {
                    object ret = Convert.ChangeType(value, type, CultureInfo.CurrentCulture);
                    if (ret != null && (ret.GetType().IsSubclassOf(type) || ret.GetType() == type))
                    {
                        return(ret);
                    }
                }
                // time to fail: (RTM/Everett just returns null, whereas Whidbey throws an exception)
                return(null);
            }
        }
コード例 #36
0
ファイル: DataBinding.cs プロジェクト: Lnlxy/WinForms.Extras
 protected override void OnParse(ConvertEventArgs cevent)
 {
     cevent.Value = Converter.ConvertBack(cevent.Value, cevent.DesiredType, ConvertParameter, Culture);
 }
コード例 #37
0
ファイル: EMailControl.cs プロジェクト: modulexcite/PDI
        //=====================================================================

        /// <summary>
        /// This is used to set the checked state of an e-mail type checkbox
        /// </summary>
        /// <param name="sender">The sender of the event</param>
        /// <param name="e">The event arguments</param>
        private void CheckBox_Format(object sender, ConvertEventArgs e)
        {
            CheckBox cb = (CheckBox)((Binding)sender).Control;
            EMailTypes checkType = (EMailTypes)cb.Tag;
            EMailTypes emailTypes = (EMailTypes)e.Value;

            e.Value = (emailTypes & checkType) == checkType;
        }
コード例 #38
0
 private void SwitchBool(object sender, ConvertEventArgs e)
 {
     if (e.Value == null)
         e.Value = false;
     else
         e.Value = (bool)e.Value;
 }
コード例 #39
0
        protected override void OnParse(ConvertEventArgs cevent)
        {
            var values = Converter.ConvertBack(cevent.Value, _types, ConvertParameter, Culture);

            cevent.Value = values;
        }
コード例 #40
0
ファイル: EMailControl.cs プロジェクト: modulexcite/PDI
        /// <summary>
        /// This is used to store the value of the e-mail type checkbox
        /// </summary>
        /// <param name="sender">The sender of the event</param>
        /// <param name="e">The event arguments</param>
        private void CheckBox_Parse(object sender, ConvertEventArgs e)
        {
            EMailProperty email = (EMailProperty)this.BindingSource.Current;
            CheckBox cb = (CheckBox)((Binding)sender).Control;
            EMailTypes checkType = (EMailTypes)cb.Tag;

            if(cb.Checked)
                email.EMailTypes |= checkType;
            else
                email.EMailTypes &= ~checkType;

            // Only one address can be the preferred address
            if(checkType == EMailTypes.Preferred)
                ((EMailPropertyCollection)this.BindingSource.DataSource).SetPreferred(email);
        }
コード例 #41
0
 private void OnFormat(object sender, ConvertEventArgs e)
 {
 }
コード例 #42
0
 // EVENT HANDLERS
 private void SpeedBinding_Format(object sender, ConvertEventArgs e)
 {
     int speed = (int)e.Value;
     e.Value = $"{speed} steps/sec";
 }
コード例 #43
0
        protected override void OnFormat(ConvertEventArgs cevent)
        {
            var values = (object[])cevent.Value;

            cevent.Value = Converter.Convert(values, cevent.DesiredType, ConvertParameter, Culture);
        }