HeaderPane
Main
Hide
Share Link
Print

Seed Method, AutoCompleteClass Class

Adds entries to the file defined by the AutoCompleteClass.File property, keeping the entries already there.

Class: AutoCompleteClass
Namespace: Softelvdm.SftMaskNET
Assembly: Softelvdm.SftMaskNET

Syntax

public void Seed( IEnumerable<string> entries );
Public Sub Seed( ByVal entries As IEnumerable(Of String) )

Parameters

entries

The entries.

Comments

Adds entries to the file defined by the AutoCompleteClass.File property, keeping the entries already there.

Without a file (AutoCompleteClass.File property), the method throws an InvalidOperationException. Entries already in the file keep their place; beyond the maximum number of entries (AutoCompleteClass.MaxEntries property), the oldest entries are dropped.

Examples

C# View entire sample code

            sftMaskIP.Text = "192168001001";
            // Numbers are set as values, so they do not depend on the culture's separators.
            sftMaskAmount.Value = 1234.5m;
            sftMaskPercent.Value = 25;
            sftMaskQuantity.Value = 10;
            sftMaskColor.Value = 0x2E8B57;

            // The city field suggests earlier entries, starting with a few cities.
            sftMaskCity.AutoComplete.Seed(new string[] { "Orlando", "Ocala", "Ocoee", "Oviedo", "Orange City", "Miami", "Tampa", "Tallahassee" });

            foreach (SftMask field in fields) {
                field.Enter += Field_Enter;
                field.TextChanged += Field_TextChanged;
            }

            foreach (string name in new string[] { "en-US", "de-DE", "fr-FR", "hi-IN", "ja-JP" })

VB.NET View entire sample code

        SftMaskIP.Text = "192168001001"
        ' Numbers are set as values, so they do not depend on the culture's separators.
        SftMaskAmount.Value = 1234.5D
        SftMaskPercent.Value = 25
        SftMaskQuantity.Value = 10
        SftMaskColor.Value = &H2E8B57

        ' The city field suggests earlier entries, starting with a few cities.
        SftMaskCity.AutoComplete.Seed(New String() {"Orlando", "Ocala", "Ocoee", "Oviedo", "Orange City", "Miami", "Tampa", "Tallahassee"})

        For Each field As SftMask In fields
            AddHandler field.Enter, AddressOf Field_Enter
            AddHandler field.TextChanged, AddressOf Field_TextChanged
        Next

        For Each name As String In New String() {"en-US", "de-DE", "fr-FR", "hi-IN", "ja-JP"}

See Also AutoCompleteClass Class | Classes | SftMask/NET 3.0