hs dreamer
Guest
|
I need that form to appear only in some types of inspector, for example, when CurrentItem is mail and mail is not send (that opened to be edited now). if I work with current form instance, created by ADX, there are still visible panel under it, but when i trying to disable ADX form it disappers for all inspector windows... what you can suggest me? |
|
Fedor Shihantsov
Guest
|
Use the adxOlFormsManager.ADXNewInspector event.
//
// adxOlFormsCollectionItem1
//
//this.adxOlFormsCollectionItem1.FormClassName = "TestAddin.ADXOlForm1";
//this.adxOlFormsCollectionItem1.InspectorItemTypes = AddinExpress.OL.ADXOlInspectorItemTypes.olMail;
//this.adxOlFormsCollectionItem1.InspectorLayout = AddinExpress.OL.ADXOlInspectorLayout.RightSubpane;
private void adxOlFormsManager1_ADXNewInspector(object inspectorObj)
{
object currentItem = (inspectorObj as Outlook.Inspector).CurrentItem;
Outlook.MailItem mailItem = currentItem as Outlook.MailItem;
if (mailItem != null)
{
// prevents removing cashed forms
adxOlFormsManager1.LockUpdates();
if (mailItem.Subject == "MySubject")
{
adxOlFormsManager1.Items[0].Enabled = false;
}
else
{
adxOlFormsManager1.Items[0].Enabled = true;
}
adxOlFormsManager1.UnlockUpdates();
}
}
|
|
David Ing
Posts: 56
Joined: 2006-06-27
|
Fedor,
I might be doing something wrong, but when I previously used the .Enabled flag on a FormsManager.Item, and wrapped it in FormsManager Lock/UnLockUpdates, then it failed to work.
It's only when I removed the Lock/UnlockUpdate just around the .Enable property that it seems to trigger it ok (this doesn't apply other properties, just .Enable).
|
|
Fedor Shihantsov
Guest
|
David,
What do you mean "it failed to work"?
Can you give me more details?
|
|