Hidistro.UI.SaleSystem.zbCodeBehind/ControlHelper.cs

(完整代码) 1KB

namespace Hidistro.UI.SaleSystem.zbCodeBehind
{
    using System;
    using System.Runtime.CompilerServices;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public static class ControlHelper
    {
        public static void SetWhenIsNotNull(this Control control, string value)
        {
            if (control != null)
            {
                if (!(control is ITextControl))
                {
                    if (!(control is HtmlInputControl))
                    {
                        if (!(control is HyperLink))
                        {
                            throw new ApplicationException("未实现" + control.GetType().ToString() + "的SetWhenIsNotNull方法");
                        }
                        HyperLink link = (HyperLink) control;
                        link.NavigateUrl = value;
                    }
                    else
                    {
                        HtmlInputControl control3 = (HtmlInputControl) control;
                        control3.Value = value;
                    }
                }
                else
                {
                    ITextControl control2 = (ITextControl) control;
                    control2.Text = value;
                }
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。