Esempio n. 1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Returns null if the user wants to skip loading a missing data source or a full
        /// file path the user specified as the relocated data source file.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private static string GetMissingDataSourceAction(string dataSourceFile)
        {
            if (MissingDataSourceMsgBox.ShowDialog(dataSourceFile) == DialogResult.Cancel)
            {
                return(null);
            }

            var dlg = new OpenFileDialog();

            dlg.CheckFileExists  = true;
            dlg.CheckPathExists  = true;
            dlg.FileName         = Path.GetFileName(dataSourceFile);
            dlg.Filter           = App.kstidFileTypeAllFiles;
            dlg.ShowReadOnly     = false;
            dlg.InitialDirectory = Path.GetFullPath(dataSourceFile);
            dlg.Title            = LocalizationManager.GetString(
                "Miscellaneous.Messages.DataSourceReading.SpecifyNewLocationForDatasourceOpenFileDlgCaption",
                "Choose New Data Source Location");

            while (dlg.ShowDialog() == DialogResult.Cancel)
            {
                if (MissingDataSourceMsgBox.ShowDialog(dataSourceFile) == DialogResult.Cancel)
                {
                    return(null);
                }
            }

            return(dlg.FileName);
        }
Esempio n. 2
0
 /// ------------------------------------------------------------------------------------
 public static DialogResult ShowDialog(string dataSourceFileName)
 {
     using (var msgBox = new MissingDataSourceMsgBox())
     {
         msgBox.m_filename = dataSourceFileName;
         App.CloseSplashScreen();
         return(msgBox.ShowDialog());
     }
 }