Esempio n. 1
0
        private void FollowObjectReference(IValueHolder prop)
        {
            var refe = prop.Value as NdfObjectReference;

            if (refe == null)
            {
                return;
            }

            var vm = new NdfClassViewModel(refe.Class, null);

            NdfObjectViewModel inst = vm.Instances.SingleOrDefault(x => x.Id == refe.InstanceId);

            if (inst == null)
            {
                return;
            }

            vm.InstancesCollectionView.MoveCurrentTo(inst);

            DialogProvider.ProvideView(vm);
        }
 private void GetValue(IValueHolder valueHolder, NdfObjectViewModel inst, List<NdfPropertyValue> result, NdfPropertyValue propertyValue)
 {
     switch (valueHolder.Value.Type)
     {
         case NdfType.ObjectReference:
             var ndfObjectReference = valueHolder.Value as NdfObjectReference;
             if (ndfObjectReference != null && ndfObjectReference.InstanceId == inst.Object.Id)
                 result.Add(propertyValue);
             break;
         case NdfType.List:
         case NdfType.MapList:
             var ndfCollection = valueHolder.Value as NdfCollection;
             if (ndfCollection != null)
                 foreach (var col in ndfCollection)
                     GetValue(col, inst, result, propertyValue);
             break;
         case NdfType.Map:
             var map = valueHolder.Value as NdfMap;
             if (map != null)
             {
                 GetValue(map.Key, inst, result, propertyValue);
                 GetValue(map.Value as IValueHolder, inst, result, propertyValue);
             }
             break;
     }
 }