Exemplo n.º 1
0
        /// <summary>
        /// Write a method signature to the text buffer
        /// </summary>
        /// <param name="mdef">Method definition</param>
        protected override void WriteMethodSignature(MethodDefinition mdef)
        {
            mdef.Accept(this);

            if (mdef.GenericParameters.Count > 0)
            {
                foreach (GenericParameter genparam in mdef.GenericParameters)
                {
                    if (genparam.Constraints.Count > 0)
                    {
                        Write(ECSharpKeyword.@where, ESpaceSurrounder.Both);
                        genparam.Accept(this);
                        VisitVisitableCollection(GENERIC_CONSTRAINT_LIST_START, String.Empty, BASIC_SEPARATOR, false, genparam.Constraints);
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Write a method signature to the text buffer
        /// </summary>
        /// <param name="mdef">Method definition</param>
        protected override void WriteMethodSignature(MethodDefinition mdef)
        {
            mdef.Accept(this);

	        if (mdef.GenericParameters.Count <= 0) 
				return;
	        
			foreach (var genparam in mdef.GenericParameters.Where(genparam => genparam.Constraints.Count > 0))
			{
				Write(ECSharpKeyword.@where, ESpaceSurrounder.Both);
				genparam.Accept(this);
				VisitVisitableCollection(GenericConstraintListStart, String.Empty, BasicSeparator, false, genparam.Constraints);
			}
        }
        /// <summary>
        /// Write a method signature to the text buffer
        /// </summary>
        /// <param name="mdef">Method definition</param>
        protected override void WriteMethodSignature(MethodDefinition mdef)
        {
            if (IsUnsafe(mdef))
            {
                WriteComment("This method is 'unsafe' and cannot be used in VB.NET");
                Write(Comment);
            }
            mdef.Accept(this);
	        
			if (mdef.ReturnType.FullName == typeof (void).FullName)
				return;
	        
			Write(EVisualBasicKeyword.As, ESpaceSurrounder.Both);
	        VisitTypeReference(mdef.ReturnType);
        }