예제 #1
0
        public IEnumerable <ScriptDescriptor> GetScriptDescriptors()
        {
            var control = new ClientControl();
            var res     = new List <ScriptDescriptor>();

            foreach (var extenderControl in _extenderControls)
            {
                if (extenderControl.Third != null && (!extenderControl.Third.Visible || IsExcluded(extenderControl.Third)))
                {
                    continue;
                }

                if (extenderControl.Second == null)
                {
                    /*if (!string.IsNullOrEmpty(extenderControl.First.TargetControlID))
                     * {
                     *  var enumerable = ((IExtenderControl)extenderControl.First).GetScriptDescriptors(control);
                     *  if (enumerable != null) res.AddRange(enumerable);
                     *  continue;
                     * }*/
                    var clientArgs = new ClientArgs();
                    OnRetriveClientID(clientArgs);
                    extenderControl.Second = clientArgs.ClientIDs;
                }
                var id = extenderControl.First.ID;
                extenderControl.First.Page = Page;
                extenderControl.First.SetTargetControl(this);
                foreach (var clientID in extenderControl.Second)
                {
                    control.SetClientID(clientID);
                    extenderControl.First.ID = id + clientID;
                    var enumerable = ((IExtenderControl)extenderControl.First).GetScriptDescriptors(control);
                    if (enumerable != null)
                    {
                        res.AddRange(enumerable);
                    }
                }
            }
            return(res);
        }