예제 #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.");
            }
        }
예제 #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.");
            }
        }
예제 #3
0
 public override void SetValue(object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture)
 {
     OnSetValue?.Invoke(this, obj, value);
 }
예제 #4
0
파일: main.cs 프로젝트: wings9119/12306
 private void Set(Control ctl, string key, string value)
 {
     svh = new SetValueHandler(SetControlValue);
     svh.Invoke(ctl,key,value);
     svh.Invoke(ctl, key, value);
 }
예제 #5
0
파일: main.cs 프로젝트: qq858187064/12306
 private void Set(Control ctl, string key, string value)
 {
     svh = new SetValueHandler(SetControlValue);
     svh.Invoke(ctl, key, value);
     svh.Invoke(ctl, key, value);
 }