Esempio n. 1
0
		/// <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;
		}
Esempio n. 2
0
		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;
			}
		}
Esempio n. 3
0
			/// <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);
			}
Esempio n. 4
0
		/// <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);
			}
		}