コード例 #1
0
        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
                                      )));
        }
コード例 #2
0
        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)));
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 internal DefaultParameterName(MemberName member,
                               int position,
                               string name,
                               TypeName parameterType,
                               ModifierCollection modifiers)
 {
     _parameterType = parameterType;
     _name          = name;
     _member        = member;
     _position      = position;
     _modifiers     = modifiers ?? ModifierCollection.Empty;
 }
コード例 #5
0
ファイル: PropertyName.cs プロジェクト: Carbonfrost/f-dotnet
        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)
                       ));
        }
コード例 #6
0
 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);
 }
コード例 #7
0
 public View(ModifierCollection items, bool predicate)
 {
     _parent    = items;
     _predicate = predicate;
 }