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); }
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()))); }
public virtual void Add(MiniCalendar obj) { this.data.Add((SchedulerControlsItem)obj); }