Advertisement
Guest User

ExtNetControl-DatePickerPlus

a guest
Nov 23rd, 2011
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.54 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Ext.Net;
  6. using System.Web.UI;
  7. using System.ComponentModel;
  8.  
  9. [assembly: WebResource("MyAssembly.Controls.ExtNet.resources.DatePickerPlus.datepickerplus.js", "application/javascript")]
  10. namespace MyAssembly.Controls.ExtNet
  11. {
  12.  
  13.     [ToolboxData("<{0}:DatePickerPlus runat=\"server\" />")]
  14.     [Description("DatePickerPlus extension is used when multiple dates needs to be selected")]
  15.     public class DatePickerPlus : DatePicker
  16.     {
  17.         protected override List<ResourceItem> Resources
  18.         {
  19.             get
  20.             {
  21.                 List<ResourceItem> baseList = base.Resources;
  22.                 baseList.Capacity += 1;
  23.  
  24.                 baseList.Add(new ClientScriptItem(typeof(DatePickerPlus), "MyAssembly.Controls.ExtNet.resources.DatePickerPlus.datepickerplus.js", "ux/extensions/datepickerplus/datepickerplus.js"));
  25.  
  26.                 return baseList;
  27.             }
  28.         }
  29.         public override string InstanceOf
  30.         {
  31.             get
  32.             {
  33.                 return "Ext.ux.DatePickerPlus";
  34.             }
  35.         }
  36.         public override string XType
  37.         {
  38.             get
  39.             {
  40.                 return "datepickerplus";
  41.             }
  42.         }
  43.  
  44.         /// <summary>
  45.         /// True to allow selection of multiple dates. Defaults to true.
  46.         /// </summary>
  47.         [Meta]
  48.         [ConfigOption]
  49.         [DefaultValue(true)]
  50.         [NotifyParentProperty(true)]
  51.         [Description("True to allow selection of multiple dates. Defaults to true.")]
  52.         public virtual bool MultipleSelection
  53.         {
  54.             get
  55.             {
  56.                 object obj = this.ViewState["MultipleSelection"];
  57.                 return (obj == null) ? true : (bool)obj;
  58.             }
  59.             set
  60.             {
  61.                 this.ViewState["MultipleSelection"] = value;
  62.             }
  63.         }
  64.  
  65.         [Browsable(false)]
  66.         [EditorBrowsable(EditorBrowsableState.Never)]
  67.         [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  68.         [System.Xml.Serialization.XmlIgnore]
  69.         [Newtonsoft.Json.JsonIgnore]
  70.         public override ConfigOptionsCollection ConfigOptions
  71.         {
  72.             get
  73.             {
  74.                 ConfigOptionsCollection list = base.ConfigOptions;
  75.  
  76.                 list.Add("multiSelection", new ConfigOption("multiSelection", null, true, this.MultipleSelection));
  77.                 return (list);
  78.             }
  79.         }
  80.     }
  81. }
  82.  
  83.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement