public override void Init()
        {
            IUIAutomation5 uia5 = this.IUIAutomation5;

            if (uia5 != null)
            {
                uia5.AddNotificationEventHandler(this.Element, this.Scope, null, this);
                this.IsHooked = true;
            }
        }
 protected override void Dispose(bool disposing)
 {
     if (!disposedValue)
     {
         if (disposing)
         {
             if (this.IsHooked)
             {
                 IUIAutomation5 uia5 = this.IUIAutomation5;
                 if (uia5 != null)
                 {
                     uia5.RemoveNotificationEventHandler(this.Element, this);
                 }
             }
         }
     }
     base.Dispose(disposing);
 }