public IEnumerable <ScriptDescriptor> GetScriptDescriptors()
        {
            ScriptControlDescriptor descriptor =
                new ScriptControlDescriptor("JobRepo.UserNameTextbox", this.ClientID);

            descriptor.AddProperty("minLen", minLen);

            descriptor.AddEvent("validating", validating);
            descriptor.AddEvent("validated", validated);

            return(new ScriptDescriptor[] { descriptor });
        }
Пример #2
0
 public static void AddEvent(ScriptControlDescriptor descriptor, string eventName, string eventValue)
 {
     if (!string.IsNullOrEmpty(eventValue))
     {
         descriptor.AddEvent(eventName, eventValue);
     }
 }
Пример #3
0
        protected override IEnumerable <ScriptDescriptor> GetScriptDescriptors()
        {
            ScriptControlDescriptor descriptor = new ScriptControlDescriptor(this.GetType().FullName, this.ClientID);

            // Add all the ScriptControls Client-Side Object Properties
            //// help -> reference the ScriptObjectBuilder object in the AjaxControlToolkit
            PropertyDescriptorCollection props = TypeDescriptor.GetProperties(this);

            foreach (PropertyDescriptor prop in props)
            {
                ScriptControlPropertyAttribute propAttr = prop.Attributes[typeof(ScriptControlPropertyAttribute)] as ScriptControlPropertyAttribute;
                if (propAttr != null)
                {
                    object value = prop.GetValue(this);
                    string name  = (propAttr.Name != null) ? propAttr.Name : prop.Name;
                    if (value != null)
                    {
                        descriptor.AddProperty(name, value);
                    }
                }

                ScriptControlEventAttribute eventAttr = prop.Attributes[typeof(ScriptControlEventAttribute)] as ScriptControlEventAttribute;
                if (eventAttr != null)
                {
                    string name    = eventAttr.Name ?? prop.Name;
                    string handler = prop.GetValue(this) as string;
                    if (handler != null)
                    {
                        descriptor.AddEvent(name, handler);
                    }
                }
            }

            yield return(descriptor);
        }
Пример #4
0
        ///// <summary>
        ///// Before rendering data.
        ///// </summary>
        ///// <param name="e"></param>
        //protected override void OnPreRender(EventArgs e)
        //{
        //    // If not in design mode
        //    if (!this.DesignMode)
        //    {
        //        // Get the script manager for the current page.
        //        _scriptManager = ScriptManager.GetCurrent(Page);

        //        // If no script manager has been add to the
        //        // current page the thrown an execption.
        //        if (_scriptManager == null)
        //            throw new HttpException("A ScriptManager control is required in the page.");

        //        // Register the extender with the scipt manager.
        //        System.Web.UI.Control targetControl = Page.FindControl(_targetControlID);

        //        if (targetControl != null)
        //            _scriptManager.RegisterExtenderControl(this, targetControl);
        //        else
        //          _scriptManager.RegisterExtenderControl(this, _targetControl);
        //    }

        //    base.OnPreRender(e);
        //}

        ///// <summary>
        ///// When the control starts to render data.
        ///// </summary>
        ///// <param name="writer">Write the html text.</param>
        //protected override void Render(HtmlTextWriter writer)
        //{
        //    // If not in design mode
        //    if (!this.DesignMode)
        //    {
        //        // Register the script descriptors for this control.
        //        _scriptManager.RegisterScriptDescriptors(this);
        //    }
        //    base.Render(writer);
        //}
        #endregion

        #region Protected Script Methods
        /// <summary>
        /// Get the collection of script descriptors.
        /// </summary>
        /// <param name="targetControl">The ID of the control that the extender is associated with.</param>
        /// <returns>The collection of script descriptors</returns>
        protected override IEnumerable <ScriptDescriptor> GetScriptDescriptors(System.Web.UI.Control targetControl)
        {
            ScriptControlDescriptor descriptor = new ScriptControlDescriptor("Nequeo.Web.UI.ScriptControl.CalendarBehavior", targetControl.ClientID);

            descriptor.AddProperty("cssClass", this.CssClass);
            descriptor.AddProperty("format", this.Format);
            descriptor.AddProperty("enabled", this.EnabledOnClient);
            descriptor.AddProperty("animated", this.Animated);
            descriptor.AddProperty("firstDayOfWeek", this.FirstDayOfWeek);
            descriptor.AddProperty("targetControlID", this.TargetControlID);
            descriptor.AddProperty("selectedDate", this.SelectedDate);
            descriptor.AddProperty("popupPosition", this.PopupPosition);

            // Add the "PopupButtonID" control reference.
            if (!String.IsNullOrEmpty(_popupButtonID))
            {
                System.Web.UI.Control control = Page.FindControl(this.PopupButtonID);
                if (control != null)
                {
                    descriptor.AddElementProperty("button", (string)control.ClientID);
                }
            }

            // Add the "OnClientDateSelectionChanged" event handler.
            if (!String.IsNullOrEmpty(_onClientDateSelectionChanged))
            {
                descriptor.AddEvent("dateSelectionChanged", this.OnClientDateSelectionChanged);
            }

            // Add the descripter to the collection.
            ScriptDescriptor[] descriptors = new ScriptDescriptor[] { descriptor };

            // Return the collection of descriptors.
            return(descriptors);
        }
