using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CMS.PortalControls;
using CMS.GlobalHelper;
using CMS.CMSHelper;
using CMS.SettingsProvider;
using CMS.MembershipProvider;
public partial class CMSWebParts_CommunityServices_LinkedIn_LinkedInCompanyInsider: CMSAbstractWebPart
{
#region "Public properties"
///
/// Company ID.
///
public string CompanyID
{
get
{
return ValidationHelper.GetString(GetValue("CompanyID"), string.Empty);
}
set
{
SetValue("CompanyID", value);
}
}
///
/// Width of the web part in pixels.
///
public int Width
{
get
{
return ValidationHelper.GetInteger(GetValue("Width"), 110);
}
set
{
SetValue("Width", value);
}
}
///
/// Defines whether to show user's network.
///
public bool ShowNetwork
{
get
{
return ValidationHelper.GetBoolean(GetValue("ShowNetwork"), false);
}
set
{
SetValue("ShowNetwork", value);
}
}
///
/// Defines whether to show new hires.
///
public bool ShowNewHires
{
get
{
return ValidationHelper.GetBoolean(GetValue("ShowNewHires"), false);
}
set
{
SetValue("ShowNewHires", value);
}
}
///
/// Defines whether to show promotions and changes.
///
public bool ShowPromotions
{
get
{
return ValidationHelper.GetBoolean(GetValue("ShowPromotions"), false);
}
set
{
SetValue("ShowPromotions", value);
}
}
#endregion
#region "Methods"
///
/// Content loaded event handler.
///
public override void OnContentLoaded()
{
base.OnContentLoaded();
SetupControl();
}
///
/// Initializes the control properties.
///
protected void SetupControl()
{
if (StopProcessing)
{
// Do not process
}
else
{
// Initialize variables
string src = "http://platform.linkedin.com/in.js";
string dataModules = String.Empty;
string apiKey = LinkedInHelper.GetLinkedInApiKey(CMSContext.CurrentSiteName);
//Check optional parameters
if (ShowNetwork)
{
dataModules += ",innetwork";
}
if (ShowNewHires)
{
dataModules += ",newhires";
}
if (ShowPromotions)
{
dataModules += ",jobchanges";
}
// Build plugin code
string output = "
";
ltlPluginCode.Text = String.Format(output, Width.ToString(), src, CompanyID, dataModules.TrimStart(','), apiKey);
}
}
///
/// Reloads the control data.
///
public override void ReloadData()
{
base.ReloadData();
SetupControl();
}
#endregion
}