Exemplo n.º 1
0
 /// <summary>
 /// Obtains a type expression from the <paramref name="target"/> provided.
 /// </summary>
 /// <param name="target">The <see cref="Type"/> to receive the type reference
 /// expression of.</param>
 /// <param name="identityManager">The <see cref="ICliManager"/>
 /// which is responsible for marshalling type and assembly identities
 /// within the current type model.</param>
 /// <returns>A new <see cref="ITypeReferenceExpression"/>.</returns>
 /// <remarks>Used to obtain a type as an expression for linking a type as the
 /// origin of a primary expression.</remarks>
 /// <exception cref="System.ArgumentNullException">thrown when <paramref name="target"/> is null.</exception>
 public static ITypeReferenceExpression GetTypeExpression(this Type target, ICliManager identityManager)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     return(identityManager.ObtainTypeReference(target).GetTypeExpression());
 }
Exemplo n.º 2
0
 public static IExpressionFusionExpression Fuse(this Type target, string term, ICliManager identityManager)
 {
     return(identityManager.ObtainTypeReference(target).Fuse(term));
 }
Exemplo n.º 3
0
 public static IType GetTypeReference(this Type target, ICliManager identityManager)
 {
     return(identityManager.ObtainTypeReference(target));
 }
Exemplo n.º 4
0
 public static IControlledTypeCollection ToCollection(this Type[] entries, ICliManager identityManager)
 {
     return(new TypeCollection((from t in entries
                                select identityManager.ObtainTypeReference(t)).ToArray()));
 }
Exemplo n.º 5
0
 public static ICreateInstanceExpression GetNewExpression(this Type target, ICliManager identityManager, params IExpression[] parameters)
 {
     return(identityManager.ObtainTypeReference(target).GetNewExpression(parameters));
 }