예제 #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((base.GetHashCode() * 397) ^ (RefersTo != null ? RefersTo.GetHashCode() : 0));
     }
 }
예제 #2
0
        /// <summary>
        /// Returns a string representation of the PronounPhrase
        /// </summary>
        /// <returns>A string representation of the PronounPhrase</returns>
        public override string ToString()
        {
            var result = base.ToString() + (RefersTo.EmptyIfNull().Any() ? "\nreferring to -> " + RefersTo.Text : string.Empty);

            result += AliasLookup.GetDefinedAliases(RefersTo ?? this as IEntity).Any() ? "\nClassified as: " + AliasLookup.GetDefinedAliases(RefersTo as IEntity ?? this).Format() : string.Empty;
            return(result);
        }
예제 #3
0
 /// <summary>
 /// Returns a string representation of the Pronoun.
 /// </summary>
 /// <returns>A string representation of the Pronoun.</returns>
 public override string ToString() => GetType().Name + " \"" + Text + "\"" +
 (
     VerboseOutput ? " " + PronounKind + (
         RefersTo.EmptyIfNull().Any() ?
         " referring to -> " + RefersTo.Text :
         string.Empty
         ) : string.Empty
 );
예제 #4
0
 /// <summary>
 /// Adds an IPossessible construct, such as a person place or thing, to the collection of IEntity instances the RelativePronoun "Owns",
 /// and sets its owner to be the RelativePronoun.
 /// If the item is already possessed by the current instance, this method has no effect.
 /// </summary>
 /// <param name="possession">The possession to add.</param>
 public void AddPossession(IPossessable possession)
 {
     if (IsBound)
     {
         RefersTo.AddPossession(possession);
     }
     else
     {
         possessions          = possessions.Add(possession);
         possession.Possessor = this;
     }
 }
예제 #5
0
 /// <summary>
 /// Binds the RelativePronoun to refer to the given Entity.
 /// </summary>
 /// <param name="target">The entity to which to bind.</param>
 public void BindAsReferringTo(IEntity target)
 {
     if (RefersTo == null || !RefersTo.Any())
     {
         RefersTo = new AggregateEntity(target);
     }
     else
     {
         RefersTo = new AggregateEntity(RefersTo.Append(target));
     }
     EntityKind = RefersTo.EntityKind;
 }
예제 #6
0
 /// <summary>
 /// Adds an IPossessible construct, such as a person place or thing, to the collection of Pronoun "Owns",
 /// and sets its owner to be the Pronoun.
 /// If the item is already possessed by the current instance, this method has no effect.
 /// </summary>
 /// <param name="possession">The possession to add.</param>
 public virtual void AddPossession(IPossessable possession)
 {
     if (RefersTo != null)
     {
         RefersTo.AddPossession(possession);
     }
     else
     {
         possessions.Add(possession);
         possession.Possessor = this;
     }
 }
예제 #7
0
 /// <summary>
 /// Each cotenant has equal rights to posses and use all of the property
 /// </summary>
 /// <param name="lp"></param>
 /// <returns></returns>
 public virtual bool IsRightToOccupyUseWholeProperty(ILegalPerson lp)
 {
     return(RefersTo.IsEntitledTo(lp));
 }
예제 #8
0
 public override int GetHashCode()
 {
     return(RefersTo.GetHashCode());
 }