async public Task <bool> OnEvent(object MapEvent) { if (_module != null && _module.SelectedNetworkTracer != null) { if (_module.SelectedNetworkTracer is INetworkTracerProperties && await((INetworkTracerProperties)_module.SelectedNetworkTracer).NetworkTracerProperties(_module.SelectedNetworkFeatureClass, TracerInput()) != null) { FormTracerProperties dlg = new FormTracerProperties( await((INetworkTracerProperties)_module.SelectedNetworkTracer).NetworkTracerProperties(_module.SelectedNetworkFeatureClass, TracerInput())); if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return(false); } } if (_module.SelectedNetworkTracer is IProgressReporterEvent) { NetworkProgressReporter reporter = new NetworkProgressReporter(_doc); FormTaskProgress dlg = new FormTaskProgress(); dlg.ShowProgressDialog(reporter, this.Trace(reporter)); } else { await Trace(null); } ((MapEvent)MapEvent).drawPhase = DrawPhase.Graphics; ((MapEvent)MapEvent).refreshMap = true; } return(true); }
public void OnEvent(object MapEvent) { if (_module != null && _module.SelectedNetworkTracer != null) { if (_module.SelectedNetworkTracer is INetworkTracerProperties && ((INetworkTracerProperties)_module.SelectedNetworkTracer).NetworkTracerProperties(_module.SelectedNetworkFeatureClass, TracerInput()) != null) { FormTracerProperties dlg = new FormTracerProperties( ((INetworkTracerProperties)_module.SelectedNetworkTracer).NetworkTracerProperties(_module.SelectedNetworkFeatureClass, TracerInput())); if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } } if (_module.SelectedNetworkTracer is IProgressReporterEvent) { NetworkProgressReporter reporter = new NetworkProgressReporter(_doc); Thread thread = new Thread(new ParameterizedThreadStart(this.Trace)); FormProgress dlg = new FormProgress(); dlg.ShowProgressDialog(reporter, reporter, thread); } else { Trace(null); } ((MapEvent)MapEvent).drawPhase = DrawPhase.Graphics; ((MapEvent)MapEvent).refreshMap = true; } }