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;
}
}