示例#1
0
 public void Pair(IValueElement element, MemberInfo mi)
 {
     element.SelfChanged += _ => UpdatePreset();
     OnSetPreset         += t =>
     {
         element.SetValue(mi.GetValue(t));
     };
 }
示例#2
0
        private void HandleDateTimeOffsetChange(IValueElement castedSender)
        {
            var castedSenderDateTime = (ValueElementDateTime)castedSender;

            if (castedSenderDateTime.IsDateTimeOffset)
            {
                var            utcTime1 = DateTime.SpecifyKind(castedSenderDateTime.Data, DateTimeKind.Utc);
                DateTimeOffset utcTime2 = utcTime1;
                EncapsulatedDto.SetPropertyValue(castedSender.RawName, utcTime2);
            }
            else
            {
                EncapsulatedDto.SetPropertyValue(castedSender.RawName, castedSenderDateTime.Data);
            }
        }
示例#3
0
 public void SetPreset(IValueElement self) => SetPreset((string)self.Value);