BuildingCoder.CmdElevationWatcher.Execute C# (CSharp) Метод

Execute() публичный Метод

public Execute ( ExternalCommandData commandData, string &message, ElementSet elements ) : System.Result
commandData ExternalCommandData
message string
elements ElementSet
Результат System.Result
        public Result Execute(
            ExternalCommandData commandData,
            ref string message,
            ElementSet elements)
        {
            UIApplication uiapp = commandData.Application;
              Application app = uiapp.Application;

              if( null == _handler )
              {
            _handler
              = new EventHandler<DocumentChangedEventArgs>(
            OnDocumentChanged );

            // Subscribe to DocumentChanged event

            app.DocumentChanged += _handler;
              }
              else
              {
            app.DocumentChanged -= _handler;
            _handler = null;
              }
              return Result.Succeeded;
        }