private void Add(MethodBaseSig sig)
 {
     if (sig == null)
     {
         return;
     }
     Add(sig.RetType);
     Add(sig.Params);
     Add(sig.ParamsAfterSentinel);
 }
 private void Add(MethodBaseSig msig)
 {
     if (msig == null)
     {
         return;
     }
     Add(msig.ExtraData);
     Add(msig.RetType);
     Add(msig.Params);
     Add(msig.ParamsAfterSentinel);
 }
Exemple #3
0
        private bool ContainsGenericParameterInternal(MethodBaseSig mbs)
        {
            if (mbs == null)
            {
                return(false);
            }
            if (!recursionCounter.Increment())
            {
                return(false);
            }

            bool res = ContainsGenericParameterInternal(mbs.RetType) ||
                       ContainsGenericParameter(mbs.Params) ||
                       ContainsGenericParameter(mbs.ParamsAfterSentinel);

            recursionCounter.Decrement();
            return(res);
        }
Exemple #4
0
 /// <summary>
 /// Gets the parameters after the sentinel
 /// </summary>
 /// <param name="sig">this</param>
 /// <returns>Parameters after sentinel or <c>null</c> if none</returns>
 public static IList <TypeSig> GetParamsAfterSentinel(this MethodBaseSig sig)
 {
     return(sig == null ? null : sig.ParamsAfterSentinel);
 }
Exemple #5
0
 /// <summary>
 /// Gets the generic parameter count
 /// </summary>
 /// <param name="sig">this</param>
 /// <returns>Generic parameter count</returns>
 public static uint GetGenParamCount(this MethodBaseSig sig)
 {
     return(sig == null ? 0 : sig.GenParamCount);
 }
Exemple #6
0
 /// <summary>
 /// Gets the parameter count
 /// </summary>
 /// <param name="sig">this</param>
 /// <returns>Parameter count</returns>
 public static int GetParamCount(this MethodBaseSig sig)
 {
     return(sig == null ? 0 : sig.Params.Count);
 }
Exemple #7
0
 /// <summary>
 /// Gets the parameters
 /// </summary>
 /// <param name="sig">this</param>
 /// <returns>The parameters</returns>
 public static IList <TypeSig> GetParams(this MethodBaseSig sig)
 {
     return(sig == null?ThreadSafeListCreator.Create <TypeSig>() : sig.Params);
 }
Exemple #8
0
 /// <summary>
 /// Gets the return type
 /// </summary>
 /// <param name="sig">this</param>
 /// <returns>Return type or <c>null</c> if none</returns>
 public static TypeSig GetRetType(this MethodBaseSig sig)
 {
     return(sig == null ? null : sig.RetType);
 }
Exemple #9
0
 /// <summary>
 /// Checks whether <paramref name="methodSig"/> contains a <see cref="GenericVar"/> or a
 /// <see cref="GenericMVar"/>.
 /// </summary>
 /// <param name="methodSig">Method or property signature</param>
 /// <returns><c>true</c> if <paramref name="methodSig"/> contains a <see cref="GenericVar"/>
 /// or a <see cref="GenericMVar"/>.</returns>
 public static bool ContainsGenericParameter(MethodBaseSig methodSig)
 {
     return(new TypeHelper().ContainsGenericParameterInternal(methodSig));
 }