Exemple #1
0
        public ModelInfo(Expression <Func <object> > rootObject, string name, bool nonClosable)
        {
            this.name        = name;
            this.NonClosable = nonClosable;

            this.rootObjectAdapter = this.CreatePropertyAdapter(
                nameof(ModelInfo.RootObject),
                rootObject
                );

            this.rootAdapter = this.CreatePropertyAdapter(
                nameof(ModelInfo.Root),
                () => ModelNodeBase.GetNode(this.RootObject)
                );
        }
 private void UpdateNode()
 {
     if (this.propertyInfo.GetIndexParameters().Any())
     {
         //Ignore indexer for the moment
         this.SetAndInvoke(nameof(this.Value), ref this.value, null);
     }
     else
     {
         object Value;
         try
         {
             Value = this.propertyInfo.GetValue(this.owner, null);
         }
         catch (Exception Exception)
         {
             Value = Exception;
         }
         this.SetAndInvoke(nameof(this.Value), ref this.value, ModelNodeBase.GetNode(Value));
     }
 }
 private EnumerationItemNode(object value, int index)
 {
     this.value = ModelNodeBase.GetNode(value);
     this.Name  = $"[{index}]";
 }