Пример #5
0
        public IEnumerable <ScriptDescriptor> GetScriptDescriptors()
        {
            ScriptControlDescriptor desc = new ScriptControlDescriptor(GetType().FullName, ClientID);

            desc.AddProperty("clientStateFieldID", ClientID + "SelectedRowIndices");
            desc.AddProperty("selectedKeysStateFieldID", ClientID + "SelectedRowDataKeys");
            desc.AddProperty("SelectionMode", SelectionMode.ToString());

            string style = StyleToString(SelectedRowStyle);

            desc.AddProperty("SelectedRowStyle", style);
            desc.AddProperty("SelectedRowCSS", SelectedRowStyle.CssClass);

            style = StyleToString(RowStyle);
            desc.AddProperty("UnSelectedRowStyle", style);
            desc.AddProperty("UnSelectedRowCSS", RowStyle.CssClass);

            desc.AddProperty("SelectUsingDataKeys", SelectUsingDataKeys);


            if (AlternatingRowStyle != null)
            {
                style = StyleToString(AlternatingRowStyle);
                desc.AddProperty("AlternatingRowStyle", style);
                desc.AddProperty("AlternatingRowCSS", AlternatingRowStyle.CssClass);
            }
            else
            {
                // use the normal row style
                style = StyleToString(RowStyle);
                desc.AddProperty("UnSelectedRowStyle", style);
                desc.AddProperty("UnSelectedRowCSS", RowStyle.CssClass);
            }

            if (OnClientRowClick != null)
            {
                desc.AddEvent("onClientRowClick", OnClientRowClick);
            }

            if (OnClientRowDblClick != null)
            {
                desc.AddEvent("onClientRowDblClick", OnClientRowDblClick);
            }

            return(new ScriptDescriptor[] { desc });
        }
Пример #6
0
        GetScriptDescriptors()
        {
            ScriptControlDescriptor descriptor = new ScriptControlDescriptor("ControlsAjaxNotti.ClientControlGrid", this.ClientID);



            descriptor.AddProperty("allowGroupRows", this.AllowGroupRows);
            descriptor.AddProperty("tblBase", this.TblBase);
            descriptor.AddProperty("dataSource", this.DatosTabla);
            descriptor.AddProperty("columns", this.Columns);
            descriptor.AddProperty("functionColumns", this.FunctionsColumns);
            descriptor.AddProperty("functionsGral", this.FunctionsGral);
            descriptor.AddProperty("allowMultiSelection", this.AllowMultiSelection);
            descriptor.AddProperty("keyName", this.KeyName);
            descriptor.AddProperty("allowPaging", this.AllowPaging);
            descriptor.AddProperty("pageSize", this.PageSize);
            descriptor.AddProperty("callbackID", this.CallbackID);
            descriptor.AddProperty("virtualCount", this.VirtualCount);
            descriptor.AddProperty("allowRowSelection", this.AllowRowSelection);
            descriptor.AddProperty("refDeleteImg", Page.ClientScript.GetWebResourceUrl(this.GetType(), "ControlsAjaxNotti.ImagenesGrid.Delete.gif"));
            descriptor.AddProperty("refAddImg", Page.ClientScript.GetWebResourceUrl(this.GetType(), "ControlsAjaxNotti.ImagenesGrid.Add.gif"));
            descriptor.AddProperty("refEditImg", Page.ClientScript.GetWebResourceUrl(this.GetType(), "ControlsAjaxNotti.ImagenesGrid.Edit.gif"));
            descriptor.AddProperty("refExcelImg", Page.ClientScript.GetWebResourceUrl(this.GetType(), "ControlsAjaxNotti.ImagenesGrid.Excel.gif"));
            descriptor.AddProperty("refImgPageSelected", Page.ClientScript.GetWebResourceUrl(this.GetType(), "ControlsAjaxNotti.ImagenesGrid." + _btnSelectedPage + ".jpg"));
            descriptor.AddProperty("refWaitingImg", Page.ClientScript.GetWebResourceUrl(this.GetType(), "ControlsAjaxNotti.ImagenesGrid.WaitingGrid.gif"));
            descriptor.AddProperty("refExclamacionImg", Page.ClientScript.GetWebResourceUrl(this.GetType(), "ControlsAjaxNotti.ImagenesGrid.Exclamacion.png"));
            descriptor.AddProperty("emptyMessage", EmptyMessage);
            descriptor.AddProperty("showDataOnInit", ShowDataOnInit);
            descriptor.AddProperty("onClientFunctionRowClicked", OnClientFunctionRowClicked);


            descriptor.AddProperty("uniqueID", _ControlID);
            descriptor.AddProperty("columnasVisibles", this.ColumnasVisibles);

            //if (!string.IsNullOrEmpty(onClientFunctionRowClicked))
            //{
            //    descriptor.AddEvent("rowClicked", onClientFunctionRowClicked);
            //}


            //if (!string.IsNullOrEmpty(onClientFunctionRowClicking))
            //{
            //    descriptor.AddEvent("rowClicking", onClientFunctionRowClicking);
            //}

            if (!string.IsNullOrEmpty(onClientChangePageIndex))
            {
                descriptor.AddEvent("ChangePageIndex", onClientChangePageIndex);
            }


            yield return(descriptor);
        }
