Пример #1
0
 /// <summary>
 /// Run the utility on command from the main utility dialog.
 /// </summary>
 public void Process()
 {
     Debug.Assert(m_dlg != null);
     using (var dlg = new FixErrorsDlg())
     {
         try
         {
             if (dlg.ShowDialog(m_dlg) == DialogResult.OK)
             {
                 string pathname = Path.Combine(
                     Path.Combine(FwDirectoryFinder.ProjectsDirectory, dlg.SelectedProject),
                     dlg.SelectedProject + FdoFileHelper.ksFwDataXmlFileExtension);
                 if (File.Exists(pathname))
                 {
                     using (new WaitCursor(m_dlg))
                     {
                         using (var progressDlg = new ProgressDialogWithTask(m_dlg))
                         {
                             string fixes = (string)progressDlg.RunTask(true, FixDataFile, pathname);
                             if (fixes.Length > 0)
                             {
                                 MessageBox.Show(fixes, Strings.ksErrorsFoundOrFixed);
                                 File.WriteAllText(pathname.Replace(FdoFileHelper.ksFwDataXmlFileExtension, "fixes"), fixes);
                             }
                         }
                     }
                 }
             }
         }
         catch
         {
         }
     }
 }
Пример #2
0
		/// <summary>
		/// Run the utility on command from the main utility dialog.
		/// </summary>
		public void Process()
		{
			Debug.Assert(m_dlg != null);
			using (var dlg = new FixErrorsDlg())
			{
				try
				{
					if (dlg.ShowDialog(m_dlg) == DialogResult.OK)
					{
						string pathname = Path.Combine(
							Path.Combine(FwDirectoryFinder.ProjectsDirectory, dlg.SelectedProject),
							dlg.SelectedProject + FdoFileHelper.ksFwDataXmlFileExtension);
						if (File.Exists(pathname))
						{
							using (new WaitCursor(m_dlg))
							{
								using (var progressDlg = new ProgressDialogWithTask(m_dlg))
								{
									string fixes = (string)progressDlg.RunTask(true, FixDataFile, pathname);
									if (fixes.Length > 0)
									{
										MessageBox.Show(fixes, Strings.ksErrorsFoundOrFixed);
										File.WriteAllText(pathname.Replace(FdoFileHelper.ksFwDataXmlFileExtension, "fixes"), fixes);
									}
								}
							}
						}
					}
				}
				catch
				{
				}
			}
		}