Sample 02: readout of a template description

General information about a template is made available by the TemplateDescription class. The TemplateDescriptionProvider class and its static method GetTemplateDecription return the template description for the desired template.

Sample C#

 public partial class MainWindow : Window
{
  BAProjectBuilder projectBuilder = null;

  public MainWindow(AddInEntryPoint addInEntryPoint)
  {
    InitializeComponent();
    // Code here
    this.projectBuilder = new BAProjectBuilder();
  }

  private void buttonGetInfos_Click(object sender, RoutedEventArgs e)
  {
    TemplateDescription td = this.projectBuilder.TemplateDescriptionProvider.GetTemplateDescription("BAC_Hys_01");
    List<string> items = new List<string>();
    items.Add("Name:\t\t\t" + td.Name);
    items.Add("Summary:\t\t" + td.Summary);
    items.Add("Company:\t\t" + td.Company);
    items.Add("Version:\t\t\t" + td.Version.ToString());
    items.Add("Change Date:\t\t" + td.ChangeDate.ToLongDateString());
    items.Add("File Path:\t\t\t" + td.FilePath);
    items.Add("Has BACnetObjects:\t" + td.HasBACnetObjects);
    items.Add("Has Parameters:\t\t" + td.HasParameters);
    items.Add("Has Inputs:\t\t" + td.HasInputs);
    items.Add("Has Outputs:\t\t" + td.HasOutputs); 
    listBoxInfos.ItemsSource = items;
  }
}

 

Sample 02: readout of a template description 1:

Download

AddInSample02.zip