C# Class SIL.FieldWorks.Common.RootSites.ActiveViewHelper

ActiveViewHelper attemps to keep track of the active view (i.e. an IRootSite) of a form.
Inheritance: IFWDisposable
ファイルを表示 Open project: sillsdev/FieldWorks Class Usage Examples

Public Methods

Method Description
ActiveViewHelper ( Control rootControl ) : System

Creates an ActiveViewHelper for the specified form.

CheckDisposed ( ) : void

Throw if the IsDisposed property is true

Dispose ( ) : void

Must not be virtual.

IsViewVisible ( IRootSite view ) : bool

Determines whether or not the specified view is visible.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.

If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.

Private Methods

Method Description
ControlWasAdded ( object sender, System.Windows.Forms.ControlEventArgs e ) : void
ControlWasRemoved ( object sender, System.Windows.Forms.ControlEventArgs e ) : void
DeepAddControl ( Control control ) : void

Recursively add handlers for the ControlAdded and GotFocus events of the specified control and all its sub-controls.

DeepRemoveControl ( Control control ) : void

Recursively remove handlers for the ControlAdded and GotFocus events of the specified control and all its sub-controls.

IsReallyVisible ( IRootSite site ) : bool

This function attempts to determine whether a root site can really be seen in the sense that it can reasonably receive commands (such as from the style dialog). It doesn't check everything possible; for example, a control could be visible in all the ways checked here and still covered by another control or scrolled out of sight.

ViewGotFocus ( object sender, EventArgs e ) : void

Handler for when a view gains focus. This sets the active view to the view that got focus.

Method Details

ActiveViewHelper() public method

Creates an ActiveViewHelper for the specified form.
public ActiveViewHelper ( Control rootControl ) : System
rootControl System.Windows.Forms.Control Control to create an ActiveViewHelper for
return System

CheckDisposed() public method

Throw if the IsDisposed property is true
public CheckDisposed ( ) : void
return void

Dispose() public method

Must not be virtual.
public Dispose ( ) : void
return void

Dispose() protected method

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.
If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.
protected Dispose ( bool disposing ) : void
disposing bool
return void

IsViewVisible() public method

Determines whether or not the specified view is visible.
public IsViewVisible ( IRootSite view ) : bool
view IRootSite
return bool