Exemplo n.º 1
0
        /// <summary>Displays a SaveAs dialog and gets the chosen options as <cref="FileProperties" />.</summary>
        /// <param name="dialog">The dialog to display.</param>
        /// <returns>The chosen file properties, or null in case SaveAs was canceled.</returns>
        private FileProperties ShowSaveAsDialog(FileSaveDialog dialog)
        {
            dialog.Show();
            bool toSaveAs = dialog.WaitForResponse();

            if (!toSaveAs)
            {
                return(null);
            }

            string       path         = dialog.Filename;
            Encoding     encoding     = Encodings.GetEncoding(dialog.Encoding.CodePage);
            SubtitleType subtitleType = dialog.SubtitleType;
            NewlineType  newlineType  = dialog.NewlineType;
            TimingMode   timingMode   = Base.TimingMode;

            return(new FileProperties(path, encoding, subtitleType, timingMode, newlineType));
        }