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

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

14 Examples 7

1. Example

Project: gitter
Source File: GlobalBehavior.cs
View license
public static void SetupAutoCompleteSource(TextBox textBox, Repository repository, ReferenceType referenceTypes)
		{
			Verify.Argument.IsNotNull(textBox, "textBox");
			Verify.Argument.IsNotNull(repository, "repository");

			if(GlobalBehavior.AutoCompleteMode == AutoCompleteMode.None) return;

			var source = textBox.AutoCompleteCustomSource;

			if((referenceTypes & ReferenceType.LocalBranch) == ReferenceType.LocalBranch)
			{
				foreach(var branch in repository.Refs.Heads)
				{
					source.Add(branch.Name);
				}
			}
			if((referenceTypes & ReferenceType.RemoteBranch) == ReferenceType.RemoteBranch)
			{
				foreach(var branch in repository.Refs.Remotes)
				{
					source.Add(branch.Name);
				}
			}
			if((referenceTypes & ReferenceType.Tag) == ReferenceType.Tag)
			{
				foreach(var tag in repository.Refs.Tags)
				{
					source.Add(tag.Name);
				}
			}

			textBox.AutoCompleteMode = GlobalBehavior.AutoCompleteMode;
			textBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
		}

2. Example

Project: gitter
Source File: GlobalBehavior.cs
View license
public static void SetupAutoCompleteSource(TextBox textBox, IEnumerable<IRevisionPointer> revisions)
		{
			Verify.Argument.IsNotNull(textBox, "textBox");
			Verify.Argument.IsNotNull(revisions, "revisions");

			if(GlobalBehavior.AutoCompleteMode == AutoCompleteMode.None) return;

			var source = textBox.AutoCompleteCustomSource;

			foreach(var rev in revisions)
			{
				source.Add(rev.Pointer);
			}

			textBox.AutoCompleteMode = GlobalBehavior.AutoCompleteMode;
			textBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
		}

3. Example

Project: gitter
Source File: GlobalBehavior.cs
View license
public static void SetupAutoCompleteSource(ComboBox comboBox, Repository repository, ReferenceType referenceTypes)
		{
			Verify.Argument.IsNotNull(comboBox, "comboBox");
			Verify.Argument.IsNotNull(repository, "repository");

			if(GlobalBehavior.AutoCompleteMode == AutoCompleteMode.None) return;

			var source = comboBox.AutoCompleteCustomSource;

			if((referenceTypes & ReferenceType.LocalBranch) == ReferenceType.LocalBranch)
			{
				foreach(var branch in repository.Refs.Heads)
				{
					source.Add(branch.Name);
				}
			}
			if((referenceTypes & ReferenceType.RemoteBranch) == ReferenceType.RemoteBranch)
			{
				foreach(var branch in repository.Refs.Remotes)
				{
					source.Add(branch.Name);
				}
			}
			if((referenceTypes & ReferenceType.Tag) == ReferenceType.Tag)
			{
				foreach(var tag in repository.Refs.Tags)
				{
					source.Add(tag.Name);
				}
			}

			comboBox.AutoCompleteMode = GlobalBehavior.AutoCompleteMode;
			comboBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
		}

4. Example

Project: gitter
Source File: GlobalBehavior.cs
View license
public static void SetupAutoCompleteSource(ComboBox comboBox, IEnumerable<IRevisionPointer> revisions)
		{
			Verify.Argument.IsNotNull(comboBox, "comboBox");
			Verify.Argument.IsNotNull(revisions, "revisions");

			if(GlobalBehavior.AutoCompleteMode == AutoCompleteMode.None) return;

			var source = comboBox.AutoCompleteCustomSource;

			foreach(var rev in revisions)
			{
				source.Add(rev.Pointer);
			}

			comboBox.AutoCompleteMode = GlobalBehavior.AutoCompleteMode;
			comboBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
		}

5. Example

Project: TurtleHub
Source File: OptionsDialog.cs
View license
private async void TxtRepository_Enter(object sender, EventArgs e)
        {
            String owner = TxtOwner.Text;
            if (owner.Length == 0) return;

            try
            {
                var github = new GitHubClient(new ProductHeaderValue("TurtleHub"));
                var repos = await github.Repository.GetAllForUser(owner);

                var repo_list = new AutoCompleteStringCollection();
                foreach (var repo in repos)
                {
                    repo_list.Add(repo.Name);
                }

                TxtRepository.AutoCompleteCustomSource = repo_list;
            }
            catch
            {
                // Let this silently fail, the user just won't have an autocomplete list
                // This could be due to no network connection, invalid username, etc
            }
        }

6. Example

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

7. Example

Project: profit-calc
Source File: ProfitCalc.cs
View license
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);
                }
            }
        }

8. Example

Project: TraceSpy
Source File: Settings.cs
View license
public void AddSearch(string search)
        {
            if (string.IsNullOrEmpty(search))
                return;

            foreach (string s in _searches)
            {
                if (string.Compare(s, search, StringComparison.OrdinalIgnoreCase) == 0)
                    return;
            }

            _searches.Add(search);
        }

9. Example

View license
private void addServerButton_Click(object sender, EventArgs e)
        {
            var selectedIte/n ..... /n //View Source file for more details /n }

10. Example

Project: SceneNavi
Source File: ROMHandler.cs
View license
private void FindObjectTable()
        {
            Objects = new List<ObjectTableEntry>();
 /n ..... /n //View Source file for more details /n }

11. Example

Project: SceneNavi
Source File: ROMHandler.cs
View license
private void FindSceneTable()
        {
            Scenes = new List<ISceneTableEntry>();

  /n ..... /n //View Source file for more details /n }

12. Example

Project: xenadmin
Source File: Settings.cs
View license
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();
            }
        }

13. Example

View license
private void UpdateTreeView(Type[] types, AutoCompleteStringCollection autoCompleteStringCollection)/n ..... /n //View Source file for more details /n }

14. Example

Project: ATF
Source File: PropertyEditingControl.cs
View license
public void Bind(PropertyEditorControlContext context)
        {
            if (m_textBox.Focused)
/n ..... /n //View Source file for more details /n }