Пример #7
0
        protected override IEnumerable <ScriptDescriptor> GetScriptDescriptors(Control targetControl)
        {
            ScriptControlDescriptor descriptor = new ScriptControlDescriptor("Ajaxified.TimePicker", targetControl.ClientID);

            descriptor.AddProperty("CssClass", CssClass);
            descriptor.AddProperty("HeaderCssClass", HeaderCssClass);
            descriptor.AddProperty("TitleCssClass", TitleCssClass);
            descriptor.AddProperty("TabCssClass", TabCssClass);
            descriptor.AddProperty("SelectedTabCssClass", SelectedTabCssClass);
            descriptor.AddProperty("ItemCssClass", ItemCssClass);
            descriptor.AddProperty("SelectedItemCssClass", SelectedItemCssClass);
            descriptor.AddProperty("CloseOnSelection", CloseOnSelection);
            descriptor.AddProperty("MinuteStep", MinuteStep);

            if (OnClientShowing != string.Empty)
            {
                descriptor.AddEvent("showing", OnClientShowing);
            }
            if (OnClientShown != string.Empty)
            {
                descriptor.AddEvent("shown", OnClientShown);
            }
            if (OnClientHiding != string.Empty)
            {
                descriptor.AddEvent("hiding", OnClientHiding);
            }
            if (OnClientHidden != string.Empty)
            {
                descriptor.AddEvent("hidden", OnClientHidden);
            }
            if (OnClientSelectionChanged != string.Empty)
            {
                descriptor.AddEvent("selectionChanged", OnClientSelectionChanged);
            }

            yield return(descriptor);
        }
Пример #8
0
        GetScriptDescriptors()
        {
            ScriptControlDescriptor descriptor = new ScriptControlDescriptor("ControlsAjaxNotti.ClientControlWindow", this.ClientID);


            descriptor.AddProperty("refWaitingImg", Page.ClientScript.GetWebResourceUrl(this.GetType(), "ControlsAjaxNotti.ImagenesWindow.waiting.gif"));


            if (!string.IsNullOrEmpty(onClientCanceled))
            {
                descriptor.AddEvent("Cancel", onClientCanceled);
            }

            yield return(descriptor);
        }
Пример #9
0
        public IEnumerable <ScriptDescriptor> GetScriptDescriptors()
        {
            ScriptControlDescriptor descriptor = new ScriptControlDescriptor("CSASPNETAjaxScriptControl.DropPanel", this.ClientID);

            descriptor.AddProperty("cssClass", CssClass);
            descriptor.AddProperty("headerCssClass", HeaderCssClass);
            descriptor.AddProperty("contentCssClass", ContentCssClass);
            descriptor.AddProperty("closeImageCssClass", CloseImageCssClass);
            descriptor.AddProperty("fromContextKey", FromContextKey);
            descriptor.AddProperty("toContextKey", ToContextKey);
            descriptor.AddElementProperty("headerContainer", HeaderContainer.ClientID);
            descriptor.AddElementProperty("titleContainer", TitleContainer.ClientID);
            descriptor.AddElementProperty("closeImage", CloseImage.ClientID);
            descriptor.AddElementProperty("contentContainer", ContentContainer.ClientID);
            if (OnClosed != string.Empty)
            {
                descriptor.AddEvent("closed", OnClosed);
            }
            yield return(descriptor);
        }
