Ejemplo n.º 1
0
        // --- OPEN FOLDER
        void MsgOpenFolder_Handler(GenericMessageAction <MsgSelectFolder, string> msg) //MsgSelectFolder msg)
        {
            System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog();

            fbd.Description = msg.Data.Description;

            if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                msg.Execute(fbd.SelectedPath);
            }
        }
Ejemplo n.º 2
0
        // --- OPEN FILE
        void MsgOpenFile_Handler(GenericMessageAction <MsgOpenFile, MsgOpenFile> msg)
        {
            MsgOpenFile data = msg.Data;

            FileDialogResult r = DialogController.ShowOpenFileDialog(data.Multiselect);

            data.FileName  = r.FileName;
            data.FileNames = r.FileNames;
            data.NewFile   = r.CommonDialogReturn;
            msg.Execute(data);
        }
        private void MsgShowEnterPassword_Handler(GenericMessageAction <MsgShowEnterPassword, string> msg)
        {
            WndEnterPassword          wndEnterPassword          = new WndEnterPassword();
            WndEnterPasswordViewModel wndEnterPasswordViewModel = new WndEnterPasswordViewModel(msg.Data.Document);

            wndEnterPassword.DataContext = wndEnterPasswordViewModel;
            ShowWindow(wndEnterPassword, true);

            string ret = wndEnterPasswordViewModel.ReturnValue as string;

            msg.Execute(ret);
        }
        private void MsgShowConfirmPassword_Handler(GenericMessageAction <MsgShowConfirmPassword, bool> msg)
        {
            WndConfirmPassword          wndConfirmPassword          = new WndConfirmPassword();
            WndConfirmPasswordViewModel wndConfirmPasswordViewModel = new WndConfirmPasswordViewModel(msg.Data.PasswordType, msg.Data.OriginalPassword);

            wndConfirmPassword.DataContext = wndConfirmPasswordViewModel;
            ShowWindow(wndConfirmPassword, true);

            bool ret = wndConfirmPasswordViewModel.ReturnValue == null ? false : (bool)wndConfirmPasswordViewModel.ReturnValue;

            msg.Execute(ret);
        }
        // --- SECURITY
        void MsgShowSecurity_Handler(GenericMessageAction <MsgShowSecurity, MsgOpenFile> msg)
        {
            WndSecurity          wndSecurity          = new WndSecurity();
            WndSecurityViewModel wndSecurityViewModel = new WndSecurityViewModel(msg.Data.Document);

            wndSecurity.DataContext = wndSecurityViewModel;
            ShowWindow(wndSecurity, true);

            string tempFile = wndSecurityViewModel.ReturnValue as string;

            msg.Execute(new MsgOpenFile(tempFile));
        }
        // --- MERGE DOCUMENTS
        void MsgShowMergeDocuments_Handler(GenericMessageAction <MsgShowMergeDocuments, MsgOpenFile> msg)
        {
            WndMergeDocuments          wndMergeDocuments          = new WndMergeDocuments();
            WndMergeDocumentsViewModel wndMergeDocumentsViewModel = new WndMergeDocumentsViewModel(msg.Data.FilesToMerge);

            wndMergeDocuments.DataContext = wndMergeDocumentsViewModel;
            ShowWindow(wndMergeDocuments, true);

            string tempFile = wndMergeDocumentsViewModel.ReturnValue as string;

            msg.Execute(new MsgOpenFile(tempFile));
        }
        // --- ROTATE PAGES
        void MsgShowRotatePages_Handler(GenericMessageAction <MsgShowRotatePages, MsgOpenFile> msg)
        {
            WndRotatePages          wndRotatePages          = new WndRotatePages();
            WndRotatePagesViewModel wndRotatePagesViewModel = new WndRotatePagesViewModel(msg.Data.Document);

            wndRotatePages.DataContext = wndRotatePagesViewModel;
            ShowWindow(wndRotatePages, true);

            string tempFile = wndRotatePagesViewModel.ReturnValue as string;

            msg.Execute(new MsgOpenFile(tempFile));
        }
Ejemplo n.º 8
0
        // --- SAVE FILE
        void MsgSaveFile_Handler(GenericMessageAction <MsgSaveFile, MsgOpenFile> msg)
        {
            FileDialogResult r = DialogController.ShowSaveFileDialog();

            msg.Execute(new MsgOpenFile(r.FileName, r.CommonDialogReturn));
        }