Пример #1
0
//		private IBackgroundWorkerHelper backgroundWorkerHelper;

        public TestHelperFactory()
        {
            winHelperFactory = new WinHelperFactory();

            messageHelper = new TestMessageHelper();
//			redirectHelper = winHelperFactory.RedirectHelper;
            redirectHelper = new TestRedirectHelper();
            pathHelper     = winHelperFactory.PathHelper;
        }
Пример #2
0
        public TestsController(ITestService testService, IHelperFactory helperFactory, IViewModelFactory viewModelFactory)
        {
            Guard.WhenArgument(testService, "TestService cannot be null").IsNull().Throw();
            Guard.WhenArgument(helperFactory, "HelperFactory cannot be null").IsNull().Throw();
            Guard.WhenArgument(viewModelFactory, "ViewModelFactory cannot be null").IsNull().Throw();

            this.testService      = testService;
            this.helperFactory    = helperFactory;
            this.viewModelFactory = viewModelFactory;
        }
Пример #3
0
        /// <summary>
        /// Creates a new instance of <see cref="AboutViewModel"/>.
        /// </summary>
        /// <param name="windowManager"></param>
        /// <param name="fileAdapter"></param>
        /// <param name="assemblyAdapter"></param>
        public AboutViewModel(IWindowManager windowManager, IHelperFactory helperFactory)
        {
            if (windowManager == null)
            {
                throw new ArgumentNullException("windowManager");
            }
            if (helperFactory == null)
            {
                throw new ArgumentNullException("helperFactory");
            }

            m_windowManager   = windowManager;
            m_assemblyAdapter = helperFactory.BuildAssemblyAdapter();
            m_fileAdapter     = helperFactory.BuildFileAdapter();
        }
Пример #4
0
        /// <summary>
        /// Creates a new instance of <see cref="ReggieBasicViewModel"/>.
        /// </summary>
        /// <param name="windowManager"></param>
        public ReggieBasicViewModel(IWindowManager windowManager, IHelperFactory helperFactory)
        {
            if (windowManager == null)
            {
                throw new ArgumentNullException("windowManager");
            }
            if (helperFactory == null)
            {
                throw new ArgumentNullException("helperFactory");
            }

            m_windowManager   = windowManager;
            m_helperFactory   = helperFactory;
            m_fileAdapter     = helperFactory.BuildFileAdapter();
            m_assemblyAdapter = helperFactory.BuildAssemblyAdapter();
            m_persistence     = helperFactory.BuildPersistenceService();

            base.DisplayName = m_displayName;
        }
Пример #5
0
        public TestUtility(IRepository <Test> testRepository,
                           IRepository <AnsweredQuestion> answeredQuestionRepository,
                           ITestFactory testFactory,
                           IHelperFactory helperFactory,
                           IDateTimeProvider dateTimeProvider,
                           IUnitOfWork unitOfWork)
        {
            Guard.WhenArgument(testRepository, "testRepository cannot be null").IsNull().Throw();
            Guard.WhenArgument(answeredQuestionRepository, "answeredQuestionRepository cannot be null").IsNull().Throw();
            Guard.WhenArgument(testFactory, "testFactory cannot be null").IsNull().Throw();
            Guard.WhenArgument(helperFactory, "helperFactory cannot be null").IsNull().Throw();
            Guard.WhenArgument(dateTimeProvider, "dateTimeProvider cannot be null").IsNull().Throw();
            Guard.WhenArgument(unitOfWork, "unitOfWork cannot be null").IsNull().Throw();

            this.testRepository             = testRepository;
            this.answeredQuestionRepository = answeredQuestionRepository;
            this.testFactory      = testFactory;
            this.helperFactory    = helperFactory;
            this.dateTimeProvider = dateTimeProvider;
            this.unitOfWork       = unitOfWork;
        }
Пример #6
0
		/// <summary>
		/// Sets the engine context. Also initialize all required services by querying
		/// <see cref="IEngineContext.Services"/>
		/// </summary>
		/// <param name="engineContext">The engine context.</param>
		public virtual void SetEngineContext(IEngineContext engineContext)
		{
			this.engineContext = engineContext;

			helperFactory = engineContext.Services.HelperFactory; // should not be null
			serviceInitializer = engineContext.Services.ServiceInitializer; // should not be null
			filterFactory = engineContext.Services.FilterFactory; // should not be null
			viewEngineManager = engineContext.Services.ViewEngineManager; // should not be null
			actionSelector = engineContext.Services.ActionSelector; // should not be null
			scaffoldSupport = engineContext.Services.ScaffoldingSupport; // might be null
			dynamicActionProviderFactory = engineContext.Services.DynamicActionProviderFactory; // should not be null
		}
Пример #7
0
 /// <summary>
 ///    Registers an implementation of IHelperFactory to be used when creating new instances of Type T.
 /// </summary>
 /// <param name="helper">Instance of IHelperFactory.</param>
 /// <typeparam name="T">Type that the IHelperFactory will create.</typeparam>
 public static void RegisterHelper <T>(IHelperFactory helper)
 {
     Helpers[typeof(T)] = helper;
 }
Пример #8
0
 public OrderProcessingHelper(IHelperFactory helperFactory)
 {
     _helperFactory = helperFactory;
 }