public void InsertVariation(PhysicalAndPanelPoint selectedPoint, CriticalityVariation variationToInsert) { int selectedPointIndex = points.IndexOf(selectedPoint); this.Insert(selectedPointIndex, variationToInsert); this.CalculateCharacteristicValues(); this.CalculatePoints(); }
public void AddVariationToolStripMenu_Click(object sender, EventArgs e) { VariationToInsert = null; AddVariationForm subForm = new AddVariationForm(this); subForm.ShowDialog(); if (VariationToInsert != null) { criticalityVariationsPoints.InsertVariation(selectedPoint, VariationToInsert); this.Refresh(); CriticalityVariationsEventArgs cve = new CriticalityVariationsEventArgs((CriticalityVariations)(criticalityVariationsPoints)); OnCriticalityChange(this, cve); } }
public void updateVariations(PhysicalAndPanelPoint selectedPoint) { int selectedPointIndex = points.IndexOf(selectedPoint); if (selectedPointIndex >= 0) { if (selectedPointIndex == 0) { this.CalculateCharacteristicValues(CharacteristicValues.initial - offset.Y / heigthScale); } else //selectedPointIndex > 0 { CriticalityVariation selectedCv = this[selectedPointIndex - 1]; selectedCv.length += offset.X / widthScale; selectedCv.variation -= offset.Y / heigthScale; this.CalculateCharacteristicValues(); } this.CalculatePoints(); } }