using System; using System.Data; using System.Collections; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CMS.PortalControls; using CMS.GlobalHelper; using CMS.CMSHelper; public partial class CMSWebParts_CommunityServices_Pinterest_PinterestFollowButton : CMSAbstractWebPart { #region "Properties" /// /// Username. /// public string Username { get { return ValidationHelper.GetString(GetValue("Username"), string.Empty); } set { SetValue("Username", value); } } /// /// Display type. /// public string DisplayType { get { return ValidationHelper.GetString(GetValue("DisplayType"), string.Empty); } set { SetValue("DisplayType", value); } } #endregion #region "Methods" /// /// Content loaded event handler /// public override void OnContentLoaded() { base.OnContentLoaded(); SetupControl(); } /// /// Initializes the control properties /// protected void SetupControl() { if (this.StopProcessing) { // Do not process } else { // Build plugin code string src = "http://pinterest.com/" + Username; // Output HTML code string output = "\"Follow"; ltlPluginCode.Text = String.Format(output, src, DisplayType); } } /// /// Reloads the control data /// public override void ReloadData() { base.ReloadData(); SetupControl(); } #endregion }