/// <summary> /// Adds a reading to the fact. /// </summary> /// <param name="readingText">The text of the reading to add.</param> /// <returns>The reading that was added.</returns> public Reading AddReading(string readingText) { LinkedElementCollection<RoleBase> factRoles = RoleCollection; int roleCount = factRoles.Count; if (!Reading.IsValidReadingText(readingText, roleCount)) { throw new ArgumentException(ResourceStrings.ModelExceptionFactAddReadingInvalidReadingText, "readingText"); } Store store = Store; Reading retVal = new Reading(store, new PropertyAssignment(Reading.TextDomainPropertyId, readingText)); retVal.ReadingOrder = this; return retVal; }
private void SetReadingTextValue(string newValue) { if (!Store.InUndoRedoOrRollback) { LinkedElementCollection<Reading> readings = ReadingCollection; Reading reading; if (readings.Count > 0) { reading = readings[0]; } else { reading = new Reading(Store); readings.Add(reading); } reading.Text = newValue; } }
/// <summary> /// Select the current reading in the window. The /// reading must be the child of the current fact. /// </summary> /// <param name="reading">Reading</param> public void ActivateReading(Reading reading) { myReadingEditor.ActivateReading(reading); }
/// <summary> /// Select the current reading in the window. The /// reading must be the child of the current fact. /// </summary> /// <param name="reading">Reading</param> public void ActivateReading(Reading reading) { ReadingsViewForm form = myForm; if (form != null) { form.ActivateReading(reading); } }