Instantiate IDE Extensions
- Last UpdatedJul 23, 2024
- 1 minute read
In order for the IDE to instantiate an extension public class at runtime, the extension implementation must be adorned with the custom attribute “ArchestrA.IDE.Extensibility.aaPluginAttribute”. The following example depicts tagging a public class with the “aaPluginAttribute” custom attribute.
[aaPlugin("2564EEA9-96FD-453d-907E-91FF9CA7CB68")]
public class NetworkView : System.Windows.Forms.UserControl, IaaIDEView
{
// TODO: Actual Implementation
}
Once the IDE discovers all of its extensions and determines their loading order, it tries to create instances of the extensions one by one. In order to find out class to instantiate from the extension module, IDE tries to match the “TypeId” value provided in the manifest with the value of the custom attribute “aaPluginAttribute” that the extension public classes are tagged with. This is an AllowMultiple type of custom attribute and so, it allows user to adorn single public class with multiple TypeId values. The end result is user can create multiple instances of the same class as IDE extensions. TypeId value is typically a GUID. Following is an example extract from the sample manifest, emphasizing on TypeId value match with the value of “aaPluginAttribute” custom attribute.
< NetworkView TypeId="2564EEA9-96FD-453d-907E-91FF9CA7CB68" Priority="600">
[aaPlugin("2564EEA9-96FD-453d-907E-91FF9CA7CB68")]
public class NetworkView : System.Windows.Forms.UserControl, IaaIDEView
{
// TODO: Actual Implementation
}