Example #1
0
 private void CompressedTextOpenToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (var openme = FileHandling.GetOpenDialogForHandler(SupportedFileHandleFormats.CompressedTextFile))
     {
         openme.ShowDialog();
     }
 }
Example #2
0
 private void OpenZippedTrackerText_onClick(object sender, EventArgs e)
 {
     using (var openme = FileHandling.GetOpenDialogForHandler(SupportedFileHandleFormats.ZippedTrackPlain))
     {
         openme.ShowDialog();
     }
 }
Example #3
0
 private void OpenRTFUnicodeText_onClick(object sender, EventArgs e)
 {
     using (var openme = FileHandling.GetOpenDialogForHandler(SupportedFileHandleFormats.TextUnicodeRTF))
     {
         openme.ShowDialog();
     }
 }
Example #4
0
 private void OpenAnsiTextMenuItem_onClick(object sender, EventArgs e)
 {
     using (var openme = FileHandling.GetOpenDialogForHandler(SupportedFileHandleFormats.TextAnsiPlain))
     {
         openme.ShowDialog();
     }
 }
Example #5
0
 private void UnicodeRichTextToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (var openme = FileHandling.GetOpenDialogForHandler(SupportedFileHandleFormats.TextUnicodeRTF))
     {
         openme.ShowDialog();
     }
 }
Example #6
0
        private void NewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (CurrentFile.HasChanged)
            {
                switch (MessageBox.Show(Path.GetFileName(CurrentFile.CurrentFile) + " has changed. Save Changes?", "Save Changes?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
                {
                case DialogResult.Cancel:
                {
                    return;
                }

                case DialogResult.Yes:
                {
                    if (CurrentFile.FileExists)
                    {
                        FileHandling.FileSave(FileHandling.GetHandlerClassInstance(CurrentFile.Format), CurrentFile.CurrentFile);
                    }
                    else
                    {
                        using (var SaveDialog = FileHandling.GetOpenDialogForHandler(CurrentFile.Format))
                        {
                        }
                    }
                }
                break;

                case DialogResult.No:
                    break;

                default: throw new Exception("Someone forgot to add code for different DialogResult in File->New");
                }
            }

            CurrentFile = new ContextFile();
            CurrentFile.UpdateContextTitle(this);
        }