/// <summary>
        /// Creates a new strategy for creating an instance of the specified type.
        /// </summary>
        /// <param name="requireAuthorisation">A flag indicating whether the strategy requires the current user to be authorised.</param>
        static public ICreateStrategy New <T>(bool requireAuthorisation)
        {
            ICreateStrategy strategy = New <T>();

            strategy.RequireAuthorisation = requireAuthorisation;
            return(strategy);
        }
示例#2
0
        /// <summary>
        /// Creates a new strategy for creating an instance of the specified type.
        /// </summary>
        /// <param name="typeName">The short name of the type involved in the strategy.</param>
        static public ICreateStrategy New(bool requiresAuthorisation)
        {
            ICreateStrategy strategy = StrategyState.Strategies.Creator.NewCreator("ISubEntity");

            strategy.RequireAuthorisation = requiresAuthorisation;

            return(strategy);
        }
        /// <summary>
        /// Creates a new strategy for creating an instance of the specified type.
        /// </summary>
        /// <param name="typeName">The short name of the type involved in the strategy.</param>
        static public ICreateStrategy New(string typeName, bool requiresAuthorisation)
        {
            ICreateStrategy strategy = StrategyState.Strategies.Creator.NewCreator(typeName);

            strategy.RequireAuthorisation = requiresAuthorisation;

            return(strategy);
        }
示例#4
0
 public StopOrderCreator(ICreateStrategy strategy)
 {
     _strategy = strategy;
 }
        public void Test_New()
        {
            ICreateStrategy strategy = CreateStrategy.New("TestArticlePage", false);

            Assert.IsTrue(strategy is CreateSubEntityStrategy, "Wrong strategy type returned.");
        }