public void Display(CellMeasure item, bool readOnly = false) { update = false; this.CellMeasure = item; this.ValueTextBox.Text = item != null ? item.measure != null ? item.measure.name : item.name: ""; this.FormulaTextBox.Text = item != null && item.formula != null ? item.formula : ""; this.FormulaTextBox.IsEnabled = !readOnly; update = true; }
public void setValue(object item) { if (item is Measure) { CellMeasure cellMeasure = new CellMeasure(); cellMeasure.measure = (Measure)item; this.LoopCalutedValue.CellMeasurePanel.SetValue(cellMeasure); } if (item is AttributeValue) { this.LoopCalutedValue.filterScopePanel.SetTargetValue((Kernel.Domain.AttributeValue)item); } else if (item is TransformationTreeItem) { TransformationTreeItem loop = (TransformationTreeItem)item; if (loop.IsLoop) { if (loop.IsScope) { this.LoopCalutedValue.filterScopePanel.SetLoopValue(loop); } else if (loop.IsPeriod) { this.LoopCalutedValue.periodPanel.SetLoopValue(loop); } } } else if (item is PeriodInterval) { this.LoopCalutedValue.periodPanel.SetPeriodInterval((PeriodInterval)item); } else if (item is List <PeriodInterval> ) { List <PeriodInterval> listInterval = ((List <PeriodInterval>)item); if (listInterval.Count == 0) { return; } String periodName = listInterval[0].periodName.name; this.LoopCalutedValue.periodPanel.SetPeriodItemName(periodName); } else if (item is PeriodName) { this.LoopCalutedValue.periodPanel.SetPeriodItemName(((PeriodName)item).name); } onChange(); }
/// <summary> /// Définit la valeur du TargetItem en cour d'édition /// et affiche cette valeur dans le TextBox /// </summary> /// <param name="value">La valeur du TargetItem en cour d'édition</param> public void SetValue(CellMeasure item) { bool added = false; if (this.CellMeasure == null) { this.CellMeasure = new CellMeasure(); added = true; } this.CellMeasure.name = item.name; this.CellMeasure.measure = item.measure; //this.CellMeasure.formula = item.formula; this.ValueTextBox.Text = this.CellMeasure != null ? this.CellMeasure.measure.name : ""; //this.FormulaTextBox.Text = this.CellMeasure != null ? this.CellMeasure.formula : ""; if (Added != null && added) { Added(this); } if (Updated != null && !added) { Updated(this); } }
/// <summary> /// Construit une nouvelle instance de CellMeasurePanel /// </summary> /// <param name="index">Index du panel</param> /// <param name="item">CellMeasure à afficher</param> public CellMeasurePanel(CellMeasure item, bool forReport) : this() { Display(item); }