コード例 #1
0
        /// <summary>
        /// Creates a new term of the specified type, with the specified subterms and annotations.
        /// </summary>
        /// <param name="termFactory">The term factory.</param>
        /// <param name="subterms">The subterms.</param>
        /// <returns>The created term.</returns>
        public static T Create <T>(this ITermFactory termFactory, IEnumerable <ITerm> subterms)
        {
            #region Contract
            if (termFactory == null)
            {
                throw new ArgumentNullException(nameof(termFactory));
            }
            if (subterms == null)
            {
                throw new ArgumentNullException(nameof(subterms));
            }
            #endregion

            return(termFactory.Create <T>(subterms, Enumerable.Empty <ITerm>()));
        }
コード例 #2
0
        /// <summary>
        /// Creates a new term of the specified type, with the specified subterms and annotations.
        /// </summary>
        /// <param name="termFactory">The term factory.</param>
        /// <param name="subterms">The subterms.</param>
        /// <param name="annotations">The annotations.</param>
        /// <returns>The created term.</returns>
        public static T Create <T>(this ITermFactory termFactory, IEnumerable <ITerm> subterms, IEnumerable <ITerm> annotations)
        {
            #region Contract
            if (termFactory == null)
            {
                throw new ArgumentNullException(nameof(termFactory));
            }
            if (subterms == null)
            {
                throw new ArgumentNullException(nameof(subterms));
            }
            if (annotations == null)
            {
                throw new ArgumentNullException(nameof(annotations));
            }
            #endregion

            return((T)termFactory.Create(typeof(T), subterms, annotations));
        }
コード例 #3
0
 /// <summary>
 /// Creates a new term of the specified type, with the specified subterms and annotations.
 /// </summary>
 /// <param name="termFactory">The term factory.</param>
 /// <param name="type">The type of term.</param>
 /// <param name="subterms">The subterms.</param>
 /// <returns>The created term.</returns>
 public static ITerm Create(this ITermFactory termFactory, Type type, params ITerm[] subterms)
 => termFactory.Create(type, (IEnumerable <ITerm>)subterms);
コード例 #4
0
 /// <summary>
 /// Creates a new term of the specified type, with the specified subterms and annotations.
 /// </summary>
 /// <param name="termFactory">The term factory.</param>
 /// <param name="subterms">The subterms.</param>
 /// <returns>The created term.</returns>
 public static T Create <T>(this ITermFactory termFactory, params ITerm[] subterms)
 => termFactory.Create <T>((IEnumerable <ITerm>)subterms);