- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have two different add-ins, and each of them have IUpdaters in them. Currently they reference each other tp share some methods but I would like to be able to disable the updaters in one of the apps.
1. I have a static method that works fine within the app to do this.
internal static Result EnableUpdaters(UIControlledApplication UIApp, string name)
{
try
{
if(name == "room" || name == "all")
{
Updaters.RoomCreationUpdater roomUpdater = new Updaters.RoomCreationUpdater(UIApp.ActiveAddInId);
UpdaterRegistry.EnableUpdater(roomUpdater.GetUpdaterId());
}
return Result.Succeeded;
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return Result.Failed;
}
}
2. I have a public static method to call the Enable and Disable updater calls
public class SetUpdaters
{
public static void UpdaterOn(UIControlledApplication UIApp, string name)
{
App.EnableUpdaters(UIApp, name);
}
public static void UpdaterOff(UIControlledApplication UIApp, string name)
{
App.DisableUpdaters(UIApp, name);
}
}
3. Here is the call from the app. This call is using a control ID for the UIControlApp inside this app and passing it to the other. This is where I think I may be off, but when trying to use the static variable stored in the other app in lieu of passing it, that doesn't work either and I get the same error message.
OtherApp.Controls.SetUpdaters.UpdaterOff(ControlParams.application,"room");
4. When I make the call between apps, I get an error saying that "Updater with this Id is not currently registered," but then of course the updater fires immediately following closure for that dialog so I know its working, and the updater does what it is supposed to do, I am just trying to keep it from doing it.
Is there something fundamental here I am just overlooking?
Solved! Go to Solution.
Developer Advocacy and Support +