Esempio n. 1
0
        public void SetClrValue(object instance, object?clrValue)
        {
            if (SetValueHandler != null)
            {
                Debug.Assert(clrValue != DBNull.Value);

                SetValueHandler.Invoke(instance, clrValue);
            }
            else
            {
                throw new MicroOrmException($"Property '{PropertyName}' is not writable.");
            }
        }
Esempio n. 2
0
        /// <param name="sqlRawValue">Может быть <see cref="DBNull"/>.</param>
        /// <param name="sqlColumnName">Используется только для ошибок.</param>
        public void ConvertAndSetValue(object instance, object sqlRawValue, Type sqlColumnType, string sqlColumnName)
        {
            if (SetValueHandler != null)
            {
                object?clrValue = ConvertSqlToClrValue(sqlRawValue, sqlColumnType, sqlColumnName);

                SetValueHandler.Invoke(instance, clrValue);
            }
            else
            {
                throw new MicroOrmException($"Property '{PropertyName}' is not writable.");
            }
        }
Esempio n. 3
0
 public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
 {
     OnSetValue?.Invoke(this, obj, value);
 }
Esempio n. 4
0
 private void Set(Control ctl, string key, string value)
 {
     svh = new SetValueHandler(SetControlValue);
     svh.Invoke(ctl,key,value);
     svh.Invoke(ctl, key, value);
 }
Esempio n. 5
0
 private void Set(Control ctl, string key, string value)
 {
     svh = new SetValueHandler(SetControlValue);
     svh.Invoke(ctl, key, value);
     svh.Invoke(ctl, key, value);
 }