Exemplo n.º 1
0
        /// <summary>
        ///     Initialises a new instance of the <see cref="TvShows" /> class.
        /// </summary>
        public TvShows()
        {
            InitializeComponent();

            tvShowRepository  = CompositionRoot.Get <ITvShowRepository>();
            fileResultManager = CompositionRoot.Get <IFileResultManager>();
        }
Exemplo n.º 2
0
        /// <summary>
        /// The main.
        /// </summary>
        /// <param name="args">The args.</param>
        public static void Main(string[] args)
        {
            var command1 = new SampleCommand
            {
                FirstName = "Brian",
                LastName  = "Korzynski"
            };

            var command2 = new SampleCommand2
            {
                Username = "******",
                Password = "******"
            };

            //var handler = new SampleCommandHandler();
            //handler.Handle(command);

            var commandBus = CompositionRoot.Get <ICommandBus>();

            commandBus.Send(command1);
            commandBus.Send(command2);

            Console.ReadKey();

            //ConcurrentDictionary
            //Retry Logic
            //Logging
            //CommandTranslation (take one command and process it then create another command to pass to another command)
            //Validation: ICommandValidator (mine wording), ValidationFailure
            //Different assemblies
            //Queries
            //Queue: persist messages to queue
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Initialises a new instance of the <see cref="SortEpisodes" /> class.
        /// </summary>
        public SortEpisodes()
        {
            InitializeComponent();
            setEpisodeButton.Enabled = false;
            setShowButton.Enabled    = false;

            fileResultManager = CompositionRoot.Get <IFileResultManager>();
        }
Exemplo n.º 4
0
 /// <summary>
 ///     Handles the tab loading.
 /// </summary>
 /// <param name="sender">
 ///     The sender of the event.
 /// </param>
 /// <param name="e">
 ///     The arguments of the event.
 /// </param>
 private void SortEpisodesLoad(object sender, EventArgs e)
 {
     if (!DesignMode)
     {
         controller = CompositionRoot.Get <SortEpisodesController>();
         controller.PropertyChanged += ControllerOnPropertyChanged;
         controller.Initialise(this);
     }
 }
Exemplo n.º 5
0
        public static async Task Main(string[] args)
        {
            CompositionRoot root = new CompositionRoot();

            root.Start();

            ICompanyNewsSearcher companyNewsSearcher = root.Get();

            IList <string> companyNewsDownloads = await companyNewsSearcher.Filter();
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            var mediator = CompositionRoot.Get <IMediator>();

            var getCustomerQuery = new GetCustomerById.Query {
                Id = Guid.Parse("E4931718-A149-4C17-8545-5D36D81A6DD5")
            };

            var customer = mediator.Send(getCustomerQuery).Result;
        }
Exemplo n.º 7
0
 /// <summary>
 ///     Handles the TV Shows tab loading.
 /// </summary>
 /// <param name="sender">
 ///     The sender of the event.
 /// </param>
 /// <param name="e">
 ///     The arguments of the event.
 /// </param>
 private void TvShowsLoad(object sender, EventArgs e)
 {
     if (!DesignMode)
     {
         controller = CompositionRoot.Get <TvShowsController>();
         controller.PropertyChanged     += PropertyChanged;
         controller.ShowChanged         += ShowChanged;
         controller.SearchShowsComplete += SearchShowsComplete;
         controller.Initialise(this);
     }
 }
Exemplo n.º 8
0
 /// <summary>
 ///     The missing duplicate episodes load.
 /// </summary>
 /// <param name="sender">
 ///     The sender of the event.
 /// </param>
 /// <param name="e">
 ///     The arguments of the event.
 /// </param>
 private void MissingDuplicateEpisodesLoad(object sender, EventArgs e)
 {
     if (!DesignMode)
     {
         controller = CompositionRoot.Get <MissingDuplicateController>();
         controller.PropertyChanged += OnPropertyChanged;
         controller.Initialise(this);
         hideLocked.Checked       = controller.Settings.HideLocked;
         hidePart2.Checked        = controller.Settings.HidePart2;
         hideSeason0.Checked      = controller.Settings.HideSeason0;
         hideUnaired.Checked      = controller.Settings.HideNotYetAired;
         hideWholeSeasons.Checked = controller.Settings.HideMissingSeasons;
     }
 }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            var commandBus         = CompositionRoot.Get <ICommandBus>();
            var customerRepository = CompositionRoot.Get <ICustomerRepository>();

            var customer = customerRepository.GetById(1);

            Console.WriteLine(customer.ToJson());

            commandBus.Send(new InactivateCustomerCommand(customer));

            var updatedCustomer = customerRepository.GetById(1);

            Console.WriteLine(updatedCustomer.ToJson());

            Console.ReadKey();
        }
Exemplo n.º 10
0
        public void Setup()
        {
            var container = CompositionRoot.Get();

            _watcher = container.Resolve <IWatcher>();
        }
 public void Setup()
 {
     Mediator = CompositionRoot.Get <IMediator>();
 }
Exemplo n.º 12
0
 /// <summary>
 ///     Initialises a new instance of the <see cref="Log" /> class.
 /// </summary>
 public Log()
 {
     InitializeComponent();
     controller = CompositionRoot.Get <LogController>();
 }
Exemplo n.º 13
0
 static Program()
 {
     CommandBus = CompositionRoot.Get <ICommandBus>();
 }
Exemplo n.º 14
0
 public void Setup()
 {
     QueryRepository = CompositionRoot.Get <ICustomerQueryRepository>();
     Mediator        = CompositionRoot.Get <IMediator>();
 }
Exemplo n.º 15
0
        /// <summary>
        ///     Initialises a new instance of the <see cref="Settings" /> class.
        /// </summary>
        public Settings()
        {
            InitializeComponent();

            fileResultManager = CompositionRoot.Get <FileResultManager>();
        }