/// <summary> /// Creates a new strategy for activating the specified type. /// </summary> /// <param name="typeName">The short name of the type involved in the strategy.</param> /// <param name="requiresAuthorisation">A value indicating whether the strategy requires authorisation.</param> /// <returns></returns> static public IActivateStrategy New(string typeName, bool requiresAuthorisation) { IActivateStrategy strategy = StrategyState.Strategies.Creator.NewActivator(typeName); strategy.RequireAuthorisation = requiresAuthorisation; return(strategy); }
/// <summary> /// Creates a new strategy for activating the specified type. /// </summary> /// <param name="entity">The entity involved in the strategy.</param> /// <param name="requiresAuthorisation">A value indicating whether the strategy requires authorisation.</param> /// <returns></returns> static public IActivateStrategy New(IEntity entity, bool requiresAuthorisation) { if (entity == null) { throw new ArgumentNullException("entity"); } IActivateStrategy strategy = StrategyState.Strategies.Creator.NewActivator(entity.ShortTypeName); strategy.RequireAuthorisation = requiresAuthorisation; return(strategy); }