System.Windows.Forms.AutoCompleteStringCollection.Contains(string)

Here are the examples of the csharp api class System.Windows.Forms.AutoCompleteStringCollection.Contains(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

9 Examples 7

1. Example

Project: 32feet
Source File: FormConsole.cs
void AddKnownAddress(InTheHand.Net.BluetoothAddress value)
        {
            var text = value.ToString("C");
            if (!_knownAddresses.Contains(text)) {
                _knownAddresses.Add(text);
            }
        }

2. Example

Project: profit-calc
Source File: ProfitCalc.cs
private void UpdateHistoricAlgo(IEnumerable<CustomAlgo> customAlgoList)
        {
            if (_historicAlgoList == null)
            {
                _historicAlgoList = new AutoCompleteStringCollection();
            }

            foreach (CustomAlgo customAlgo in customAlgoList)
            {
                if (!_historicAlgoList.Contains(customAlgo.Name))
                {
                    _historicAlgoList.Add(customAlgo.Name);
                }
            }
        }

3. Example

Project: FindUnusedFiles
Source File: FormMain.cs
void UpateAutoCompleteSource(TextBox textbox, string setting)
        {
            if (IsRegexPatternValid(textbox.Text))
            {
                if (!textbox.AutoCompleteCustomSource.Contains(textbox.Text))
                {
                    var settings          = Properties.Settings.Default;
                    var patternCollection = ((StringCollection) settings[setting]);

                    // add to top of list
                    patternCollection.Insert(0, textbox.Text);
                    settings.Save();

                    // refresh autocomplete list
                    SetAutoCompleteSource(textbox, setting);
                }
            }
        }

4. Example

Project: FindUnusedFiles
Source File: FormMain.cs
void UpateAutoCompleteSource(TextBox textbox, string setting)
        {
            if (IsRegexPatternValid(textbox.Text))
            {
                if (!textbox.AutoCompleteCustomSource.Contains(textbox.Text))
                {
                    var settings          = Properties.Settings.Default;
                    var patternCollection = ((StringCollection) settings[setting]);

                    // add to top of list
                    patternCollection.Insert(0, textbox.Text);
                    settings.Save();

                    // refresh autocomplete list
                    SetAutoCompleteSource(textbox, setting);
                }
            }
        }

5. Example

Project: libpalaso
Source File: ContributorsListControlViewModelTests.cs
[Test]
		public void GetAutoCompleteNames_HasGatherer_ReturnsNames()
		{
			var gatherer = new Mock<IAutoCompleteValueProvider>();
			gatherer.Setup(g => g.GetValuesForKey("person")).Returns(new[] { "jimmy", "tommy" });
			_model = new ContributorsListControlViewModel(gatherer.Object, null);

			var names = _model.GetAutoCompleteNames();
			Assert.AreEqual(2, names.Count);
			Assert.IsTrue(names.Contains("jimmy"));
			Assert.IsTrue(names.Contains("tommy"));
		}

6. Example

Project: xenadmin
Source File: Settings.cs
public static void UpdateServerHistory(string hostnameWithPort)
        {
            AutoCompleteStringCollection history = GetServerHistory();
            if (!history.Contains(hostnameWithPort))
            {
                while (history.Count >= 20)
                    history.RemoveAt(0);
                history.Add(hostnameWithPort);
                Properties.Settings.Default.ServerHistory = history;
                TrySaveSettings();
            }
        }

7. Example

Project: FindUnusedFiles
Source File: FormMain.cs
void RemoveFromAutoCompleteSource(TextBox textbox, string setting)
        {
            if (IsRegexPatternValid(textbox.Text))
            {
                if (textbox.AutoCompleteCustomSource.Contains(textbox.Text))
                {
                    var settings          = Properties.Settings.Default;
                    var patternCollection = (StringCollection)settings[setting];

                    // add to top of list
                    patternCollection.Remove(textbox.Text);
                    textbox.AutoCompleteCustomSource.Remove(textbox.Text);
                    settings.Save();

                    textbox.Text = patternCollection.Cast<string>().FirstOrDefault();
                }
            }
        }

8. Example

Project: FindUnusedFiles
Source File: FormMain.cs
void RemoveFromAutoCompleteSource(TextBox textbox, string setting)
        {
            if (IsRegexPatternValid(textbox.Text))
            {
                if (textbox.AutoCompleteCustomSource.Contains(textbox.Text))
                {
                    var settings          = Properties.Settings.Default;
                    var patternCollection = (StringCollection)settings[setting];

                    // add to top of list
                    patternCollection.Remove(textbox.Text);
                    textbox.AutoCompleteCustomSource.Remove(textbox.Text);
                    settings.Save();

                    textbox.Text = patternCollection.Cast<string>().FirstOrDefault();
                }
            }
        }

9. Example

Project: referencesource
Source File: TypeBrowserDialog.cs
private void UpdateTreeView(Type[] types, AutoCompleteStringCollection autoCompleteStringCollection)/n ..... /n //View Source file for more details /n }