Beispiel #1
0
 public override void WrapUp()
 {
     _defaultVal = _defaultVal.Select(x => FormKeySettingsVM.StripOrigin(x)).ToArray();
     Values.SetTo(_defaultVal.Select(x =>
     {
         return(new ListElementWrapperVM <FormKey, FormKeySettingsVM>(new FormKeySettingsVM()
         {
             Value = x
         }));
     }));
 }
Beispiel #2
0
 public EnumerableFormKeySettingsVM(
     FieldMeta fieldMeta,
     IEnumerable <FormKey> defaultVal)
     : base(
         fieldMeta,
         get: e => TryGet <IBasicSettingsNodeVM> .Succeed(
             new ListElementWrapperVM <FormKey, FormKeySettingsVM>(new FormKeySettingsVM()
 {
     Value = FormKeySettingsVM.Import(e)
 })),
         add: coll => coll.Add(new ListElementWrapperVM <FormKey, FormKeySettingsVM>(new FormKeySettingsVM()
 {
     Value = FormKey.Null
 })
 {
     IsSelected = true
 }))
 {
     _defaultVal = defaultVal.ToArray();
 }
        public override void WrapUp()
        {
            _defaultVal = _defaultVal.Select(x => FormKeySettingsVM.StripOrigin(x)).ToArray();
            Values.SetTo(_defaultVal.Select(x =>
            {
                return(new FormKeyItemViewModel(x));
            }));

            if (LoquiRegistration.TryGetRegisterByFullName(_typeName, out var regis))
            {
                ScopedTypes = regis.GetterType.AsEnumerable();
            }
            else if (LinkInterfaceMapping.TryGetByFullName(_typeName, out var interfType))
            {
                ScopedTypes = interfType.AsEnumerable();
            }
            else
            {
                throw new ArgumentException($"Can't create a formlink control for type: {_typeName}");
            }
        }
Beispiel #4
0
 public override void Persist(JObject obj, Action <string> logger)
 {
     obj[Meta.DiskName] = new JArray(Values.Select(x => FormKeySettingsVM.Persist(((FormKeySettingsVM)x.Value).Value)).ToArray());
 }
Beispiel #5
0
 public override void WrapUp()
 {
     _defaultVal = FormKeySettingsVM.StripOrigin(_defaultVal);
     Value       = FormKeySettingsVM.StripOrigin(Value);
     base.WrapUp();
 }
Beispiel #6
0
 public override void Persist(JObject obj, Action <string> logger)
 {
     obj[Meta.DiskName] = JToken.FromObject(FormKeySettingsVM.Persist(Value));
 }
Beispiel #7
0
 public override void Import(JsonElement property, Action <string> logger)
 {
     Value = FormKeySettingsVM.Import(property);
 }