protected override IEnumerable<ScriptDescriptor> GetScriptDescriptors(Control targetControl)
		{
			ScriptBehaviorDescriptor descriptor = new ScriptBehaviorDescriptor("PermissionCenter.GridHoverBehavior", targetControl.ClientID);
			descriptor.AddProperty("hoverCssClass", this.HoverCssClass);
			descriptor.AddProperty("rowItemCssClass", this.RowItemCssClass);
			return new ScriptDescriptor[] { descriptor };
		}
        protected override IEnumerable<ScriptDescriptor> GetScriptDescriptors(Control targetControl)
        {
            ScriptBehaviorDescriptor descriptor = new ScriptBehaviorDescriptor("AjaxButton.FocusHighlighter", targetControl.ClientID);
            descriptor.AddProperty("highlightCssClass", this.HighlightCssClass);
            descriptor.AddProperty("nohighlightCssClass", this.NoHighlightCssClass);

            return new ScriptDescriptor[] { descriptor };
        }
Пример #3
0
        protected override IEnumerable<ScriptDescriptor> GetScriptDescriptors(System.Web.UI.Control targetControl)
        {
            ScriptBehaviorDescriptor descriptor =
                new ScriptBehaviorDescriptor(
                    "ImagePreviewExtender.ImagePreviewBehavior",
                    targetControl.ClientID);

            descriptor.AddProperty("ThumbnailCssClass", ThumbnailCssClass);

            descriptor.AddProperty("closeImage", closeImage);
            yield return descriptor;
        }
        protected override System.Collections.Generic.IEnumerable<ScriptDescriptor> GetScriptDescriptors(Control targetControl)
        {
            ScriptBehaviorDescriptor descriptor = new ScriptBehaviorDescriptor(this.GetType().FullName, targetControl.ClientID);

            if (string.IsNullOrEmpty(AssociatedLabelID))
                throw new Exception("Associated Control ID not specified for the TestExtenderControl");

            descriptor.AddProperty("updateLabelID", AssociatedLabelID);
            descriptor.AddProperty("highlightCssClass", HighlightCssClass);

            return new ScriptDescriptor[] { descriptor };
        }
Пример #5
0
 protected override void ConfigureDescriptor(ScriptBehaviorDescriptor descriptor)
 {
     descriptor.AddProperty("displayRememberMe", Properties["DisplayRememberMe"]);
     descriptor.AddProperty("rememberMeSet", Properties["RememberMeSet"]);
     descriptor.AddProperty("displaySignUp", Properties["DisplaySignUp"]);
     descriptor.AddProperty("displayPasswordRecovery", Properties["DisplayPasswordRecovery"]);
     descriptor.AddProperty("displayMyAccount", Properties["DisplayMyAccount"]);
     string s = ((string)(Properties["Welcome"]));
     if (!(String.IsNullOrEmpty(s)))
         descriptor.AddProperty("welcome", Properties["Welcome"]);
     s = ((string)(Properties["User"]));
     if (!(String.IsNullOrEmpty(s)))
         descriptor.AddProperty("user", Properties["User"]);
     descriptor.AddProperty("displayHelp", Properties["DisplayHelp"]);
     descriptor.AddProperty("enableHistory", Properties["EnableHistory"]);
     descriptor.AddProperty("enablePermalinks", Properties["EnablePermalinks"]);
     descriptor.AddProperty("displayLogin", Properties["DisplayLogin"]);
     if (Properties.ContainsKey("IdleUserTimeout"))
         descriptor.AddProperty("idleTimeout", Properties["IdleUserTimeout"]);
     string cultures = ((string)(Properties["Cultures"]));
     if (cultures.Split(new char[] {
                 ';'}, StringSplitOptions.RemoveEmptyEntries).Length > 1)
         descriptor.AddProperty("cultures", cultures);
 }
Пример #6
0
		public void ScriptBehaviorDescriptor_ctor_exception_2 () {
			ScriptBehaviorDescriptor scd = new ScriptBehaviorDescriptor ("My.Type", String.Empty);
		}
Пример #7
0
		public void ScriptBehaviorDescriptor_ctor_exception_1 () {
			ScriptBehaviorDescriptor scd = new ScriptBehaviorDescriptor ("My.Type", null);
		}
