[Export(typeof(ICommand))] [DisplayName("Hail Analysis Tool")] public class AnalysisTool : ICommand { private MyAnalysisDialog AnalysisDialog = null; // Event Declaration public event EventHandler hideDialog; #region ICommand members public void Execute(object parameter) { // Create a new Dialog if one has not already been created //AnalysisDialog = AnalysisDialog ?? new MyAnalysisDialog(); hideDialog += new EventHandler(HideHandler); if (AnalysisDialog != null) { MapApplication.Current.HideWindow(AnalysisDialog); } else { AnalysisDialog = new MyAnalysisDialog(); MapApplication.Current.ShowWindow("Hail Analysis", AnalysisDialog, false, null,HideHandler); } } public void HideHandler(object sender, EventArgs e) { AnalysisDialog = null; hideDialog -= new EventHandler(HideHandler); } public bool CanExecute(object parameter) { // Return true so that the command can always be executed return true; } public event EventHandler CanExecuteChanged; #endregion }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.