コード例 #1
0
        private TIntermediateParameter AddInternal(string name, IType parameterType, ParameterCoercionDirection direction)
        {
            TIntermediateParameter item = this.GetNewParameter(name, parameterType, direction);

            this._Add(item.UniqueIdentifier, item);
            return(item);
        }
コード例 #2
0
 /// <summary>
 /// Adds a <see cref="TypedName"/> to the
 /// <see cref="TypedNameSeries"/> with the
 /// <paramref name="name"/>, <paramref name="symbolType"/> and
 /// <paramref name="direction"/> provided.
 /// </summary>
 /// <param name="name">The name of the type name pair.</param>
 /// <param name="symbolType">The <see cref="String"/> representing
 /// the symbol type to be resolved later.</param>
 /// <param name="direction">The direction for the type name pair,
 /// if used for a parameter.</param>
 public void Add(string name, string symbolType, ParameterCoercionDirection direction)
 {
     if (this.frozen)
     {
         throw new InvalidOperationException("Immutable.");
     }
     if (this.data == null)
     {
         this.data = new TypedName[1];
     }
     this.data = this.data.EnsureSpaceExists(this.actualLength, 1);
     this.data[this.actualLength++] = new TypedName(name, symbolType, direction);
 }
コード例 #3
0
        /// <summary>
        /// Creates a new <see cref="TypedName"/> with the
        /// <paramref name="name"/>, symbol type
        /// <paramref name="reference"/>, and
        /// <paramref name="direction"/> provided.
        /// </summary>
        /// <param name="name">The <see cref="System.String"/>
        /// which relates to the name of the <see cref="TypedName"/>.</param>
        /// <param name="reference">The symbol relative to the type
        /// the <see cref="TypedName"/> refers to.</param>
        /// <param name="direction">The <see cref="ParameterCoercionDirection"/>
        /// which indicates how the type should be directed.</param>
        /// <remarks><para>The usage of the typed name may require the
        /// symbol to be resolved immediately. One such example is creating a
        /// generic method that uses a type-parameter that's referenced
        /// after the type-parameter is created.</para>
        /// <para>The <paramref name="direction"/> may be disposed
        /// of in cases where it does not apply.</para></remarks>
        /// <exception cref="System.ArgumentNullException">thrown when <paramref name="name"/> or
        /// <paramref name="reference"/> is null.</exception>
        /// <exception cref="System.ArgumentOutOfRangeException">thrown when
        /// <paramref name="direction"/> is invalid.</exception>
        public TypedName(string name, string reference, ParameterCoercionDirection direction)
        {
            switch (direction)
            {
            case ParameterCoercionDirection.In:
            case ParameterCoercionDirection.Out:
            case ParameterCoercionDirection.Reference:
                this.direction = direction;
                break;

            default:
                throw new ArgumentOutOfRangeException("direction");
            }
            this.name            = name;
            this.symbolReference = reference;
            this.reference       = null;
        }
コード例 #4
0
                protected override IIntermediateMethodParameterMember <IClassMethodMember, IIntermediateClassMethodMember, IClassType, IIntermediateClassType> GetNewParameter(string name, IType parameterType, ParameterCoercionDirection direction)
                {
                    ParameterMember result = new ParameterMember(this.Parent)
                    {
                        Direction = direction, ParameterType = parameterType
                    };

                    result.AssignName(name);
                    return(result);
                }
 /// <summary>
 /// Creates a new <see cref="ParameterMember"/> with the <paramref name="parent"/>,
 /// <paramref name="name"/>, <paramref name="parameterType"/> and
 /// <paramref name="direction"/> provided.
 /// </summary>
 /// <param name="parent">The <typeparamref name="TIntermediateEvent"/> which
 /// contains the <see cref="ParameterMember"/>.</param>
 /// <param name="name">The <see cref="String"/>
 /// name of the parameter.</param>
 /// <param name="parameterType">The <see cref="IType"/> of the parameter.</param>
 /// <param name="direction">The <see cref="ParameterCoercionDirection"/> which determines how the informaiton about the parameter
 /// is managed (in, out, or by reference).</param>
 public ParameterMember(IntermediateEventMember <TEvent, TIntermediateEvent, TEventParent, TIntermediateEventParent, TMethodMember> parent, string name, IType parameterType, ParameterCoercionDirection direction)
     : base(((TIntermediateEvent)((object)(parent))), name, parameterType, direction)
 {
 }
