System.Collections.Hashtable.Contains C# (CSharp) Method

Contains() public method

public Contains ( Object key ) : bool
key Object
return bool
        public virtual bool Contains(Object key)
        {
            return ContainsKey(key);
        }

Usage Example

Example #1
0
 protected override void CreateChildControls()
 {
     Hashtable hs = new Hashtable();
     int result = LoginEntity.LoadConfiguration(SPContext.Current.Web.CurrentUser.LoginName, ref hs);
     if (result == 1)
     {
         PlayerUserControl control = (PlayerUserControl)Page.LoadControl(_ascxPath);
         if (hs != null)
         {
             if (hs.Contains("APIKey"))
                 control.APIKey = hs["APIKey"].ToString();
             if (hs.Contains("SecretKey"))
                 control.SecretKey = hs["SecretKey"].ToString();
         }
         Controls.Add(control);
     }
     else
     {
         string _ascxPathAPI = @"~/_CONTROLTEMPLATES/OoyalaPlugin.WP_API_Settings/APISettings/APISettingsUserControl.ascx";
         APISettingsUserControl control = (APISettingsUserControl)Page.LoadControl(_ascxPathAPI);
         if (hs != null)
         {
             if (hs.Contains("APIKey"))
                 control.APIKey = hs["APIKey"].ToString();
             if (hs.Contains("SecretKey"))
                 control.SecretKey = hs["SecretKey"].ToString();
             if (hs.Contains("PartnerCode"))
                 control.PartnerCode = hs["PartnerCode"].ToString();
         }
         control.APIErrorMessage = "API Settings are not configured properly";
         Controls.Add(control);
         return;
     }
 }
All Usage Examples Of System.Collections.Hashtable::Contains