/// <summary> /// Creates the Prop Rule for. /// </summary> /// <returns></returns> protected IPropRule CreatePropRule() { if (!string.IsNullOrEmpty(_class) && !string.IsNullOrEmpty(_assembly)) { Type customPropRuleType = null; TypeLoader.LoadClassType(ref customPropRuleType, _assembly, _class, "PropRuleBase Subclass", "Property Rule Definition"); if (customPropRuleType.IsSubclassOf(typeof(PropRuleBase))) { try { return((PropRuleBase)Activator.CreateInstance(customPropRuleType, new object[] { _name, _message })); } catch (MissingMethodException) { return((PropRuleBase)Activator.CreateInstance(customPropRuleType, new object[] { _name, _message, _ruleParameters })); } } throw new TypeLoadException("The prop rule '" + _name + "' must inherit from PropRuleBase."); } var propRule = CreatePropRule(_propTypeName, _name, _message); if (propRule != null) { return(propRule); } throw new InvalidXmlDefinitionException("Could not load the Property Rule " + "for this type('" + _propTypeName + "')."); }
/// <summary> /// Creates a <see cref="RelatedBusinessObjectCollection{TBusinessObject}"/> with boType as its type parameter, using the Activator. /// </summary> /// <param name="boClassName"></param> /// <param name="relationship">The relationship that this <see cref="RelatedBusinessObjectCollection{TBusinessObject}"/> is the collection for</param> /// <param name="boAssemblyName"></param> /// <returns>The instantiated <see cref="RelatedBusinessObjectCollection{TBusinessObject}"/></returns> private static IBusinessObjectCollection CreateNewRelatedBusinessObjectCollection(string boAssemblyName, string boClassName, IRelationship relationship) { Type classType = null; TypeLoader.LoadClassType(ref classType, boAssemblyName, boClassName, "related object", "relationship definition"); return(CreateNewRelatedBusinessObjectCollection(classType, relationship)); }