/// <exception cref="ArgumentNullException">any argument is null</exception>
 public CipherFormPresenter(ICipherForm cipherForm,
                            IList <FileSystemEntity> inputFileEntities,
                            IRsaFactory rsaFactory,
                            KeySerializer keySerializer,
                            ICommandsContainer commandsContainer,
                            IFileUnifier fileUnifier,
                            IEnvironmentHelper environmentHelper,
                            IMessageHelper messageHelper,
                            Options options)
 {
     Checker.CheckNull(cipherForm, keySerializer, commandsContainer);
     this.cipherForm                   = cipherForm;
     this.inputFileEntities            = inputFileEntities;
     this.rsaFactory                   = rsaFactory;
     this.keySerializer                = keySerializer;
     this.commandsContainer            = commandsContainer;
     this.fileUnifier                  = fileUnifier;
     this.environmentHelper            = environmentHelper;
     this.messageHelper                = messageHelper;
     this.options                      = options;
     cipherForm.InputFileEntities      = inputFileEntities;
     cipherForm.TotalLength            = GetTotalLength();
     cipherForm.OutputFileName         = GetOutputFileName();
     cipherForm.ZipСompression         = options.ZipСompression;
     cipherForm.Cipher                += cipherForm_Cipher;
     cipherForm.CancelCipher          += cipherForm_CancelCipher;
     cipherForm.OutputFileNameChanged += cipherForm_OutputFileNameChanged;
     cipherForm.PublicKeyChanged      += cipherForm_PublicKeyChanged;
 }
Exemple #2
0
 /// <exception cref="ArgumentNullException">any argument is null</exception>
 /// <exception cref="ArgumentException">defaultDirectory is empty</exception>
 public FilesViewPresenter(IFilesView filesView,
                           IToolBarView toolBarView,
                           IAddressToolBar addressToolBar,
                           ICommandsContainer commandsContainer,
                           IEnvironmentHelper environmentHelper,
                           Options options,
                           IMessageHelper messageHelper)
 {
     Checker.CheckNull(filesView, toolBarView, addressToolBar, commandsContainer, environmentHelper);
     this.filesView         = filesView;
     this.toolBarView       = toolBarView;
     this.addressToolBar    = addressToolBar;
     this.commandsContainer = commandsContainer;
     this.environmentHelper = environmentHelper;
     this.options           = options;
     this.messageHelper     = messageHelper;
     sorter = FileSorter.CreateSorter(options.InitialSortColumn, options.InitialSortDirection);
     filesView.SortByName            += view_SortByName;
     filesView.SortByLength          += ViewSortByLength;
     filesView.SortByType            += view_SortByType;
     filesView.SortByModifiedDate    += ViewSortByModifiedDate;
     filesView.OpenDirectory         += view_OpenDirectory;
     filesView.Cipher                += view_Cipher;
     filesView.Decipher              += view_Decipher;
     filesView.ToUpperDirectory      += view_ToUpperDirectory;
     filesView.SelectedEntityChanged += view_SelectedEntityChanged;
     addressToolBar.PathChanged      += addressToolBar_PathChanged;
 }
 public ToolBarPresenter(IToolBarView toolBarView, ICommandsContainer commandsContainer)
 {
     this.commandsContainer        = commandsContainer;
     toolBarView.ToUpperDirectory += toolBarView_ToUpperDirectory;
     toolBarView.RefreshDirectory += toolBarView_RefreshDirectory;
     toolBarView.Cipher           += toolBarView_Cipher;
     toolBarView.Decipher         += toolBarView_Decipher;
     toolBarView.GenerateKeys     += toolBarView_GenerateKeys;
 }
