상속: System.EventArgs
예제 #1
0
        /// <summary>
        /// This helper automates locating a control by ID.
        ///
        /// It calls FindControl on the NamingContainer, then the Page.  If that fails,
        /// it fires the resolve event.
        /// </summary>
        /// <param name="id">The ID of the control to find</param>
        /// <param name="props">The TargetProperties class associated with that control</param>
        /// <returns></returns>
        protected Control FindControlHelper(string id)
        {
            Control c = null;

            if (_findControlHelperCache.ContainsKey(id))
            {
                c = _findControlHelperCache[id];
            }
            else
            {
                c = base.FindControl(id);  // Use "base." to avoid calling self in an infinite loop
                Control nc = NamingContainer;
                while ((null == c) && (null != nc))
                {
                    c  = nc.FindControl(id);
                    nc = nc.NamingContainer;
                }
                if (null == c)
                {
                    // Note: props MAY be null, but we're firing the event anyway to let the user
                    // do the best they can
                    ResolveControlEventArgs args = new ResolveControlEventArgs(id);

                    OnResolveControlID(args);
                    c = args.Control;
                }
                if (null != c)
                {
                    _findControlHelperCache[id] = c;
                }
            }
            return(c);
        }
예제 #2
0
 protected virtual void OnResolveControlID(ResolveControlEventArgs e)
 {
     if (ResolveControlID != null)
     {
         ResolveControlID(this, e);
     }
 }
예제 #3
0
        // Token: 0x06000063 RID: 99 RVA: 0x00002D34 File Offset: 0x00000F34
        protected Control FindControlHelper(string id)
        {
            Control control;

            if (this.findControlHelperCache.ContainsKey(id))
            {
                control = this.findControlHelperCache[id];
            }
            else
            {
                control = base.FindControl(id);
                Control namingContainer = this.NamingContainer;
                while (control == null && namingContainer != null)
                {
                    control         = namingContainer.FindControl(id);
                    namingContainer = namingContainer.NamingContainer;
                }
                if (control == null)
                {
                    ResolveControlEventArgs resolveControlEventArgs = new ResolveControlEventArgs(id);
                    this.OnResolveControlID(resolveControlEventArgs);
                    control = resolveControlEventArgs.Control;
                }
                if (control != null)
                {
                    this.findControlHelperCache[id] = control;
                }
            }
            return(control);
        }
예제 #4
0
        protected Control FindControlHelper(string id)
        {
            Control c = null;
            if (_findControlHelperCache.ContainsKey(id))
            {
                c = _findControlHelperCache[id];
            }
            else
            {
                c = base.FindControl(id); // Use "base." to avoid calling self in an infinite loop
                Control nc = NamingContainer;
                while ((null == c) && (null != nc))
                {
                    c = nc.FindControl(id);
                    nc = nc.NamingContainer;
                }
                if (null == c)
                {
                    // Note: props MAY be null, but we're firing the event anyway to let the user
                    // do the best they can
                    ResolveControlEventArgs args = new ResolveControlEventArgs(id);

                    OnResolveControlID(args);
                    c = args.Control;
                }
                if (null != c)
                {
                    _findControlHelperCache[id] = c;
                }
            }
            return c;
        }
예제 #5
0
 protected void cbe_ResolveControlID(object sender, AjaxControlToolkit.ResolveControlEventArgs e)
 {
     if (e.ControlID == "LoginViewButton")
     {
         e.Control = LoginView1.FindControl(e.ControlID);
         AddMessage("cbe_ResolveControlID", e.ControlID);
     }
 }
예제 #6
0
 protected void mpe_ResolveControlID(object sender, AjaxControlToolkit.ResolveControlEventArgs e)
 {
     // The Ajax stuff needs to be inside a different ContentPlaceHolder on the master page because otherwise the master page CSS breaks it.
     // The default Control Id resolution in ExtenderControlBase fails to find cmdDefer because it is contained inside a different ContentPlaceHolder
     // So they raise this event for me and I resolve it for them.
     switch (e.ControlID)
     {
     case "btnVote":
         e.Control = btnVote;
         break;
     }
 }
예제 #7
0
 protected virtual void OnResolveControlID(ResolveControlEventArgs e)
 {
     if (ResolveControlID != null)
     {
         ResolveControlID(this, e);
     }
 }