예제 #1
0
 public object InvokeMethod(MethodProperties methodProperties)
 {
     object[] parameters = new object[this.methodInfo.GetParameters().Length];
     int i = 0;
     foreach (object propInfo in methodProperties.GetProperties() )
     {
         MethodParameterTypeDescriptor param = propInfo as MethodParameterTypeDescriptor;
         if (param != null)
         {
             parameters[i] = param.Value ;
             i++;
         }
     }
     return this.methodInfo.Invoke(this.Obj, parameters);
 }
예제 #2
0
 private void SelectMethod(MethodTreeNode methodTreeNode)
 {
     if (objectPropertyGrid.SelectedObject != null)
     {
         MethodProperties selectedMethodProperties = objectPropertyGrid.SelectedObject as MethodProperties;
         if (selectedMethodProperties != null)
         {
             if (selectedMethodProperties.Obj == methodTreeNode.Obj)
             {
                 if (selectedMethodProperties.Signature == methodTreeNode.Text)
                 {
                     return;
                 }
             }
         }
     }
     MethodProperties properties = new MethodProperties(Context, methodTreeNode.Obj,  methodTreeNode.MethodInfo) ;
     objectPropertyGrid.SelectedObject = properties;
 }