public override void Init() { IUIAutomation6 uia6 = this.IUIAutomation6; if (uia6 != null) { uia6.AddActiveTextPositionChangedEventHandler(this.Element, this.Scope, null, this); this.IsHooked = true; } }
protected override void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { if (this.IsHooked) { IUIAutomation6 uia6 = this.IUIAutomation6; if (uia6 != null) { uia6.RemoveActiveTextPositionChangedEventHandler(this.Element, this); } } } } base.Dispose(disposing); }