public void Execute(RationallyView view, Shape changedShape) { ForceDescriptionComponent forceDescription = (ForceDescriptionComponent)view.GetComponentByShape(changedShape); if (forceDescription != null) { Globals.RationallyAddIn.Model.Forces[forceDescription.Index].Description = forceDescription.Text; } }
public void Execute(RationallyView view, Shape changedShape) { ForceConcernComponent forceConcern = (ForceConcernComponent)view.GetComponentByShape(changedShape); if (forceConcern != null) { if (forceConcern.Text == string.Empty) { forceConcern.Text = ForceConcernComponent.DefaultConcern; } Globals.RationallyAddIn.Model.Forces[forceConcern.Index].Concern = forceConcern.Text; } }
public void Execute(RationallyView view, Shape changedShape) { AlternativeStateShape alternativeState = (AlternativeStateShape)view.GetComponentByShape(changedShape); if (alternativeState == null) { return; } int index = alternativeState.Index; Globals.RationallyAddIn.Model.Alternatives[index].Status = alternativeState.Text; }
public void Execute(RationallyView view, Shape changedShape) { ForcesContainer forcesContainer = (ForcesContainer)view.Children.First(c => c is ForcesContainer); ForceValueComponent forceValue = (ForceValueComponent)view.GetComponentByShape(changedShape); string forceVal = forceValue.Text == string.Empty ? "0" : forceValue.Text; Globals.RationallyAddIn.Model.Forces[forceValue.Index].ForceValueDictionary[forceValue.ForceAlternativeId] = forceVal; RepaintHandler.Repaint(forceValue); //repaint the force value, for coloring ForceTotalsRow forceTotalsRow = forcesContainer.Children.First(c => c is ForceTotalsRow) as ForceTotalsRow; if (forceTotalsRow != null) { RepaintHandler.Repaint(forceTotalsRow.Children.Where(c => c is ForceTotalComponent).FirstOrDefault(c => c.ForceAlternativeId == forceValue.ForceAlternativeId)); } }