Exemple #1
0
 public ShareThis()
     : base()
 {
     DeploymentTarget = DeploymentEnvironment.Production;
     Include          = new ShareThisInclude();
     Inject           = true;
 }
Exemple #2
0
        public static string SerializeIncludeToUriString(ShareThisInclude include)
        {
            // todo: build urlserialize here
            var b = new StringBuilder();

            b.Append(string.Format("http://w.sharethis.com/button/sharethis.js#type={0}", Uri.EscapeDataString(include.Type)));
            if (!string.IsNullOrEmpty(include.Publisher))
            {
                b.Append("&publisher=" + Uri.EscapeDataString(include.Publisher));
            }
            if (!string.IsNullOrEmpty(include.ButtonText))
            {
                b.Append("&buttonText=" + Uri.EscapeDataString(include.ButtonText));
            }
            if (!string.IsNullOrEmpty(include.HeaderBackgroundColor))
            {
                b.Append("&headerbg=" + Uri.EscapeDataString(include.HeaderBackgroundColor));
            }
            if (!string.IsNullOrEmpty(include.HeaderForegroundColor))
            {
                b.Append("&headerfg=" + Uri.EscapeDataString(include.HeaderForegroundColor));
            }
            if (!string.IsNullOrEmpty(include.HeaderTitle))
            {
                b.Append("&headerTitle=" + Uri.EscapeDataString(include.HeaderTitle));
            }
            if (!string.IsNullOrEmpty(include.PostServices))
            {
                b.Append("&post_services=" + Uri.EscapeDataString(include.PostServices));
            }
            if (!string.IsNullOrEmpty(include.SendServices))
            {
                b.Append("&send_services=" + Uri.EscapeDataString(include.SendServices));
            }
            //foreach (var keyValue in _javascriptAttribs)
            //    b.Append("&" + keyValue.Key + "=" + Uri.EscapeDataString(keyValue.Value));
            b.Append("&button=false");
            return(b.ToString());
        }