Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CustomWarning.cs « Dependencies « Extensibility « Mono.Linker.Tests.Cases « test - github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9b35ce0d4f6a4106c3ac464edb9fb510e5ba1047 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using System.Collections.Generic;
using Mono.Cecil;
using Mono.Linker;
using Mono.Linker.Steps;

public class CustomWarning : IMarkHandler
{
	LinkContext _context;

	public void Initialize (LinkContext context, MarkContext markContext)
	{
		_context = context;
		markContext.RegisterMarkTypeAction (type => WarnOnKnownType (type));
	}

	void WarnOnKnownType (TypeDefinition type )
	{
		if (type.Name == "KnownTypeThatShouldWarn")
			_context.LogMessage (MessageContainer.CreateCustomWarningMessage (_context, "custom warning on type", 6200, new MessageOrigin (type), WarnVersion.ILLink5));
	}
}