Пример #1
0
        /// <summary>Shows the open translation dialog and possibly opens a file.</summary>
        /// <remarks>If there's a translation currently open with unsaved changes, a warning dialog
        /// is shown before opening the new file.</remarks>
        public void TranslationOpen()
        {
            FileOpenDialog dialog = Base.Dialogs.Get(typeof(FileTranslationOpenDialog)) as FileOpenDialog;

            dialog.Show();
            bool toOpen = dialog.WaitForResponse();

            if (toOpen && ToOpenTranslationAfterWarning())
            {
                string filename = dialog.Filename;
                int    codePage = (dialog.Encoding.Equals(EncodingDescription.Empty) ? -1 : dialog.Encoding.CodePage);
                OpenTranslation(filename, codePage);
            }
        }
Пример #2
0
        /// <summary>Shows the open dialog and possibly opens a subtitle.</summary>
        /// <remarks>If there's a document currently open with unsaved changes, a warning dialog
        /// is shown before opening the new file.</remarks>
        public void Open()
        {
            FileOpenDialog dialog = Base.Dialogs.Get(typeof(FileOpenDialog)) as FileOpenDialog;

            dialog.Show();
            bool gotOpenResponse = dialog.WaitForResponse();

            if (gotOpenResponse && ToOpenAfterWarning())
            {
                string filename = dialog.Filename;
                int    codePage = (dialog.Encoding.Equals(EncodingDescription.Empty) ? -1 : dialog.Encoding.CodePage);
                Uri    videoUri = dialog.VideoUri;
                Open(filename, codePage, videoUri);
            }
        }