public void Pair(IValueElement element, MemberInfo mi) { element.SelfChanged += _ => UpdatePreset(); OnSetPreset += t => { element.SetValue(mi.GetValue(t)); }; }
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); } }
public void SetPreset(IValueElement self) => SetPreset((string)self.Value);