Exemplo n.º 1
0
        private void CreateLoadWindow()
        {
            LoadWindow loadWindow = new LoadWindow(db);

            loadWindow.Owner = this;
            if (loadWindow.ShowDialog() == true)
            {
                textFile = loadWindow.filesListBox.SelectedItem as TextFile;
                CheckFileFormat(textFile.Name);
                mainTextBox.Text = ZipHandler.Unzip(textFile.Value);
                textIsModified   = false;
            }
        }
Exemplo n.º 2
0
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            if (textFile == null)
            {
                textFile = new TextFile {
                    Value = ZipHandler.Zip(mainTextBox.Text)
                };
            }
            else
            {
                textFile.Value = ZipHandler.Zip(mainTextBox.Text);
            }
            SaveWindow saveWindow = new SaveWindow(db, textFile);

            saveWindow.Owner = this;
            if (saveWindow.ShowDialog() == true)
            {
                textIsModified = false;
                CheckFileFormat(textFile.Name);
            }
        }