コード例 #6
0
 IIntermediateParameterMember IIntermediateParameterMemberDictionary.Add(string name, IType parameterType, ParameterCoercionDirection direction)
 {
     return(Add(name, parameterType, direction));
 }
コード例 #7
0
 /// <summary>
 /// Obtains a <typeparamref name="TIntermediateParameter"/>
 /// for insertion into the <see cref="IntermediateParameterMemberDictionary{TParent, TIntermediateParent, TParameter, TIntermediateParameter}"/>.
 /// </summary>
 /// <param name="name">The name of the parameter to create.</param>
 /// <param name="parameterType">The type of the parameter to create.</param>
 /// <param name="direction">The direction in which the <typeparamref name="TIntermediateParameter"/>
 /// is coerced.</param>
 /// <returns>A new <typeparamref name="TIntermediateParameter"/> instance.</returns>
 protected abstract TIntermediateParameter GetNewParameter(string name, IType parameterType, ParameterCoercionDirection direction);
コード例 #8
0
 /// <summary>
 /// Adds a new <typeparamref name="TIntermediateParameter"/> instance
 /// with the <paramref name="name"/>, <paramref name="parameterType"/> and
 /// <paramref name="direction"/>
 /// provided.
 /// </summary>
 /// <param name="name">The name of the parameter to add.</param>
 /// <param name="parameterType">The type of the parameter to add.</param>
 /// <param name="direction">The direction in which the <typeparamref name="TIntermediateParameter"/>
 /// is coerced.</param>
 /// <returns>A new <typeparamref name="TIntermediateParameter"/>
 /// as it exists in the <see cref="IIntermediateParameterMemberDictionary{TParent, TIntermediateParent, TParameter, TIntermediateParameter}"/>.</returns>
 public TIntermediateParameter Add(string name, IType parameterType, ParameterCoercionDirection direction)
 {
     LockCheckAndThrow();
     return(AddInternal(name, parameterType, direction));
 }
 /// <summary>
 /// Obtains a <see cref="ParameterMember"/>
 /// for insertion into the <see cref="ParameterDictionary"/>.
 /// </summary>
 /// <param name="name">The name of the parameter to create.</param>
 /// <param name="parameterType">The type of the parameter to create.</param>
 /// <param name="direction">The direction in which the <see cref="ParameterMember"/>
 /// is coerced.</param>
 /// <returns>A new <see cref="ParameterMember"/> instance, if successful.</returns>
 protected override IIntermediateEventParameterMember <TEvent, TIntermediateEvent, TEventParent, TIntermediateEventParent> GetNewParameter(string name, IType parameterType, ParameterCoercionDirection direction)
 {
     return(new ParameterMember(this.Parent, name, parameterType, direction));
 }
コード例 #10
0
 /// <summary>
 /// Creates a new <see cref="TypedName"/> with the
 /// <paramref name="name"/>, <paramref name="runtimeType"/>, <paramref name="identityManager"/>,
 /// <paramref name="direction"/>, and optional <paramref name="relativeSource"/>.
 /// </summary>
 /// <param name="name">The <see cref="System.String"/>
 /// which relates to the name of the <see cref="TypedName"/>.</param>
 /// <param name="runtimeType">The <see cref="RuntimeCoreType"/> relative to the
 /// identity of the type to retrieve from the <paramref name="identityManager"/>.</param>
 /// <param name="identityManager">The <see cref="IIdentityManager"/> responsible for
 /// disambiguating the <paramref name="runtimeType"/>.</param>
 /// <param name="direction">The <see cref="ParameterCoercionDirection"/>
 /// which indicates how the type should be directed.</param>
 /// <param name="relativeSource">The <see cref="IAssembly"/> relative to the
 /// <paramref name="runtimeType"/> used for context, which either contains the type
 /// or references the assembly containing the type.</param>
 public TypedName(string name, RuntimeCoreType runtimeType, IIdentityManager identityManager, ParameterCoercionDirection direction, IAssembly relativeSource = null)
     : this(name, identityManager.ObtainTypeReference(runtimeType, relativeSource), direction)
 {
 }
