C# Class SIL.FieldWorks.Common.Controls.LanguageSetup

Summary description for LanguageSetup.
Inheritance: System.Windows.Forms.UserControl, IFWDisposable
Exibir arquivo Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
btnFind System.Windows.Forms.Button
cboLookup SIL.FieldWorks.Common.Controls.FwOverrideComboBox
lblOtherNamesList System.Windows.Forms.Label
lvFindResult System.Windows.Forms.ListView
m_lastSearchText string
m_messageFilter TrapEnterFilter
m_testing bool
txtFindPattern System.Windows.Forms.TextBox

Public Methods

Method Description
CheckDisposed ( ) : void

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.

LanguageSetup ( ) : System

Initializes a new instance of the LanguageSetup class.

PerformInitialSearch ( string target ) : void

This is called just before ShowDialog. It sets up the target string as a language name and performs an initial search for this language as the dialog comes up.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

DoInitialSearch ( ) : void

Do the initial search requested if m_initialTarget has been set.

LoadList ( string searchText ) : void

LoadList ( string searchText, bool fShowErrorMessage ) : void

Fill the controls based on the current search, and (if requested) display an error message if not found.

LoadOtherNames ( ) : void

OnHandleDestroyed ( EventArgs e ) : void

OnLoad ( EventArgs e ) : void

Do the initial search when we bring up the control

SelectClosestMatch ( ) : void

Select the first exact match in the language column, or if none found, select the first item.

SettingsForNoLanguage ( ) : void

Fix the settings for either a search failure or clicking on the "None of the above" item.

btnFind_Click ( object sender, System e ) : void

When we get here, it means there was a long enough pause while typing in the search for text box that a search should be kicked off.

lvFindResult_SelectedIndexChanged ( object sender, EventArgs e ) : void

Private Methods

Method Description
CompareCountryFirst ( Ethnologue x, Ethnologue y ) : int

Implements sorting by country name, then by language name.

CompareEthnoCodeFirst ( Ethnologue x, Ethnologue y ) : int

Implements sorting by ethnologue code, then by language name, then by country name.

GetSearchResultSet ( string searchText ) : List

Get the requested data from the Ethnologue.

InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

StartFind ( ) : void

cboLookup_Enter ( object sender, System e ) : void

We want to have the focus initially in txtFindPattern. We do it here and then remove the event handler. We can't change the Tab order because then Shift-Tab goes to the Help button instead of "Search for" field (TE-753)

cboLookup_SelectedIndexChanged ( object sender, System e ) : void

lblOtherNamesList_Paint ( object sender, System e ) : void

lvFindResult_ColumnClick ( object sender, System.Windows.Forms.ColumnClickEventArgs e ) : void

lvFindResult_Enter ( object sender, System e ) : void

When we enter the list view we have to set the focused item to match the selected item.

txtCurrentLangName_TextChanged ( object sender, System e ) : void

txtFindPattern_Enter ( object sender, System e ) : void

txtFindPattern_KeyPress ( object sender, System e ) : void

txtFindPattern_Leave ( object sender, System e ) : void

txtFindPattern_TextChanged ( object sender, System e ) : void

Restarts the timer everytime the text box text changes.

Method Details

CheckDisposed() public method

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
public CheckDisposed ( ) : void
return void

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged /// resources; false to release only unmanaged resources. ///
return void

DoInitialSearch() protected method

Do the initial search requested if m_initialTarget has been set.
protected DoInitialSearch ( ) : void
return void

LanguageSetup() public method

Initializes a new instance of the LanguageSetup class.
public LanguageSetup ( ) : System
return System

LoadList() protected method

protected LoadList ( string searchText ) : void
searchText string
return void

LoadList() protected method

Fill the controls based on the current search, and (if requested) display an error message if not found.
protected LoadList ( string searchText, bool fShowErrorMessage ) : void
searchText string
fShowErrorMessage bool
return void

LoadOtherNames() protected method

protected LoadOtherNames ( ) : void
return void

OnHandleDestroyed() protected method

protected OnHandleDestroyed ( EventArgs e ) : void
e System.EventArgs
return void

OnLoad() protected method

Do the initial search when we bring up the control
protected OnLoad ( EventArgs e ) : void
e System.EventArgs
return void

PerformInitialSearch() public method

This is called just before ShowDialog. It sets up the target string as a language name and performs an initial search for this language as the dialog comes up.
public PerformInitialSearch ( string target ) : void
target string The target.
return void

SelectClosestMatch() protected method

Select the first exact match in the language column, or if none found, select the first item.
protected SelectClosestMatch ( ) : void
return void

SettingsForNoLanguage() protected method

Fix the settings for either a search failure or clicking on the "None of the above" item.
protected SettingsForNoLanguage ( ) : void
return void

btnFind_Click() protected method

When we get here, it means there was a long enough pause while typing in the search for text box that a search should be kicked off.
protected btnFind_Click ( object sender, System e ) : void
sender object
e System
return void

lvFindResult_SelectedIndexChanged() protected method

protected lvFindResult_SelectedIndexChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

Property Details

btnFind protected_oe property

protected Button,System.Windows.Forms btnFind
return System.Windows.Forms.Button

cboLookup protected_oe property

protected FwOverrideComboBox,SIL.FieldWorks.Common.Controls cboLookup
return SIL.FieldWorks.Common.Controls.FwOverrideComboBox

lblOtherNamesList protected_oe property

protected Label,System.Windows.Forms lblOtherNamesList
return System.Windows.Forms.Label

lvFindResult protected_oe property

protected ListView,System.Windows.Forms lvFindResult
return System.Windows.Forms.ListView

m_lastSearchText protected_oe property

protected string m_lastSearchText
return string

m_messageFilter protected_oe property

protected TrapEnterFilter m_messageFilter
return TrapEnterFilter

m_testing protected_oe property

Overriding testing instances of this class should set this so the DB connection doesn't get created.
protected bool m_testing
return bool

txtFindPattern protected_oe property

protected TextBox,System.Windows.Forms txtFindPattern
return System.Windows.Forms.TextBox