private void ProcessData(TreeNode treeNode) { var objectWithIndex = (ObjectWithIndex)treeNode.Tag; var element = objectWithIndex.Element; if (element is FieldBoundary) { _boundaryProcessor.ProcessBoundary(element as FieldBoundary); _tabControlViewer.SelectedTab = _tabPageSpatial; } else if (element is GuidanceGroup) { _guidanceProcessor.ProcessGuidance(element as GuidanceGroup, _model.ApplicationDataModels[objectWithIndex.ApplicationDataModelIndex].Catalog.GuidancePatterns); _tabControlViewer.SelectedTab = _tabPageSpatial; } else if (element is GuidancePattern) { _guidanceProcessor.ProccessGuidancePattern(element as GuidancePattern); _tabControlViewer.SelectedTab = _tabPageSpatial; } else if (element is OperationData) { _dataGridViewRawData.DataSource = _operationDataProcessor.ProcessOperationData(element as OperationData); _tabControlViewer.SelectedTab = _tabPageRawData; } }
private void ProcessData(TreeNode treeNode) { var objectWithIndex = (ObjectWithIndex)treeNode.Tag; var element = objectWithIndex.Element; workingDataComboBox.Visible = false; if (element is FieldBoundary) { _boundaryProcessor.ProcessBoundary(element as FieldBoundary); _tabControlViewer.SelectedTab = _tabPageSpatial; } else if (element is GuidanceGroup) { _guidanceProcessor.ProcessGuidance(element as GuidanceGroup, _model.ApplicationDataModels[objectWithIndex.ApplicationDataModelIndex].Catalog.GuidancePatterns); _tabControlViewer.SelectedTab = _tabPageSpatial; } else if (element is GuidancePattern) { _guidanceProcessor.ProccessGuidancePattern(element as GuidancePattern); _tabControlViewer.SelectedTab = _tabPageSpatial; } else if (element is OperationData) { OperationData operation = element as OperationData; List <SpatialRecord> spatialRecords = new List <SpatialRecord>(); if (operation.GetSpatialRecords != null) { spatialRecords = operation.GetSpatialRecords().ToList(); //Iterate the records once here for multiple consumers below } _dataGridViewRawData.DataSource = _operationDataProcessor.ProcessOperationData(operation, spatialRecords); ApplicationDataModel.ADM.ApplicationDataModel model = _model.ApplicationDataModels[objectWithIndex.ApplicationDataModelIndex]; _spatialRecordProcessor.ProcessOperation(operation, spatialRecords, _model.ApplicationDataModels[objectWithIndex.ApplicationDataModelIndex].Catalog); workingDataComboBox.Visible = true; workingDataComboBox.DataSource = _spatialRecordProcessor.WorkingDataList; } else if (element is Prescription) { _prescriptionProcessor.ProcessPrescription(element as Prescription); } }