ICSharpCode.NRefactory.MonoCSharp.Method.Emit C# (CSharp) Method

Emit() public method

public Emit ( ) : void
return void
		public override void Emit ()
		{
			try {
				if (IsPartialDefinition) {
					if (partialMethodImplementation != null && CurrentTypeParameters != null) {
						CurrentTypeParameters.CheckPartialConstraints (partialMethodImplementation);

						var otp = partialMethodImplementation.CurrentTypeParameters;
						for (int i = 0; i < CurrentTypeParameters.Count; ++i) {
							var tp = CurrentTypeParameters [i];
							tp.Define (otp[i]);
						}
					}

					return;
				}
				
				if ((ModFlags & Modifiers.PARTIAL) != 0 && (caching_flags & Flags.PartialDefinitionExists) == 0) {
					Report.Error (759, Location, "A partial method `{0}' implementation is missing a partial method declaration",
						GetSignatureForError ());
				}

				if (CurrentTypeParameters != null) {
					for (int i = 0; i < CurrentTypeParameters.Count; ++i) {
						var tp = CurrentTypeParameters [i];

						tp.CheckGenericConstraints (false);
						tp.Emit ();
					}
				}

				if ((ModFlags & Modifiers.METHOD_EXTENSION) != 0)
					Module.PredefinedAttributes.Extension.EmitAttribute (MethodBuilder);

				base.Emit ();
			} catch (Exception e) {
				throw new InternalErrorException (this, e);
			}
		}