Sample 01: access to the output window

The IContract interface provides event handlers with which messages can be written into the output window or the display can be cleared. IContract is handed down to the IContractWpf interface and implemented by the AddInEntryPoint class.

Sample C#

public partial class MainWindow : Window
{
  AddInEntryPoint addInEntryPoint = null;

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

  private void buttonClear_Click(object sender, RoutedEventArgs e)
  {
    this.addInEntryPoint.RaiseClearLogEvent();
  }

  private void buttonLogEvent_Click(object sender, RoutedEventArgs e)
  {
    this.addInEntryPoint.RaiseLogEvent((LogLevel)comboBoxLogLevelCombo.SelectedIndex, textBoxMessage.Text);
  }
}

Download

AddInSample01.zip