protected void OpenBookmarkFile(string filename) { treeView1.HasChanged = false; if (RyzStudio.IO.SharpZipLib.IsZipEncrypted(filename)) { PasswordForm oPassword = new PasswordForm(this); sessionFileFormat.passkey = oPassword.ShowDialog(); if (sessionFileFormat.passkey.Equals("")) { return; } } else { sessionFileFormat.passkey = ""; } bool rv = sessionFileFormat.loadFromRyz(filename); if (rv) { this.Text = Path.GetFileNameWithoutExtension(filename) + " - " + Properties.Resources.app_name; this.ApplicationMode = AppMode.Open; treeView1.HasChanged = false; } }
protected bool SaveBookmarkFile() { bool rv = false; if (saveFileDialog.ShowDialog() == DialogResult.OK) { switch (saveFileDialog.FilterIndex) { case 1: sessionFileFormat.passkey = ""; rv = sessionFileFormat.saveToRyz(saveFileDialog.FileName); break; case 2: PasswordForm oPassword = new PasswordForm(this); sessionFileFormat.passkey = oPassword.ShowDialog(); rv = sessionFileFormat.saveToRyz(saveFileDialog.FileName); if (rv) { treeView1.HasChanged = false; } break; default: break; } } if (rv) { ApplicationMode = AppMode.Open; sessionFilename = saveFileDialog.FileName; this.Text = Path.GetFileNameWithoutExtension(saveFileDialog.FileName) + " - " + Properties.Resources.app_name; } return(rv); }