blob: b196a53efe493e782a34906d14c59e1b27c4af6c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using Mono.Linker;
using Mono.Linker.Steps;
namespace CustomStep
{
public class CustomStep : IStep
{
public void Process (LinkContext context)
{
var warningMessage = MessageContainer.CreateCustomWarningMessage (
context: context,
text: "Warning",
code: 6001,
origin: new MessageOrigin (fileName: "CustomStep.cs"),
version: WarnVersion.Latest);
context.LogMessage (warningMessage);
}
}
public class CustomStepWithInvalidWarningCode : IStep
{
public void Process (LinkContext context)
{
// All codes in the range [1000-6000] are reserved for the linker
// and should not be used by external parties.
var invalidWarningMessage = MessageContainer.CreateCustomWarningMessage (
context: context,
text: "Warning",
code: 2500,
origin: new MessageOrigin (fileName: "CustomStep.cs"),
version: WarnVersion.Latest);
context.LogMessage (invalidWarningMessage);
}
}
}
|