public MethodName InsertParameterAt(int index, string name, TypeName parameterType, IEnumerable <TypeName> requiredModifiers, IEnumerable <TypeName> optionalModifiers) { var modifiers = new ModifierCollection(requiredModifiers, optionalModifiers); return(WithParameters(Parameters.ImmutableInsertAt( index, new DefaultParameterName(this, index, name, parameterType, modifiers), CloneParameter ))); }
public MethodName AddParameter(string name, TypeName parameterType, IEnumerable <TypeName> requiredModifiers, IEnumerable <TypeName> optionalModifiers) { var modifiers = new ModifierCollection(requiredModifiers, optionalModifiers); return(WithParameters(Parameters.ImmutableAdd(new DefaultParameterName(this, Parameters.Count, name, parameterType, modifiers), CloneParameter))); }
public override MethodName WithReturnParameter(TypeName returnType, IEnumerable <TypeName> requiredModifiers, IEnumerable <TypeName> optionalModifiers) { var result = new DefaultMethodName(DeclaringType, _name); result._parameters = _parameters; result._genericParameters = _genericParameters; var modifiers = new ModifierCollection(requiredModifiers, optionalModifiers); result._returnParameter = new DefaultReturnParameterName(this, returnType, modifiers); return(result); }
internal DefaultParameterName(MemberName member, int position, string name, TypeName parameterType, ModifierCollection modifiers) { _parameterType = parameterType; _name = name; _member = member; _position = position; _modifiers = modifiers ?? ModifierCollection.Empty; }
public PropertyName SetIndexParameter(int index, string name, TypeName parameterType, IEnumerable <TypeName> requiredModifiers, IEnumerable <TypeName> optionalModifiers ) { var modifiers = new ModifierCollection(requiredModifiers, optionalModifiers); return(WithIndexParameters( IndexParameters.ImmutableSet(index, new DefaultParameterName(this, index, name, parameterType, modifiers), CloneParameter) )); }
public bool Match(ModifierCollection other) { if (_items.Count != other._items.Count) { return(false); } foreach (var kvp in _items) { if (!other._items.Contains(kvp)) { return(false); } } return(true); }
public View(ModifierCollection items, bool predicate) { _parent = items; _predicate = predicate; }