Ejemplo n.º 1
0
 public void CopyFromModel(PropertyInfo vm, object model, PropertyInfo[] modelProps)
 {
     var ckf = vm.GetAttribute<FieldInfoAttribute>().CheckboxField;
     var ckpi = modelProps.Single(ss => ss.Name == ckf);
     var ck = ckpi.GetValue(model, null) as bool?;
     var m = modelProps.FirstOrDefault(mm => mm.Name == vm.Name);
     Number = ((string)m.GetValue(model, null)).FmtFone();
     ReceiveText = ck ?? false;
 }
Ejemplo n.º 2
0
 public void CopyFromModel(PropertyInfo vm, object model, PropertyInfo[] modelProps)
 {
     var ckf = vm.GetAttribute<FieldInfoAttribute>().CheckboxField;
     var ckpi = modelProps.Single(ss => ss.Name == ckf);
     var ck = ckpi.GetValue(model, null) as bool?;
     var m = modelProps.FirstOrDefault(mm => mm.Name == vm.Name);
     Debug.Assert(m != null, "m != null");
     Address = ((string)m.GetValue(model, null));
     Send = ck ?? false;
 }
Ejemplo n.º 3
0
        protected virtual object GetValue(PropertyInfo[] propertiesOnEvent, IEvent @event, EventMetaData metaData)
        {
            var property = propertiesOnEvent.Single(pi => pi.Name.Equals(_name, StringComparison.InvariantCultureIgnoreCase));
            var value = property.GetValue(@event, null);

            if (value is Guid)
                return ((Guid)value).ToByteArray();

            if (value is EventSourceVersion)
                return ((EventSourceVersion)value).Combine();

            return value;
        }
Ejemplo n.º 4
0
 public List<ChangeDetail> CopyToModel(PropertyInfo vm, object model, PropertyInfo[] modelProps, bool track)
 {
     var changes = new List<ChangeDetail>();
     var ckf = vm.GetAttribute<FieldInfoAttribute>().CheckboxField;
     var ckpi = modelProps.Single(mm => mm.Name == ckf);
     if (track)
     {
         model.UpdateValue(changes, vm.Name, Number.GetDigits());
         model.UpdateValue(changes, ckf, ReceiveText);
         return changes;
     }
     var ci = modelProps.FirstOrDefault(ss => ss.Name == vm.Name);
     Debug.Assert(ci != null, "ci != null");
     ci.SetValue(model, Number.GetDigits(), null);
     ckpi.SetValue(model, ReceiveText, null);
     return changes;
 }
Ejemplo n.º 5
0
 public string CopyToModel(PropertyInfo vm, object model, PropertyInfo[] modelProps, bool track)
 {
     var ckf = vm.GetAttribute<FieldInfoAttribute>().CheckboxField;
     var ckpi = modelProps.Single(mm => mm.Name == ckf);
     if (track)
     {
         var changes = new StringBuilder();
         model.UpdateValue(changes, vm.Name, Address);
         model.UpdateValue(changes, ckf, Send);
         return changes.ToString();
     }
     var ci = modelProps.FirstOrDefault(ss => ss.Name == vm.Name);
     Debug.Assert(ci != null, "ci != null");
     ci.SetValue(model, Address, null);
     ckpi.SetValue(model, Send, null);
     return string.Empty;
 }