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

            if (mref.GenericParameters.Count <= 0)
            {
                return;
            }

            foreach (var genparam in mref.GenericParameters.Where(genparam => genparam.Constraints.Count > 0))
            {
                Write(CSharpKeyword.@where, SpaceSurrounder.Both);
                genparam.Accept(this);
                VisitVisitableCollection(GenericConstraintListStart, String.Empty, BasicSeparator, false, genparam.Constraints);
            }
        }
Ejemplo n.º 2
0
        protected override void WriteMethodSignature(MethodReference mref)
        {
            if (IsUnsafe(mref))
            {
                WriteComment("This method is 'unsafe' and cannot be used in VB.NET");
                Write(Comment);
            }
            mref.Accept(this);

            if (mref.ReturnType.FullName == typeof(void).FullName)
            {
                return;
            }

            Write(VisualBasicKeyword.As, SpaceSurrounder.Both);
            VisitTypeReference(mref.ReturnType);
        }
Ejemplo n.º 3
0
        public void VisitorWithReturnIsImplemented()
        {
            var sut = new MethodReference();

            sut.Accept(23).VerifyWithReturn(v => v.Visit(sut, 23));
        }