public PolicyInfo(Type policyType) { MethodInfo getPolicy = policyType.GetMethod("GetPolicy", BindingFlags.Static | BindingFlags.Public); if (getPolicy == null || getPolicy.GetParameters().Length > 0) { throw new ArgumentException("NodePolicy type must have public static GetPolicy method.", "policyType"); } GetNodePolicy = (GetNodePolicyDelegate)Delegate.CreateDelegate(typeof(GetNodePolicyDelegate), getPolicy); }
public PolicyInfo( Type policyType ) { MethodInfo getPolicy = policyType.GetMethod( "GetPolicy", BindingFlags.Static | BindingFlags.Public ); if( getPolicy == null || getPolicy.GetParameters().Length > 0 ) throw new ArgumentException( "NodePolicy type must have public static GetPolicy method.", "policyType" ); GetNodePolicy = (GetNodePolicyDelegate)Delegate.CreateDelegate( typeof( GetNodePolicyDelegate ), getPolicy ); }