public void New() { MDIChildForm form = new MDIChildForm(); form.Fsize = this.FontSize; form.Ftype = this.FontSelected; form.MdiParent = this; form.Show(); }
private void EditDuplicateEntry_Click(object sender, EventArgs e) { MDIChildForm x = (MDIChildForm)ActiveMdiChild; x.KeyDuplicate(); }
public void statusStripGroupTotal(Group g) { MDIChildForm x = (MDIChildForm)ActiveMdiChild; statusStripControl1.NumberOfGroups(x.kc.Groups.Count); }
private void EditDeleteEntry_Click(object sender, EventArgs e) { MDIChildForm x = (MDIChildForm)ActiveMdiChild; x.GroupDelete(); }
private void EditAddEntry_Click(object sender, EventArgs e) { MDIChildForm x = (MDIChildForm)ActiveMdiChild; x.KeyAdd(); }
private void EditEditGroup_Click(object sender, EventArgs e) { MDIChildForm x = (MDIChildForm)ActiveMdiChild; x.GroupEdit(); }
public void Open() { OpenFileDialog d = new OpenFileDialog(); if (d.FileName != null) { string exe = Assembly.GetExecutingAssembly().Location; d.InitialDirectory = Path.GetDirectoryName(exe); d.RestoreDirectory = true; d.Filter = "KeyChain Files|*.kcf"; if (d.ShowDialog(this) != DialogResult.OK) { return; } else { PasswordForm p = new PasswordForm(); p.local = File.ReadAllBytes(d.FileName); p.savethis = 2; p.ShowDialog(); if (p.DialogResult != DialogResult.OK) { return; } string pass = p.Password; MDIChildForm form = new MDIChildForm(); form.Fsize = this.FontSize; form.Ftype = this.FontSelected; form.MdiParent = this; form.Show(); DataContractSerializer dcs = new DataContractSerializer(typeof(KeyChain)); byte[] ToRead = File.ReadAllBytes(d.FileName); byte[] decryptedArray = CryptoHelper.Decrypt(ToRead, pass); if (decryptedArray != null) { MemoryStream memoryreadStream = new MemoryStream(decryptedArray); KeyChainManager.KeyChain = (KeyChain)dcs.ReadObject(memoryreadStream); memoryreadStream.Close(); form.LoadFile(); //foreach (Group g in KeyChainManager.KeyChain.Groups) //{ //form.groupTreeControl1.AddTreeNodefromFileLoad(g); //statusStripGroupTotal(g); //} statusStripControl1.StatusBarComboboxClear(); KeyChainManager.KeyChain.IsModified = false; Text = d.FileName; } else { form.Close(); MessageBox.Show("Wrong Password Entered. Please try to load File again, select a different file, create a new file, or exit."); } } } statusStripControl1.StatusBarComboboxClear(); KeyChainManager.KeyChain.IsModified = false; Text = d.FileName; }