private void OnAlgoExecuteCompleted(ISystemAlgo algo) { ILayer layer = LayerFactory.CreateDefaultLayer(ISODATA_FRM.ISODataParams.OutputFilePath); m_HookHelper.FocusMap.AddLayer(layer); m_HookHelper.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll); ISystemAlgoEvents algoEvents = algo as ISystemAlgoEvents; algoEvents.OnExecuteCompleted -= OnAlgoExecuteCompleted; algoEvents.OnProgressChanged -= OnAlgoProgresChanged; MainForm.parentForm.myProgressBar.Value = 0; MainForm.parentForm.myLabel.Text = ""; }
private int OnAlgoProgresChanged(double complete, string msg, ISystemAlgo algo) { MethodInvoker invoker = () => { MainForm.parentForm.myProgressBar.Value = Convert.ToInt16(complete); MainForm.parentForm.myLabel.Text = Convert.ToByte(complete).ToString() + "%"; }; if (MainForm.parentForm.myProgressBar.InvokeRequired) { MainForm.parentForm.myProgressBar.Invoke(invoker); } else { invoker(); } return(0); }
private void OnAlgoExecuteCompleted(ISystemAlgo algo) { //ISODataClassification_Exchange_Info exchange_Info = new ISODataClassification_Exchange_Info(); //IRasterDataset rasterDataset = DatasetFactory.OpenRasterDataset(exchange_Info.OutputFilePath, OpenMode.ReadOnly) as IRasterDataset; //ILayer layer = LayerFactory.CreateDefaultRasterLayer(rasterDataset) as ILayer; ILayer layer = LayerFactory.CreateDefaultLayer(MyIODATA_FRM.ISODataParams.OutputFilePath); //IMap map = m_HookHelper.FocusMap; // map.AddLayer(layer); m_HookHelper.FocusMap.AddLayer(layer); m_HookHelper.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll); ISystemAlgoEvents algoEvents = algo as ISystemAlgoEvents; algoEvents.OnExecuteCompleted -= OnAlgoExecuteCompleted; //algoEvents.OnProgressChanged -= OnAlgoProgresChanged; }