public static ConditionStatement ThrowIfNull(ParameterDeclaration param) { if (param==null) throw new ArgumentNullException("param"); return ThrowIfNull( Expr.Arg(param), Expr.New(typeof(ArgumentNullException),Expr.Prim(param.Name)) ); }
public static CatchClause Catch(ParameterDeclaration localParam) { return new CatchClause(localParam); }
public virtual ParameterDeclaration Add(ITypeDeclaration type, string name, bool nonNull) { ParameterDeclaration pm =new ParameterDeclaration(type,name,nonNull); this.List.Add(pm); return pm; }
/// <summary> /// Creates a reference to a given argument /// </summary> /// <param name="p"> /// The <see cref="ParameterDeclaration"/> instance to reference. /// </param> /// <returns> /// A <see cref="ArgumentReferenceExpression"/> instance referencing /// <paramref name="p"/>. /// </returns> /// <exception cref="ArgumentNullException"> /// <paramref name="p"/> is a null reference (Noting in Visual Basic) /// </exception> public static ArgumentReferenceExpression Arg( ParameterDeclaration p) { if (p==null) throw new ArgumentNullException("p"); return new ArgumentReferenceExpression(p); }
/// <summary> /// Removes the first occurrence of a specific ParameterDeclaration from this ParameterDeclarationCollection. /// </summary> /// <param name="value"> /// The ParameterDeclaration value to remove from this ParameterDeclarationCollection. /// </param> public virtual void Remove(ParameterDeclaration value) { this.List.Remove(value); }
/// <summary> /// Initializes a new instance of the ParameterDeclarationCollection class, containing elements /// copied from an array. /// </summary> /// <param name="items"> /// The array whose elements are to be added to the new ParameterDeclarationCollection. /// </param> public ParameterDeclarationCollection(ParameterDeclaration[] items) { this.AddRange(items); }
/// <summary> /// Inserts an element into the ParameterDeclarationCollection at the specified index /// </summary> /// <param name="index"> /// The index at which the ParameterDeclaration is to be inserted. /// </param> /// <param name="value"> /// The ParameterDeclaration to insert. /// </param> public virtual void Insert(int index, ParameterDeclaration value) { this.List.Insert(index, value); }
/// <summary> /// Return the zero-based index of the first occurrence of a specific value /// in this ParameterDeclarationCollection /// </summary> /// <param name="value"> /// The ParameterDeclaration value to locate in the ParameterDeclarationCollection. /// </param> /// <returns> /// The zero-based index of the first occurrence of the _ELEMENT value if found; /// -1 otherwise. /// </returns> public virtual int IndexOf(ParameterDeclaration value) { return this.List.IndexOf(value); }
/// <summary> /// Determines whether a specfic ParameterDeclaration value is in this ParameterDeclarationCollection. /// </summary> /// <param name="value"> /// The ParameterDeclaration value to locate in this ParameterDeclarationCollection. /// </param> /// <returns> /// true if value is found in this ParameterDeclarationCollection; /// false otherwise. /// </returns> public virtual bool Contains(ParameterDeclaration value) { return this.List.Contains(value); }
/// <summary> /// Adds the elements of an array to the end of this ParameterDeclarationCollection. /// </summary> /// <param name="items"> /// The array whose elements are to be added to the end of this ParameterDeclarationCollection. /// </param> public virtual void AddRange(ParameterDeclaration[] items) { foreach (ParameterDeclaration item in items) { this.List.Add(item); } }
static public CatchClause Catch(ParameterDeclaration localParam) { return(new CatchClause(localParam)); }