DeactivateUIControlArgs Class - Cloud - Author-it

Development Documentation

Provides properties that enable you to add a control deactivation plug-in to Author.

Example Code

The code below shows an example of using the DeactivateUIAddArgs and DeactivateUIControlArgs classes to implement a plug-in that disables the Create Book button on the main form in Author.

using AuthoritExtensibility;

namespace Sample_ControlDeactivationPlugin

{

public class PluginManager : IPlugin

{

private AitApplicationProxy proxy;

public PluginManager(AitApplicationProxy hostProxy)

{

proxy = hostProxy; //Set the local proxy to the proxy passed by the host

DeactivateUIAddArgs disableArgs = new DeactivateUIAddArgs(); //Initiatilize the plug-in arguments

disableArgs.OnClick = disableArgs_OnClick; //Set the launch point for the plug-in

disableArgs.PluginName = "Deactivation Plug-in"; //Set the name for the plug-in

proxy.AddPluginToDeactivateUI(disableArgs); //Add the plug-in to the host

}

public void disableArgs_OnClick(object sender, AuthoritEventArgs args)

{

DeactivateUIControlArgs controlArgs = new DeactivateUIControlArgs(); //Initialize the control deactivation arguments

controlArgs.ControlName = "CreateBook"; //Set the name of the control to deactivate

controlArgs.ControlType = UIControlType.RibbonButton; //Set the type of the control

controlArgs.DeactivationType = DeactivationType.Disabled; //Set the deactivation type

controlArgs.ParentForm = TargetForm.MainForm; //Set the form for the control

proxy.UIControlDeactivate(controlArgs); //Add the deactivation arguments to the host

}

}

}