Ejemplo n.º 1
0
        /// <summary>
        /// The external command callback.
        /// </summary>
        /// <param name="commandData"></param>
        /// <param name="message"></param>
        /// <param name="elements"></param>
        /// <returns></returns>
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            Document doc = commandData.Application.ActiveUIDocument.Document;

            if (monitor == null)
            {
                monitor = new PostCommandRevisionMonitor(doc);
                monitor.Activate();
                commandButton.ItemText = "Remove Revision Monitor";
            }
            else
            {
                monitor.Deactivate();
                monitor = null;
                commandButton.ItemText = "Setup Revision Monitor";
            }

            return(Result.Succeeded);
        }
 /// <summary>
 /// The constructor for the event instance.
 /// </summary>
 /// <param name="monitor">The instance of the command.</param>
 public PostCommandRevisionMonitorEvent(PostCommandRevisionMonitor monitor)
 {
     this.monitor = monitor;
 }