Пример #8
0
 protected override void ConfigureDescriptor(ScriptBehaviorDescriptor descriptor)
 {
     Page.ClientScript.RegisterHiddenField(String.Format("{0}_{1}_SelectedValue", ClientID, Controller), SelectedValue);
     descriptor.AddProperty("appId", this.TargetControlID);
     descriptor.AddProperty("controller", this.Controller);
     descriptor.AddProperty("viewId", this.View);
     descriptor.AddProperty("pageSize", this.PageSize);
     if (!(ShowActionBar))
         descriptor.AddProperty("showActionBar", false);
     if (ShowActionButtons != ActionButtonLocation.TopAndBottom)
         descriptor.AddProperty("showActionButtons", ShowActionButtons.ToString());
     if (ShowPager != PagerLocation.Bottom)
         descriptor.AddProperty("showPager", ShowPager.ToString());
     if (!(ShowPageSize))
         descriptor.AddProperty("showPageSize", false);
     if (!(ShowDetailsInListMode))
         descriptor.AddProperty("showDetailsInListMode", false);
     if (ShowSearchBar)
         descriptor.AddProperty("showSearchBar", true);
     if (ShowModalForms)
         descriptor.AddProperty("showModalForms", true);
     if (SearchOnStart)
         descriptor.AddProperty("searchOnStart", true);
     if (_lookupMode)
     {
         descriptor.AddProperty("mode", "Lookup");
         descriptor.AddProperty("lookupValue", LookupValue);
         descriptor.AddProperty("lookupText", LookupText);
         if (!(String.IsNullOrEmpty(LookupPostBackExpression)))
             descriptor.AddProperty("lookupPostBackExpression", LookupPostBackExpression);
         if (AllowCreateLookupItems)
             descriptor.AddProperty("newViewId", MyCompany.Data.Controller.LookupActionArgument(Controller, "New"));
     }
     if (!(String.IsNullOrEmpty(FilterSource)))
     {
         Control source = NamingContainer.FindControl(FilterSource);
         if (source != null)
         {
             descriptor.AddProperty("filterSource", source.ClientID);
             if (source is DataViewExtender)
                 descriptor.AddProperty("appFilterSource", ((DataViewExtender)(source)).TargetControlID);
         }
         else
             descriptor.AddProperty("filterSource", this.FilterSource);
     }
     if (!(String.IsNullOrEmpty(FilterFields)))
         descriptor.AddProperty("filterFields", this.FilterFields);
     descriptor.AddProperty("cookie", Guid.NewGuid().ToString());
     if (!(String.IsNullOrEmpty(StartCommandName)))
         descriptor.AddProperty("startCommandName", StartCommandName);
     if (!(String.IsNullOrEmpty(StartCommandArgument)))
         descriptor.AddProperty("startCommandArgument", StartCommandArgument);
     if (SelectionMode == DataViewSelectionMode.Multiple)
         descriptor.AddProperty("selectionMode", "Multiple");
     if (!(Enabled))
         descriptor.AddProperty("enabled", false);
     if (TabIndex > 0)
         descriptor.AddProperty("tabIndex", TabIndex);
     if (ShowInSummary)
         descriptor.AddProperty("showInSummary", "true");
     if (!(ShowDescription))
         descriptor.AddProperty("showDescription", false);
     if (!(ShowViewSelector))
         descriptor.AddProperty("showViewSelector", false);
     if (!(String.IsNullOrEmpty(Tag)))
         descriptor.AddProperty("tag", Tag);
     if (SummaryFieldCount != 5)
         descriptor.AddProperty("summaryFieldCount", SummaryFieldCount);
     if (SearchByFirstLetter)
         descriptor.AddProperty("showFirstLetters", true);
     if (AutoSelectFirstRow)
         descriptor.AddProperty("autoSelectFirstRow", true);
     if (AutoHighlightFirstRow)
         descriptor.AddProperty("autoHighlightFirstRow", true);
     if (RefreshInterval > 0)
         descriptor.AddProperty("refreshInterval", RefreshInterval);
     if (!(ShowQuickFind))
         descriptor.AddProperty("showQuickFind", false);
     if (ShowRowNumber)
         descriptor.AddProperty("showRowNumber", true);
     if (AutoHide != AutoHideMode.Nothing)
         descriptor.AddProperty("autoHide", Convert.ToInt16(AutoHide));
     if (Properties.ContainsKey("StartupFilter"))
         descriptor.AddProperty("startupFilter", Properties["StartupFilter"]);
     if (Transaction != DataTransactionMode.NotSupported)
     {
         string t = Transaction.ToString();
         if (Transaction != DataTransactionMode.Supported || ((Page.Request.Params["_transaction"] == "true") && ((Page.Request.Params["_controller"] == this.Controller) && String.IsNullOrEmpty(this.FilterSource))))
             t = Guid.NewGuid().ToString();
         descriptor.AddProperty("transaction", t);
     }
     string visibleWhenExpression = VisibleWhen;
     if (!(String.IsNullOrEmpty(Roles)) && !(DataControllerBase.UserIsInRole(Roles)))
         if (String.IsNullOrEmpty(visibleWhenExpression))
             visibleWhenExpression = "false";
         else
             visibleWhenExpression = String.Format("({0}) && false", visibleWhenExpression);
     if (!(String.IsNullOrEmpty(visibleWhenExpression)))
         descriptor.AddProperty("visibleWhen", visibleWhenExpression);
 }
 protected override IEnumerable<ScriptDescriptor> GetScriptDescriptors(Control targetControl)
 {
     ScriptBehaviorDescriptor descriptor =
         new ScriptBehaviorDescriptor("TicketDesk.Engine.Ajax.Extenders.UpdatePanelPopupBehavior", targetControl.ClientID);
     descriptor.AddProperty("clientID", this.ClientID);
     descriptor.AddProperty("uniqueID", this.UniqueID);
     descriptor.AddProperty("offsetX", this.OffsetX);
     descriptor.AddProperty("offsetY", this.OffsetY);
     descriptor.AddProperty("align", this.HorizontalAlign);
     descriptor.AddProperty("valign", this.VerticalAlign);
     descriptor.AddProperty("loadVisible", this.UpdatePanelVisible);
     descriptor.AddProperty("positionElementID", this.PositionControlClientID);
     descriptor.AddProperty("calloutColor", ColorAsHtml(this.CalloutColor));
     descriptor.AddProperty("calloutBorderColor", ColorAsHtml(this.CalloutBorderColor));
     descriptor.AddProperty("calloutType", this.CalloutType);
     descriptor.AddProperty("autoPostBack", this.AutoPostBack);
     return new ScriptDescriptor[] { descriptor };
 }
