// Inside Task Pane Control

private void button2_Click(object sender, EventArgs e)
{
     // retrieve the invokable methods from DEFAULT_TP control and add them to a ComboBox
     comboBox1.Items.AddRange((string[]) _OwnerHost.OwnerAddin.RetrieveUIHostByControlType(enumHostedControl.DEFAULT_TP).GetInvokableMethods().ToArray());
}

private void button3_Click(object sender, EventArgs e)
{
     // invoke a selected method w/o parameters
     bool IsSuccess = _OwnerHost.OwnerAddin.RetrieveUIHostByControlType(enumHostedControl.DEFAULT_TP).InvokeMethod(comboBox1.Text);
     // invoke a selected method with parameters
     bool IsSuccess2 = _OwnerHost.OwnerAddin.RetrieveUIHostByControlType(enumHostedControl.DEFAULT_TP).InvokeMethod(comboBox1.Text, new object[] { 123, "hello world"});
}

Last edited Jun 16, 2010 at 3:48 PM by fixitchris, version 3

Comments

No comments yet.