Example #1
0
        /// <summary>
        /// Populate the components
        /// </summary>
        protected override void PopulateComponent()
        {
            this.Component.Clear();

            if (this.NumberOfComponents != 0)
            {
                this.ComputeComponentCoordinateDenominator();
            }

            for (var i = 0; i < this.NumberOfComponents; i++)
            {
                ParameterTypeComponentRowViewModel row;
                var coordinates = this.ComputeComponentCoordinates(i + 1);

                if (this.Thing.Component.Count > i)
                {
                    var component = this.Thing.Component[i];
                    row = new ParameterTypeComponentRowViewModel(component, this.Session, this);
                }
                else
                {
                    // create new ParameterTypeComponent
                    var component = new ParameterTypeComponent();
                    row           = new ParameterTypeComponentRowViewModel(component, this.Session, this);
                    row.ShortName = coordinates;
                }

                row.Coordinates = coordinates;
                this.Component.Add(row);
            }
        }
Example #2
0
        /// <summary>
        /// Execute the <see cref="CreateComponentCommand"/>
        /// </summary>
        protected void ExecuteCreateComponent()
        {
            var component = new ParameterTypeComponent();

            var row = new ParameterTypeComponentRowViewModel(component, this.Session, this);

            this.Component.Add(row);
        }
Example #3
0
 /// <summary>
 /// Populate the components
 /// </summary>
 protected override void PopulateComponent()
 {
     this.Component.Clear();
     foreach (ParameterTypeComponent thing in this.Thing.Component.Where(t => t.ChangeKind != ChangeKind.Delete))
     {
         var row = new ParameterTypeComponentRowViewModel(thing, this.Session, this);
         row.Index = this.Thing.Component.IndexOf(thing);
         this.Component.Add(row);
     }
 }