コード例 #11
0
            protected override IIntermediateConstructorSignatureParameterMember <TCtor, TIntermediateCtor, TType, TIntermediateType> GetNewParameter(string name, IType parameterType, ParameterCoercionDirection direction)
            {
                Parameter result = new Parameter(Parent)
                {
                    Direction = direction, ParameterType = parameterType
                };

                result.AssignName(name);
                return(result);
            }
コード例 #12
0
            protected override IIntermediateIndexerSignatureParameterMember <TIndexer, TIntermediateIndexer, TIndexerParent, TIntermediateIndexerParent> GetNewParameter(string name, IType parameterType, ParameterCoercionDirection direction)
            {
                ParameterMember result = new ParameterMember(Parent, this.assembly)
                {
                    Direction = direction, ParameterType = parameterType
                };

                result.AssignName(name);
                return(result);
            }
コード例 #13
0
 /// <summary>
 /// Creates a new <see cref="DirectionExpression"/> with the <paramref name="directed"/> to coerce in the
 /// <paramref name="direction"/> provided.
 /// </summary>
 /// <param name="directed">The <see cref="IExpression"/> to direct.</param>
 /// <param name="direction">The <see cref="ParameterCoercionDirection"/> to direct the <paramref name="directed"/>.</param>
 public DirectionExpression(IExpression directed, ParameterCoercionDirection direction)
 {
     this.Directed  = directed;
     this.Direction = direction;
 }
コード例 #14
0
            protected override IIntermediateDelegateTypeParameterMember GetNewParameter(string name, IType parameterType, ParameterCoercionDirection direction)
            {
                ParameterMember result = new ParameterMember(Parent)
                {
                    Direction = direction, ParameterType = parameterType
                };

                result.AssignName(name);
                return(result);
            }
 //private CovariantReadOnlyCollection<ILambdaTypeInferredExpressionParameterMember, ILambdaTypedExpressionParameterMember>
 protected override ILambdaTypedExpressionParameterMember GetNewParameter(string name, Abstract.IType parameterType, ParameterCoercionDirection direction)
 {
     throw new NotImplementedException();
 }
コード例 #16
0
 public Parameter(TIntermediateEvent parent, string name, IType parameterType, ParameterCoercionDirection direction)
     : base(parent, name, parameterType, direction)
 {
 }
 /// <summary>
 /// Creates a new <see cref="IntermediateEventSignatureParameterMember{TEvent, TIntermediateEvent, TEventParameter, TIntermediateEventParameter, TEventParent, TIntermediateEventParent}"/>
 /// with the <paramref name="parent"/>,
 /// <paramref name="name"/>, <paramref name="parameterType"/> and
 /// <paramref name="direction"/> provided.
 /// </summary>
 /// <param name="parent">The <typeparamref name="TIntermediateEvent"/> which
 /// contains the <see cref="IntermediateEventSignatureParameterMember{TEvent, TIntermediateEvent, TEventParameter, TIntermediateEventParameter, TEventParent, TIntermediateEventParent}"/>.</param>
 /// <param name="name">The <see cref="String"/>
 /// name of the parameter.</param>
 /// <param name="parameterType">The <see cref="IType"/> of the parameter.</param>
 /// <param name="direction">The <see cref="ParameterCoercionDirection"/> which determines how the informaiton about the parameter
 /// is managed (in, out, or by reference).</param>
 public IntermediateEventSignatureParameterMember(TIntermediateEvent parent, string name, IType parameterType, ParameterCoercionDirection direction)
     : base(parent, parent.Parent.Assembly)
 {
     this.Name          = name;
     this.ParameterType = parameterType;
     this.Direction     = direction;
 }