System.Windows.Forms.Menu.MenuItemCollection.ContainsKey C# (CSharp) Method

ContainsKey() public method

public ContainsKey ( string key ) : bool
key string
return bool
			public virtual bool ContainsKey (string key)
			{
				return !(this[key] == null);
			}

Usage Example

Example #1
0
        public void MenuItemCollection_ContainsKey_Invoke_ReturnsExpected(string key, bool expected)
        {
            var menu = new SubMenu(new MenuItem[] { new MenuItem {
                                                        Name = "name"
                                                    } });
            var collection = new Menu.MenuItemCollection(menu);

            Assert.Equal(expected, collection.ContainsKey(key));
        }