public AskPassword(MainWindow.Operation Action, List<string> SrcFiles)
        {
            InitializeComponent();

            SrcFileList = SrcFiles;
            Actions = Action;

            if (Action == MainWindow.Operation.Decrypt)
            {
                EncPanel.Hide();
                this.Height -= EncPanel.Height-5;
                this.PicStrip.BackColor = Color.SeaGreen;
                ChkShowPassword.Checked = true;
                PrgPwStren.BackColor = Color.SeaGreen;
                TxtPassword_1.ForeColor = Color.SeaGreen;
                TxtPassword_2.ForeColor = Color.SeaGreen;
            }
            else
            {
                ChkOverWrite.Checked = false;
                this.PicStrip.BackColor = Color.Red;
                PrgPwStren.BackColor = Color.Red;
                TxtPassword_1.ForeColor = Color.Red;
                TxtPassword_2.ForeColor = Color.Red;
            }
        }
Exemple #2
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            Instance = this;
            this.Size = new Size(930, 600);
            //MsgPnl.Width = this.ClientRectangle.Width/2+200;
            //System.Windows.Forms.ToolTip PbClose = new System.Windows.Forms.ToolTip();
            //MsgPnl.Location = new Point((this.Width / 2) - (this.MsgPnl.Width / 2), this.ClientRectangle.Height - MsgPnl.Height);

            if (Current == Mode.PasswordDialog)
            {
                this.Size = this.MaximumSize = this.MinimumSize = new Size(395, 445);
            }
        }
Exemple #3
0
        private void MainWindow_DragDrop(object sender, DragEventArgs e)
        {
            List<string> EncFiles = new List<string>();
            List<string> DecFiles = new List<string>();
            List<string> FileObj = new List<string>();

            #region FileDrop

            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                Application.DoEvents();
                FileInfo F = null;
                DirectoryInfo D = null;
                string[] Objects = (string[])e.Data.GetData(DataFormats.FileDrop);
                foreach (string File in Objects)
                {
                    D = new DirectoryInfo(File);
                    if (D.Exists)
                    {
                        FileObj = GetFilesFrom(File, FileObj);
                    }
                    else
                    {
                        FileObj.Add(File);
                    }
                }

                foreach (string File in FileObj)
                {
                    F = new FileInfo(File);
                    if (F.Extension != ".enf")
                    {
                        EncFiles.Add(File);
                    }
                    else
                    {
                        DecFiles.Add(File);
                    }
                }

            }

            #endregion

            if (EncFiles.Count != 0)
            {
                LoadEncryption(EncFiles);
            }

            if (DecFiles.Count != 0)
            {
                if (EncFiles.Count == 0)
                {
                    LoadDecryption(DecFiles);
                }
                else
                {
                    MainWindow New = new MainWindow(Mode.Decryption, DecFiles, false);
                    New.Show();
                }

            }
        }