1 //
2 // Copyright (c) 2010-2018 Antmicro
3 // Copyright (c) 2011-2015 Realtime Embedded
4 //
5 // This file is licensed under the MIT License.
6 // Full license text is available in 'licenses/MIT.txt'.
7 //
8 using System;
9 using Antmicro.Renode.Plugins;
10 using Antmicro.Renode;
11 using Antmicro.Renode.UserInterface;
12 
13 namespace Antmicro.Renode.Plugins.SampleCommandPlugin
14 {
15     [Plugin(Name = "Sample command plugin", Version = "1.0", Description = "Sample plugin providing \"hello\" command.", Vendor = "Antmicro")]
16     public sealed class SampleCommandPlugin : IDisposable
17     {
SampleCommandPlugin(Monitor monitor)18         public SampleCommandPlugin(Monitor monitor)
19         {
20             this.monitor = monitor;
21             helloCommand = new HelloCommand(monitor);
22             monitor.RegisterCommand(helloCommand);
23         }
24 
Dispose()25         public void Dispose()
26         {
27             monitor.UnregisterCommand(helloCommand);
28         }
29 
30         private readonly HelloCommand helloCommand;
31         private readonly Monitor monitor;
32     }
33 }
34