Mono.UIAutomation.Winforms.ScrollBehaviorObserver.Terminate C# (CSharp) Method

Terminate() public method

public Terminate ( ) : void
return void
		public void Terminate ()
		{
			HorizontalScrollBar = null;
			VerticalScrollBar = null;

			if (hscrollbarProvider != null) {
				subject.RemoveChildProvider (hscrollbarProvider);
				hscrollbarProvider.Terminate ();
				hscrollbarProvider = null;
			}

			if (vscrollbarProvider != null) {
				subject.RemoveChildProvider (vscrollbarProvider);
				vscrollbarProvider.Terminate ();
				vscrollbarProvider = null;
			}
		}

Usage Example

Example #1
0
            protected override void InitializeScrollBehaviorObserver()
            {
                // We implement Scroll logic this way because the internal
                // control in charge of handling scrolling is disposed when
                // DropDownStyle is changed and is Expanded/Collapsed
                if (observer != null &&
                    (ListBoxControl == null || ListBoxControl != listControl))
                {
                    observer.ScrollPatternSupportChanged -= OnScrollPatternSupportChanged;
                    observer.Terminate();
                    SetBehavior(ScrollPatternIdentifiers.Pattern, null);
                }

                if (ListBoxControl != null && ListBoxControl != listControl)
                {
                    if (ListBoxControl != null)
                    {
                        observer = new ScrollBehaviorObserver(this, null, VerticalScrollBar);
                        observer.ScrollPatternSupportChanged += OnScrollPatternSupportChanged;
                        observer.Initialize();
                        UpdateScrollBehavior(observer);
                        ListBoxControl.Disposed += delegate(object obj, EventArgs args) {
                            observer.Terminate();
                            SetBehavior(ScrollPatternIdentifiers.Pattern, null);
                            listControl = null;
                        };
                    }
                    listControl = ListBoxControl;
                }
            }
All Usage Examples Of Mono.UIAutomation.Winforms.ScrollBehaviorObserver::Terminate