Пример #10
0
        //Generate descriptor to render the related $create script function that will create behavior on client.
        protected override IEnumerable <ScriptDescriptor> GetScriptDescriptors(Control targetControl)
        {
            ScriptControlDescriptor descriptor = new ScriptControlDescriptor("CSASPNETAjaxExtender.TimePicker", targetControl.ClientID);

            //Register ErrorPresentControl element to client
            if (ErrorPresentControlID != string.Empty)
            {
                descriptor.AddElementProperty("errorSpan", this.NamingContainer.FindControl(ErrorPresentControlID).ClientID);
            }

            //Register property
            descriptor.AddProperty("cssClass", CssClass);
            descriptor.AddProperty("timeType", TimeType);

            //Register client event
            if (OnClientShowing != string.Empty)
            {
                descriptor.AddEvent("showing", OnClientShowing);
            }
            if (OnClientShown != string.Empty)
            {
                descriptor.AddEvent("shown", OnClientShown);
            }
            if (OnClientHiding != string.Empty)
            {
                descriptor.AddEvent("hiding", OnClientHiding);
            }
            if (OnClientHidden != string.Empty)
            {
                descriptor.AddEvent("hidden", OnClientHidden);
            }
            if (OnClientHourSelectionChanged != string.Empty)
            {
                descriptor.AddEvent("hourSelectionChanged", OnClientHourSelectionChanged);
            }
            if (OnClientMinuteSelectionChanged != string.Empty)
            {
                descriptor.AddEvent("minuteSelectionChanged", OnClientMinuteSelectionChanged);
            }

            yield return(descriptor);
        }
Пример #11
0
        GetScriptDescriptors()
        {
            ScriptControlDescriptor descriptor = new ScriptControlDescriptor("Wybecom.TalkPortal.CTI.Controls.CTIClient", this.ClientID);

            descriptor.AddProperty("displayInput", this.displayInput);
            descriptor.AddProperty("displayCopyright", this.displayCopyright);
            descriptor.AddProperty("displayPhoneControl", this.displayPhoneControl);
            descriptor.AddProperty("displayStatus", this.displayStatus);
            descriptor.AddProperty("ctiService", this.ctiService);
            descriptor.AddProperty("stateService", this.stateService);
            descriptor.AddProperty("callLogsService", this.callLogsService);
            descriptor.AddProperty("speedDialService", this.speedDialService);
            if (!String.IsNullOrEmpty(this.OnCallInitialized))
            {
                descriptor.AddEvent("callInitialized", this.OnCallInitialized);
            }
            if (!String.IsNullOrEmpty(this.OnCallReceived))
            {
                descriptor.AddEvent("callReceived", this.OnCallReceived);
            }
            if (!String.IsNullOrEmpty(this.OnCallEnded))
            {
                descriptor.AddEvent("callEnded", this.OnCallEnded);
            }
            if (!String.IsNullOrEmpty(this.OnNewCallToCodif))
            {
                descriptor.AddEvent("newCallToCodif", this.OnNewCallToCodif);
            }
            if (!String.IsNullOrEmpty(this.DirectoryClicked))
            {
                descriptor.AddEvent("directoryClicked", this.DirectoryClicked);
            }
            if (!String.IsNullOrEmpty(this.ExceptionHandler))
            {
                descriptor.AddEvent("exceptionHandler", this.ExceptionHandler);
            }
            descriptor.AddProperty("mevoPilot", this.MevoPilot);
            descriptor.AddProperty("enableTransfer", this.enableTransfer);
            descriptor.AddProperty("enableConsultTransfer", this.enableConsultTransfer);
            descriptor.AddProperty("enableHold", this.enableHold);
            descriptor.AddProperty("enableDnd", this.enableDnd);
            descriptor.AddProperty("enableMevo", this.enableMevo);
            descriptor.AddProperty("enableDirectory", this.enableDirectory);
            descriptor.AddProperty("enableCallLogs", this.enableCallLogs);
            descriptor.AddProperty("enableMonitor", this.enableMonitor);
            descriptor.AddProperty("showAlert", this.showAlert);

            descriptor.AddProperty("mode", this.Mode);
            if (this.Mode == AuthenticationMode.trusted)
            {
                descriptor.AddProperty("token", GenerateEncryptedToken());
            }
            if (this.Mode == AuthenticationMode.sso && String.IsNullOrEmpty(this.monitoredLine))
            {
                this.monitoredLine = AuthenticationService.getDN();
            }
            descriptor.AddProperty("codifMode", this.CodifMode);
            descriptor.AddProperty("enableCodif", this.enableCodif);
            descriptor.AddProperty("user", this.User);
            descriptor.AddProperty("password", this.Password);
            descriptor.AddProperty("monitoredLine", this.monitoredLine);
            descriptor.AddProperty("enablePopupTransfer", this.enablePopupTransfer);
            descriptor.AddProperty("enableTransferLookup", this.enableTransferLookup);
            descriptor.AddProperty("dmdService", this.dmdService);
            descriptor.AddProperty("enableAgent", this.enableAgent);
            descriptor.AddProperty("showCallResultAlert", this.showCallResultAlert);
            descriptor.AddProperty("showCallResultRememberAlert", this.showCallResultRememberAlert);
            yield return(descriptor);
        }