System.Web.UI.WebControls.Calendar.BuildLink C# (CSharp) Méthode

BuildLink() private méthode

private BuildLink ( string arg, string text, Color foreColor, bool hasLink ) : string
arg string
text string
foreColor Color
hasLink bool
Résultat string
		string BuildLink (string arg, string text, Color foreColor, bool hasLink)
		{
			StringBuilder str = new StringBuilder ();
			Color clr;
			hasLink = (Page != null && hasLink == true) ? true : false;

			if (hasLink) {
				str.Append ("<a href=\"");
#if NET_2_0
				str.Append (Page.ClientScript.GetPostBackClientHyperlink (this, arg, true));
#else
				str.Append (Page.ClientScript.GetPostBackClientHyperlink (this, arg));
#endif			
				str.Append ('\"');
			

				if (!foreColor.IsEmpty) {
					clr = foreColor;
				} else {
					if (ForeColor.IsEmpty)
						clr = Color.Black;
					else
						clr = ForeColor;
				}

				str.Append (" style=\"color:" + ColorTranslator.ToHtml (clr));
				str.Append ("\">");
				str.Append (text);
				str.Append ("</a>");
			}
			else 
				str.Append (text);

			return str.ToString ();
		}