Exemplo n.º 1
0
 /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Method[@name="OnInit"]/*'/>
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (null != CloneFrom && string.Empty != CloneFrom.Trim())
     {
         AspNetPager ctrl = Parent.FindControl(CloneFrom) as AspNetPager;
         if (null == ctrl)
         {
             string errStr = SR.GetString("def_CloneFromTypeError");
             throw new ArgumentException(errStr.Replace("%controlID%", CloneFrom), "CloneFrom");
         }
         if (null != ctrl.cloneFrom && this == ctrl.cloneFrom)
         {
             string errStr = SR.GetString("def_RecursiveCloneFrom");
             throw new ArgumentException(errStr, "CloneFrom");
         }
         cloneFrom       = ctrl;
         CssClass        = cloneFrom.CssClass;
         Width           = cloneFrom.Width;
         Height          = cloneFrom.Height;
         HorizontalAlign = cloneFrom.HorizontalAlign;
         BackColor       = cloneFrom.BackColor;
         BackImageUrl    = cloneFrom.BackImageUrl;
         BorderColor     = cloneFrom.BorderColor;
         BorderStyle     = cloneFrom.BorderStyle;
         BorderWidth     = cloneFrom.BorderWidth;
         Font.CopyFrom(cloneFrom.Font);
         ForeColor       = cloneFrom.ForeColor;
         EnableViewState = cloneFrom.EnableViewState;
         Enabled         = cloneFrom.Enabled;
     }
 }
Exemplo n.º 2
0
 /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Method[@name="OnInit"]/*'/>
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (null != CloneFrom && string.Empty != CloneFrom.Trim())
     {
         AspNetPager ctrl = Parent.FindControl(CloneFrom) as AspNetPager;
         if (null == ctrl)
         {
             string errStr = SR.GetString("clonefromexeption") ??
                             "The control \" %controlID% \" does not exist or is not of type Wuqi.Webdiyer.AspNetPager!";
             throw new ArgumentException(errStr.Replace("%controlID%", CloneFrom), "CloneFrom");
         }
         if (null != ctrl.cloneFrom && this == ctrl.cloneFrom)
         {
             string errStr = SR.GetString("recusiveclonefrom") ??
                             "Invalid value for the CloneFrom property, AspNetPager controls can not to be cloned recursively!";
             throw new ArgumentException(errStr, "CloneFrom");
         }
         cloneFrom       = ctrl;
         CssClass        = cloneFrom.CssClass;
         Width           = cloneFrom.Width;
         Height          = cloneFrom.Height;
         HorizontalAlign = cloneFrom.HorizontalAlign;
         BackColor       = cloneFrom.BackColor;
         BackImageUrl    = cloneFrom.BackImageUrl;
         BorderColor     = cloneFrom.BorderColor;
         BorderStyle     = cloneFrom.BorderStyle;
         BorderWidth     = cloneFrom.BorderWidth;
         Font.CopyFrom(cloneFrom.Font);
         ForeColor       = cloneFrom.ForeColor;
         EnableViewState = cloneFrom.EnableViewState;
         Enabled         = cloneFrom.Enabled;
     }
 }