void _method_SelectionChanged(object sender, SelectionChangedEventArgs e) { var type = (CostCalculationMethod)this._method.SelectedValue; switch (type) { case CostCalculationMethod.Interpolation: InterpolationFormulaSet setInterpolation = new InterpolationFormulaSet(this._spatialDataField); setInterpolation.ShowDialog(); this._spatialDataField.SetInterpolation(setInterpolation.interpolation); setInterpolation.interpolation = null; setInterpolation = null; break; case CostCalculationMethod.WrittenFormula: TextFormulaSet setTextFormula = new TextFormulaSet(this._host, this._spatialDataField); setTextFormula.ShowDialog(); this._spatialDataField.SetStringFormula(setTextFormula.CostFunction); setTextFormula.CostFunction = null; setTextFormula = null; break; case CostCalculationMethod.RawValue: this._function.SetRawValue(); break; default: break; } }
void _method_SelectionChanged(object sender, SelectionChangedEventArgs e) { var type = (CostCalculationMethod)this._method.SelectedValue; switch (type) { case CostCalculationMethod.Interpolation: InterpolationFormulaSet setInterpolation = new InterpolationFormulaSet(this._spatialDataField); setInterpolation.Owner = (Window)((DockPanel)((Grid)this.Parent).Parent).Parent; setInterpolation.ShowDialog(); this._spatialDataField.SetInterpolation(setInterpolation.interpolation); setInterpolation.interpolation = null; setInterpolation = null; break; case CostCalculationMethod.WrittenFormula: TextFormulaSet setTextFormula = new TextFormulaSet(this._host, this._spatialDataField); setTextFormula.Owner = (Window)((DockPanel)((Grid)this.Parent).Parent).Parent; setTextFormula.ShowDialog(); this._spatialDataField.SetStringFormula(setTextFormula.CostFunction); this._spatialDataField.TextFormula = setTextFormula.main.Text; foreach (var item in this._host.Parameters) { if (item.Value.LinkedFunctions.Contains(this._spatialDataField)) { item.Value.LinkedFunctions.Remove(this._spatialDataField); } } foreach (var item in setTextFormula.LinkedParameters) { item.LinkedFunctions.Add(this._spatialDataField); } setTextFormula.CostFunction = null; setTextFormula = null; break; case CostCalculationMethod.RawValue: this._spatialDataField.SetRawValue(); break; case CostCalculationMethod.BuiltInRepulsion: this._spatialDataField.SetBuiltInRepulsion(); break; } }