private static string GetLoadImg(Page Page, PreviewImageLoadingAnimation LoadingAnimation) { string loadingimg = "null"; switch (LoadingAnimation) { case PreviewImageLoadingAnimation.None: loadingimg = "false"; break; case PreviewImageLoadingAnimation.Gray: loadingimg = "\'" + Page.ClientScript.GetWebResourceUrl(typeof(PreviewImage), Configuration.Resources.PreviewGrayGif) + "\'"; break; case PreviewImageLoadingAnimation.BlackOnWhite: loadingimg = "\'" + Page.ClientScript.GetWebResourceUrl(typeof(PreviewImage), Configuration.Resources.PreviewBlackWhiteGif) + "\'"; break; case PreviewImageLoadingAnimation.WhiteOnBlack: loadingimg = "\'" + Page.ClientScript.GetWebResourceUrl(typeof(PreviewImage), Configuration.Resources.PreviewWhiteBlackGif) + "\'"; break; } return(loadingimg); }
/// <summary> /// Gets the statement (without javascript:) that can startup this control. /// </summary> public static string GetOnClickClientScript(Page page, string imageUrl, PreviewImageLoadingAnimation loadingAnimation, string description, int transparencyLevel, System.Drawing.Color transparencyColor) { return(GetOnClickClientScript(page, imageUrl, loadingAnimation, description, transparencyLevel, transparencyColor, false)); }
/// <summary> /// Gets the statement (without javascript:) that can startup this control. /// </summary> public static string GetOnClickClientScript(Page page, string imageUrl, PreviewImageLoadingAnimation loadingAnimation, string description, int transparencyLevel, System.Drawing.Color transparencyColor, bool hideObjects) { RegisterIncludes(page); return("PreviewImage_Open(null, \'" + page.ResolveClientUrl(imageUrl) + "\', " + GetDesc(description) + ", " + GetLoadImg(page, loadingAnimation) + ", " + GetClose(page) + ", " + (100 - transparencyLevel) + ", \'" + ColorTranslator.ToHtml(transparencyColor) + "\', " + hideObjects.ToString().ToLower() + ");"); }