コード例 #1
0
        public IEnumerable <ScriptDescriptor> GetScriptDescriptors()
        {
            ScriptComponentDescriptor scd = new ScriptBehaviorDescriptor("AnjLab.FX.Web.Controls.PersistentScrollPosition", Control.ClientID);

            scd.AddElementProperty("storage", storage.ClientID);
            yield return(scd);
        }
コード例 #2
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 });
        }