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); }
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); }