private void sbOk_Click(object sender, EventArgs e) { DialogResult = DialogResult.OK; Strategy.ParametersToOptimize.Clear(); foreach (InputParameterNode node in SelectedNodes) { Strategy.ParametersToOptimize.Add(new InputParameterInfo() { FieldName = node.FullName, PropertyInfo = node.Property }); } InputParameterNode nodeOut = ((List <InputParameterNode>) this.treeList2.DataSource).FirstOrDefault(node => node.Selected); if (nodeOut == null) { XtraMessageBox.Show("Error: Output parameter not specified."); return; } OutputParameterInfo outInfo = new OutputParameterInfo() { FieldName = nodeOut.FullName, PropertyInfo = nodeOut.Property }; outInfo.Optimization = (OutputParameterOptimizationMode)this.barEditItem1.EditValue; Strategy.OutputParameter = outInfo; if (Strategy.Manager != null) { Strategy.Manager.Save(); } Close(); }
private void repositoryItemCheckEdit1_CheckedChanged(object sender, EventArgs e) { InputParameterNode node = (InputParameterNode)this.treeList1.GetFocusedRow(); List <InputParameterNode> nodes = this.treeList1.DataSource as List <InputParameterNode>; if (node.Selected) { nodes.ForEach(n => n.Selected = n == node); } }
private void ConfigureOutput() { this.barEditItem1.EditValue = OutputParameterOptimizationMode.Maximize; List <InputParameterNode> nodes = InputParametersHelper.GetOutputNodes(Strategy); if (Strategy.OutputParameter != null) { InputParameterNode node = nodes.FirstOrDefault(n => n.FullName == Strategy.OutputParameter.FieldName); if (node != null) { node.Selected = true; } } this.treeList2.DataSource = nodes; this.treeList2.ExpandAll(); }
private void ConfigureInput() { this.inputParameterNodeBindingSource1.DataSource = SelectedNodes; Text = Strategy.Name + " Parameters"; List <InputParameterNode> nodes = InputParametersHelper.GetInputNodes(Strategy); foreach (InputParameterInfo p in Strategy.ParametersToOptimize) { InputParameterNode node = nodes.FirstOrDefault(n => n.FullName == p.FieldName); if (node != null) { node.Selected = true; SelectedNodes.Add(node); } } this.treeList1.DataSource = nodes; this.treeList1.ExpandAll(); }
protected virtual void OnStrategyChanged() { if (Strategy == null) { return; } Text = Strategy.Name + " Parameters"; List <InputParameterNode> nodes = InputParametersHelper.GetOutputNodes(Strategy); if (Strategy.OutputParameter != null) { InputParameterNode node = nodes.FirstOrDefault(n => n.FullName == Strategy.OutputParameter.FieldName); if (node != null) { node.Selected = true; } } this.treeList1.DataSource = nodes; this.treeList1.ExpandAll(); }