Exemple #1
0
        public IndexModel(MyInterface _i)
        {
            _interface = _i;
            List <Type> types = new List <Type> {
                typeof(int), typeof(string)
            };                                                                 //определение типов свойств

            _i.SetTypes(types);

            _obj          = new MyObject();
            vm            = new ViewModel();
            vm.Name       = _obj.GetType().Name;
            vm.Properties = _interface.MyGetProperties(_obj);
        }
Exemple #2
0
 public void OnPost(Dictionary <string, string> properties)
 {
     foreach (var p in properties)
     {
         foreach (var t in vm.Properties)
         {
             foreach (var i in t.Value.ToList())
             {
                 if (p.Key == i.Key.Name)
                 {
                     vm.Properties[t.Key][i.Key] = p.Value;
                 }
             }
         }
     }
     _interface.MySetProperties(_obj, vm.Properties);
     vm.Name       = _obj.GetType().Name;
     vm.Properties = _interface.MyGetProperties(_obj);
 }