コード例 #1
0
ファイル: CSharpHelper.cs プロジェクト: rajeshpillai/Reflexil
		/// <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);
			}
		}
コード例 #2
0
		/// <summary>
		/// Write a method signature to the text buffer
		/// </summary>
		/// <param name="mref">Method reference</param>
		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);
		}