Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProcessedValueSet"/> class.
 /// </summary>
 /// <param name="thing">
 /// The <see cref="Thing"/> that is processed by the current <see cref="ProcessedValueSet"/>
 /// </param>
 /// <param name="validationResult">
 /// the valiation result
 /// </param>
 public ProcessedValueSet(Thing thing, ValidationResultKind validationResult)
 {
     if (thing is ParameterValueSet || thing is ParameterOverrideValueSet || thing is ParameterSubscriptionValueSet)
     {
         this.OriginalThing    = thing;
         this.ValidationResult = validationResult;
     }
     else
     {
         throw new ArgumentException("The thing must be a ParameterValueSet or a ParameterOverrideValueSet or a ParameterSubscriptionValueSet", "thing");
     }
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorkbookRebuildRowViewModel"/> class.
 /// </summary>
 /// <param name="parameterSubscriptionValueSet">
 /// The <see cref="ParameterSubscriptionValueSet"/> that is represented by the current view model
 /// </param>
 /// <param name="componentIndex">
 /// The component index.
 /// </param>
 /// <param name="validationResult">
 /// The result of the Validation
 /// </param>
 public WorkbookRebuildRowViewModel(ParameterSubscriptionValueSet parameterSubscriptionValueSet, int componentIndex, ValidationResultKind validationResult)
 {
     this.Thing              = parameterSubscriptionValueSet;
     this.IsSelected         = true;
     this.ModelCode          = parameterSubscriptionValueSet.ModelCode(componentIndex);
     this.ManualValue        = parameterSubscriptionValueSet.Manual[componentIndex];
     this.ReferenceValue     = parameterSubscriptionValueSet.Reference[componentIndex];
     this.FormulaValue       = string.Empty;
     this.ComputedValue      = parameterSubscriptionValueSet.Computed[componentIndex];
     this.ActualValue        = parameterSubscriptionValueSet.ActualValue[componentIndex];
     this.Switch             = parameterSubscriptionValueSet.ValueSwitch.ToString();
     this.HasValidationError = validationResult != ValidationResultKind.Valid;
     this.IsSelected         = this.HasValidationError == false;
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SubmitParameterRowViewModel"/> class.
 /// </summary>
 /// <param name="parameterOverrideValueSet">
 /// The <see cref="ParameterOverrideValueSet"/> that is represented by the current view model
 /// </param>
 /// <param name="componentIndex">
 /// The component index.
 /// </param>
 /// <param name="validationResult">
 /// The result of the Validation
 /// </param>
 public SubmitParameterRowViewModel(ParameterOverrideValueSet parameterOverrideValueSet, int componentIndex, ValidationResultKind validationResult)
 {
     this.Thing              = parameterOverrideValueSet;
     this.IsSelected         = true;
     this.ModelCode          = parameterOverrideValueSet.ModelCode(componentIndex);
     this.ManualValue        = parameterOverrideValueSet.Manual[componentIndex];
     this.ReferenceValue     = parameterOverrideValueSet.Reference[componentIndex];
     this.FormulaValue       = parameterOverrideValueSet.Formula[componentIndex];
     this.ComputedValue      = parameterOverrideValueSet.Computed[componentIndex];
     this.ActualValue        = parameterOverrideValueSet.ActualValue[componentIndex];
     this.Switch             = parameterOverrideValueSet.ValueSwitch.ToString();
     this.HasValidationError = validationResult != ValidationResultKind.Valid;
     this.IsSelected         = !this.HasValidationError;
 }