Пример #1
0
 private static ILexicalContextmenu CreateForVerbal(IVerbal verbal)
 {
     Validate.NotNull(verbal, nameof(verbal));
     return(new LexicalContextmenu
     {
         LexicalId = verbal.GetSerializationId(),
         SubjectIds = verbal.HasSubject() ? verbal.Subjects.Select(e => e.GetSerializationId()).ToArray() : null,
         DirectObjectIds = verbal.HasDirectObject() ? verbal.DirectObjects.Select(e => e.GetSerializationId()).ToArray() : null,
         IndirectObjectIds = verbal.HasIndirectObject() ? verbal.IndirectObjects.Select(e => e.GetSerializationId()).ToArray() : null,
     });
 }
Пример #2
0
 /// <summary>
 /// Return a value indicating if the Verbal has any direct OR indirect objects bound to it which match the given predicate function.
 /// </summary>
 /// <param name="verbal">The verbal to test.</param>
 /// <param name="predicate">The predicate to test match objects.</param>
 /// <returns><c>true</c> if the Verbal has any direct OR indirect objects bound to it which match the given predicate function; otherwise, <c>false</c>.</returns>
 public static bool HasObject(this IVerbal verbal, Func <IEntity, bool> predicate) => verbal.HasDirectObject(predicate) || verbal.HasIndirectObject(predicate);
Пример #3
0
 /// <summary>
 /// Return a value indicating if the Verbal has any direct OR indirect objects bound to it.
 /// </summary>
 /// <param name="verbal">The verbal to test.</param>
 /// <returns><c>true</c> if the Verbal has any direct OR indirect objects bound to it; otherwise, <c>false</c>.</returns>
 public static bool HasObject(this IVerbal verbal) => verbal.HasDirectObject() || verbal.HasIndirectObject();