コード例 #1
0
 public Type GetObjectType()
 {
     System.Reflection.FieldInfo fInfo = TargetType.GetField(TargetField, BindingFlags.Static | BindingFlags.Public);
     if (fInfo == null)
     {
         throw new MissingFieldException(TargetType.ToString(), TargetField);
     }
     return(fInfo.FieldType);
 }
コード例 #2
0
 private void FindAndSetTarget(Type targetType, string methodOrField = null)
 {
     TargetType = TargetAssembly.MainModule.GetType(targetType.FullName);
     if (string.IsNullOrWhiteSpace(methodOrField))
     {
         return;
     }
     TargetMethod = TargetType.GetMethod(methodOrField);
     if (TargetMethod != null)
     {
         return;
     }
     TargetField = TargetType.GetField(methodOrField);
 }