There seems to be no zenon-API-property to read the Addin-version (= AddInInfo.cs - [assembly: Addin("AddInName", "x.x")] ) from within the Addin.
But it seems possible to read it using reflection on the assembly-attributes.
=> C# Code-snippet (Tested in zenon v11.0 in an ProjectWizardExtension):
using System.Linq;
using System.Runtime.InteropServices;
// First: Get the AddinAttribute from the list of all attributes
object[] attributes = this.GetType().Assembly.GetCustomAttributes(typeof(Mono.Addins.AddinAttribute), false);
if (attributes != null && attributes.Length > 0)
{
Mono.Addins.AddinAttribute attribute = attributes.OfType<Mono.Addins.AddinAttribute>().SingleOrDefault();
if (attribute != null)
{
// Second: Read the version from the AddinAttribute
string version = attribute.Version;
}
}
// Generally based on informations from: https://stackoverflow.com/questions/187495/how-to-read-assembly-attributes