Exemple #4
0
 /// <exception cref="ArgumentNullException">commandsContainer is null</exception>
 public DecipherCommand(ICommandsContainer commandsContainer,
                        IFilesView filesView,
                        IRsaFactory rsaFactory,
                        IEnvironmentHelper environmentHelper,
                        IFormFactory formFactory,
                        IMessageHelper messageHelper,
                        IFileUnifier fileUnifier)
 {
     Checker.CheckNull(commandsContainer);
     this.commandsContainer = commandsContainer;
     this.filesView         = filesView;
     this.rsaFactory        = rsaFactory;
     this.environmentHelper = environmentHelper;
     this.formFactory       = formFactory;
     this.messageHelper     = messageHelper;
     this.fileUnifier       = fileUnifier;
 }
 public MainMenuPresenter(IMainMenuView mainMenuView,
                          ICommandsContainer commandsContainer,
                          Options options,
                          IFormFactory formFactory)
 {
     this.mainMenuView             = mainMenuView;
     this.commandsContainer        = commandsContainer;
     this.options                  = options;
     this.formFactory              = formFactory;
     mainMenuView.Cipher          += mainMenuView_Cipher;
     mainMenuView.Decipher        += mainMenuView_Decipher;
     mainMenuView.GenerateKeys    += mainMenuView_GenerateKeys;
     mainMenuView.Exit            += mainMenuView_Exit;
     mainMenuView.AboutProgram    += mainMenuView_AboutProgram;
     mainMenuView.Properties      += mainMenuView_Properties;
     mainMenuView.LanguageChanged += mainMenuView_LanguageChanged;
     mainMenuView.Language         = options.Language;
 }
        public MainFormPresenter(IMainForm mainForm,
                                 Options options,
                                 IEnvironmentHelper environmentHelper,
                                 ICommandsContainer commandsContainer,
                                 IMessageHelper messageHelper,
                                 IFormFactory formFactory)
        {
            new MainMenuPresenter(mainForm.MainMenu, commandsContainer, options, formFactory);
            var filesViewPresenter = new FilesViewPresenter(mainForm.FilesView,
                                                            mainForm.ToolBar,
                                                            mainForm.AddressToolBar,
                                                            commandsContainer,
                                                            environmentHelper,
                                                            options,
                                                            messageHelper);

            commandsContainer.SetFilesViewPresenter(filesViewPresenter);
            commandsContainer.RefreshDirectoryCommand.Execute();
            new ToolBarPresenter(mainForm.ToolBar, commandsContainer);
            commandsContainer.ChangeLanguageCommand.Execute();
        }
Exemple #7
0
        public Dispatcher(ICommandsContainer commandsContainer,
                          IServiceProvider serviceProvider,
                          IUserContextProvider userContextProvider,
                          ICacheProvider cacheProvider,
                          ILogger <Dispatcher> logger)
        {
            this.commandsContainer   = commandsContainer;
            this.serviceProvider     = serviceProvider;
            this.userContextProvider = userContextProvider;
            this.cacheProvider       = cacheProvider;
            this.logger = logger;

            userResponseHandlers = new Dictionary <UserTemporaryStatus, Func <Task> >
            {
                { UserTemporaryStatus.Default, ThrowCommandExecutingExceptionAsync },
                { UserTemporaryStatus.ChoosingHookah, ExecuteCommandAsync <GetHookahCommand> },
                { UserTemporaryStatus.ChoosingTobacco, ExecuteCommandAsync <GetTobaccoCommand> },
                { UserTemporaryStatus.AskedForTobaccoPhotos, ExecuteCommandAsync <SetTobaccoPhotosCommand> },
                { UserTemporaryStatus.AskedForHookahPhotos, ExecuteCommandAsync <SetHookahPhotosCommand> }
            };
        }
 /// <exception cref="ArgumentNullException">any argument is null</exception>
 public DecipherFormPresenter(IDecipherForm form,
                              IRsaFactory rsaFactory,
                              KeySerializer keySerializer,
                              ICommandsContainer commandsContainer,
                              FileSystemEntity initialFile,
                              IEnvironmentHelper environmentHelper,
                              IMessageHelper messageHelper,
                              IFileUnifier fileUnifier)
 {
     Checker.CheckNull(form, rsaFactory, keySerializer, commandsContainer, initialFile);
     this.form                   = form;
     this.rsaFactory             = rsaFactory;
     this.keySerializer          = keySerializer;
     this.commandsContainer      = commandsContainer;
     this.environmentHelper      = environmentHelper;
     this.messageHelper          = messageHelper;
     this.fileUnifier            = fileUnifier;
     form.OutputDirectoryPath    = GetOutputDirectoryPath(initialFile);
     form.Decipher              += form_Decipher;
     form.CancelDecipher        += form_CancelDecipher;
     form.OutputFileNameChanged += form_OutputFileNameChanged;
     form.PrivateKeyChanged     += form_PrivateKeyChanged;
 }
Exemple #9
0
 public ItemsCommand(WordprocessingDocument wordDocument, RenderData renderData)
 {
     this.renderData   = renderData;
     WordDocument      = wordDocument;
     CommandsContainer = new CommandsContainer();
 }
Exemple #10
0
 public MessageController(TelegramBotClient bot, ICommandsContainer container)
 {
     _bot         = bot;
     commandsDict = container.GetCommands();
 }
Exemple #11
0
 protected RouteItemBase(IViewContainer container, ICommandsContainer commandsContainer, bool viewModelCashed)
 {
     Container = container;
     CommandsContainer = commandsContainer;
     ViewModelCashed = viewModelCashed;
 }
Exemple #12
0
 public TableOfContentsPageCommand(WordprocessingDocument document, RenderData renderData)
 {
     this.renderData   = renderData;
     CommandsContainer = new CommandsContainer();
     WordDocument      = document;
 }