예제 #1
0
 static BasePropDesigner GetPropDesigner(Type type, object target, NPropertyGrid grid)
 {
     foreach (var avaliable in AvaliableEditors)
     {
         if (avaliable.Name != "BasePropDesigner`1")
         {
             var ins     = (BasePropDesigner)Activator.CreateInstance(avaliable, new object[] { target });
             var ___grid = CSEMainClass.FindField(ins, "stastsstagrid");
             ___grid.SetValue(ins, grid);
             if (ins.Type == type)
             {
                 return(ins);
             }
             if (ins.UseForInheritedTypes)
             {
                 Type bas = type.BaseType;
                 while (bas != null)
                 {
                     if (ins.Type == bas)
                     {
                         return(ins);
                     }
                     bas = bas.BaseType;
                 }
             }
         }
     }
     return(null);
 }
예제 #2
0
        public RuntimeField(object instance, string fieldName)
        {
            Instance = instance;
            var field = CSEMainClass.FindField(instance, fieldName);

            if (field != null)
            {
                Field = field;
            }
            else
            {
                //throw new Exception($"The Field {fieldName},in {instance},has not found!!!");
            }
        }