Пример #1
0
        private static bool Validate <ControlType>(Control parentCtrl, string childId, Predicate <ControlType> validateMethod)
            where ControlType : class, IWidgetWithValidProperty
        {
            IWebListRecordWidget listRecords = parentCtrl as IWebListRecordWidget;

            if (listRecords != null)
            {
                bool result = true;
                foreach (Control row in listRecords.Rows)
                {
                    ControlType child = (ControlType)(object)row.FindControl(childId);
                    if (child != null)
                    {
                        if (!validateMethod(child))
                        {
                            result = false;
                        }
                    }
                }
                return(result);
            }
            else
            {
                ControlType widget = (ControlType)(object)parentCtrl.FindControl(childId);
                return(validateMethod(widget));
            }
        }
 public ListRecordRtWidget(IWebListRecordWidget control) : base()
 {
     base.Control = control;
 }