Nini.Config.AliasText.GetBoolean C# (CSharp) Method

GetBoolean() public method

public GetBoolean ( string key ) : bool
key string
return bool
        public bool GetBoolean(string key)
        {
            if (!booleanAlias.Contains (key)) {
                throw new ArgumentException ("Alias does not exist for text");
            }

            return (bool)booleanAlias[key];
        }

Usage Example

        public void GetDefaultAliases()
        {
            AliasText alias = new AliasText ();

            Assert.IsTrue (alias.ContainsBoolean ("true"));
            Assert.IsTrue (alias.ContainsBoolean ("false"));

            Assert.IsTrue (alias.GetBoolean ("tRUe"));
            Assert.IsFalse (alias.GetBoolean ("FaLse"));
        }
All Usage Examples Of Nini.Config.AliasText::GetBoolean