예제 #1
0
        public MiniCalendar AttachMiniCalendar(DateTime date, bool navigation, string position)
        {
            MiniCalendar miniCalendar = new MiniCalendar();

            miniCalendar.Navigation = navigation;
            miniCalendar.Date       = date;
            miniCalendar.AttachToHeader(position);
            this.Add(miniCalendar);
            return(miniCalendar);
        }
예제 #2
0
        protected string _renderCalendar(MiniCalendar cal, string parent)
        {
            Dictionary <string, object> visibleProperties = cal.GetVisibleProperties();
            JavaScriptSerializer        scriptSerializer  = new JavaScriptSerializer();
            List <string> stringList = new List <string>();

            foreach (KeyValuePair <string, object> keyValuePair in visibleProperties)
            {
                if (keyValuePair.Key != "date")
                {
                    stringList.Add(string.Format("\"{0}\":{1}", (object)keyValuePair.Key, (object)scriptSerializer.Serialize(keyValuePair.Value)));
                }
                else
                {
                    stringList.Add(string.Format("\"{0}\":{1}", (object)keyValuePair.Key, cal.Date == new DateTime() ? (object)this.defaultDateString : (object)string.Format("new Date({0},{1},{2})", (object)cal.Date.Year, (object)(cal.Date.Month - 1), (object)cal.Date.Day)));
                }
            }
            stringList.Add("\"handler\":" + string.Format(cal.Handler, (object)parent));
            return(string.Format("\n{0}.renderCalendar({{{1}\n}});", (object)parent, (object)string.Join(",\n", stringList.ToArray())));
        }
예제 #3
0
 public virtual void Add(MiniCalendar obj)
 {
     this.data.Add((SchedulerControlsItem)obj);
 }