Пример #10
0
 protected override void ConfigureDescriptor(ScriptBehaviorDescriptor descriptor)
 {
 }
Пример #11
0
 IEnumerable<ScriptDescriptor> IScriptControl.GetScriptDescriptors()
 {
     ScriptBehaviorDescriptor descriptor = new ScriptBehaviorDescriptor("Sys.Extended.UI.AutoCompleteBehavior", ClientID);
     descriptor.AddProperty("id", ClientID);
     descriptor.AddProperty("completionInterval", CompletionInterval);
     descriptor.AddProperty("contextKey", String.Format("{0},{1},{2}", DataController, DataView, DistinctValueFieldName));
     descriptor.AddProperty("delimiterCharacters", ",;");
     descriptor.AddProperty("minimumPrefixLength", MinimumPrefixLength);
     descriptor.AddProperty("serviceMethod", "GetCompletionList");
     descriptor.AddProperty("servicePath", ResolveClientUrl("~/DAF/Service.asmx"));
     descriptor.AddProperty("useContextKey", true);
     return new ScriptBehaviorDescriptor[] {
             descriptor};
 }
        protected override IEnumerable<ScriptDescriptor> GetScriptDescriptors(Control targetControl)
        {
            ScriptBehaviorDescriptor descriptor =
                new ScriptBehaviorDescriptor("TicketDesk.Engine.Ajax.Extenders.UpdateProgressOverlayBehavior", targetControl.ClientID);

            UpdateProgress up = targetControl as UpdateProgress;
            string asscUpdatePanelClientId = string.IsNullOrEmpty(up.AssociatedUpdatePanelID) ?
                null : GetClientId(up.AssociatedUpdatePanelID, "AssociatedUpdatePanelID");

           

            string controlToOverlayID = null;
            if (_overlayType != OverlayType.Browser)
            {
                controlToOverlayID = string.IsNullOrEmpty(ControlToOverlayID) ?
                    asscUpdatePanelClientId : GetClientId(ControlToOverlayID, "ControlToOverlayID");
            }

            descriptor.AddProperty("controlToOverlayID", controlToOverlayID);
            descriptor.AddProperty("associatedUpdatePanelID", asscUpdatePanelClientId);
            descriptor.AddProperty("displayAfter", up.DisplayAfter);
            descriptor.AddProperty("targetCssClass", this.CssClass);
            descriptor.AddProperty("centerOnContainer", this.CenterOnContainer);
            descriptor.AddProperty("elementToCenterID", this.ElementToCenterID);

            return new ScriptDescriptor[] { descriptor };
        }
 protected override IEnumerable<ScriptDescriptor> GetScriptDescriptors(Control targetControl)
 {
     ScriptBehaviorDescriptor descriptor = new ScriptBehaviorDescriptor("BigShelf.AutoPostBackBehavior", targetControl.ClientID);
     descriptor.AddProperty("uniqueID", UniqueID);
     descriptor.AddProperty("trigger", Trigger);
     descriptor.AddProperty("throttle", Throttle);
     return new ScriptDescriptor[] { descriptor };
 }
Пример #14
0
 protected override System.Collections.Generic.IEnumerable<ScriptDescriptor> GetScriptDescriptors(Control targetControl)
 {
     if (Site != null)
         return null;
     if (ScriptManager.GetCurrent(Page).IsInAsyncPostBack)
     {
         bool requireRegistration = false;
         Control c = this;
         while (!(requireRegistration) && ((c != null) && !((c is HtmlForm))))
         {
             if (c is UpdatePanel)
                 requireRegistration = true;
             c = c.Parent;
         }
         if (!(requireRegistration))
             return null;
     }
     ScriptBehaviorDescriptor descriptor = new ScriptBehaviorDescriptor(_clientComponentName, targetControl.ClientID);
     descriptor.AddProperty("id", this.ClientID);
     string baseUrl = ResolveClientUrl("~");
     if (baseUrl == "~")
         baseUrl = String.Empty;
     bool isTouchUI = ApplicationServices.IsTouchClient;
     if (!(isTouchUI))
     {
         descriptor.AddProperty("baseUrl", baseUrl);
         descriptor.AddProperty("servicePath", ResolveClientUrl(ServicePath));
     }
     ConfigureDescriptor(descriptor);
     return new ScriptBehaviorDescriptor[] {
             descriptor};
 }
Пример #15
0
 protected virtual void ConfigureDescriptor(ScriptBehaviorDescriptor descriptor)
 {
 }
Пример #16
0
 IEnumerable<ScriptDescriptor> IExtenderControl.GetScriptDescriptors(Control targetControl)
 {
     ScriptBehaviorDescriptor descriptor = new ScriptBehaviorDescriptor("Web.Menu", targetControl.ClientID);
     descriptor.AddProperty("id", this.ClientID);
     if (HoverStyle != MenuHoverStyle.Auto)
         descriptor.AddProperty("hoverStyle", Convert.ToInt32(HoverStyle));
     if (PopupPosition != MenuPopupPosition.Left)
         descriptor.AddProperty("popupPosition", Convert.ToInt32(PopupPosition));
     if (ItemDescriptionStyle != MenuItemDescriptionStyle.ToolTip)
         descriptor.AddProperty("itemDescriptionStyle", Convert.ToInt32(ItemDescriptionStyle));
     if (ShowSiteActions)
         descriptor.AddProperty("showSiteActions", "true");
     if (PresentationStyle != MenuPresentationStyle.MultiLevel)
         descriptor.AddProperty("presentationStyle", Convert.ToInt32(PresentationStyle));
     return new ScriptBehaviorDescriptor[] {
             descriptor};
 }
        protected override void RenderScriptAttributes(ScriptBehaviorDescriptor descriptor)
        {
            base.RenderScriptAttributes(descriptor);

            descriptor.AddProperty("updatePanelID", TargetControl.UniqueID);
            descriptor.AddProperty("updatePanelClientID", TargetControl.ClientID);
        }
Пример #18
0
 /// <summary>
 /// Gets a collection of <see cref="T:System.Web.UI.ScriptDescriptor"/> objects that define script descriptors that the control requires.
 /// </summary>
 /// <returns>
 /// An <see cref="T:System.Collections.IEnumerable"/> collection of <see cref="T:System.Web.UI.ScriptDescriptor"/> objects.
 /// </returns>
 public override IEnumerable<System.Web.UI.ScriptDescriptor> GetScriptDescriptors()
 {
     var descriptor = new ScriptBehaviorDescriptor(this.GetType().FullName, this.ClientID);
     descriptor.AddProperty("imagesCollection", this.ImagesCollection);
     var properties = new 
     { 
         firstPagePosition = this.FirstPagePosition.ToString(),
         hardPages = this.HardPages.ToString(),
         pageFlipMode = this.PageFlipMode.ToString(),
         rightPageIndex = this.RightPageIndex,
     };
     JavaScriptSerializer serializer = new JavaScriptSerializer();
     var serializedProperties = serializer.Serialize(properties);
     descriptor.AddProperty("properties", serializedProperties);
     descriptor.AddElementProperty("silverlightBookObject", this.SilverlightBook.ClientID);
     return new ScriptDescriptor[] { descriptor };
 }
Пример #19
0
         GetScriptDescriptors(System.Web.UI.Control targetControl)
 {
     ScriptBehaviorDescriptor descriptor = new ScriptBehaviorDescriptor("AjaxControlExtender1.ClientBehavior1", targetControl.ClientID);
     yield return descriptor;
 }
Пример #20
0
		public IEnumerable<ScriptDescriptor> GetScriptDescriptors()
		{
			ScriptComponentDescriptor scd = new ScriptBehaviorDescriptor("AnjLab.FX.Web.Controls.PersistentScrollPosition", Control.ClientID);			
			scd.AddElementProperty("storage", storage.ClientID);
			yield return scd;
		}