Ejemplo n.º 1
0
        private string GetCalednarsMenu(MLG2007.Helper.CalendarStore.CalendarType calendarType)
        {
            string menuHeaderTemplate  = "<li onmouseover=\"this.className='hover';\" onmouseout=\"this.className=\'';\"><a  href=\"#\">" + ((calendarType == MLG2007.Helper.CalendarStore.CalendarType.SharePoint) ? "Sharepoint Calendars</a><ul>" : "Exchange Calendars</a><ul>");
            int    intitialStringCount = menuHeaderTemplate.Length;

            if (Calendars != null)
            {
                foreach (MLGCalendar.Calendar tmpCalendar in Calendars)
                {
                    if (tmpCalendar.CalendarType == calendarType)
                    {
                        menuHeaderTemplate += GetMenuItem(tmpCalendar.CalendarId, tmpCalendar.CalendarName, tmpCalendar.CalendarDescription, tmpCalendar.IsUserSelected, tmpCalendar.CalendarType);
                    }
                }

                //Check if there's no Calendars
                if (intitialStringCount == menuHeaderTemplate.Length)
                {
                    return("");
                }
                menuHeaderTemplate += "</ul></li>";
            }
            return(menuHeaderTemplate);
        }
Ejemplo n.º 2
0
        private string GetMenuItem(int calendarId, string calendarTitle, string calendarDescription, bool status, MLGCalendar.CalendarType calendarType)
        {
            string menuItemTemplate = (status) ? "<li><input type=\"Checkbox\" id=\"Checkbox_{0}\" alt=\"{1}\"  onclick=" + ((calendarType == MLG2007.Helper.CalendarStore.CalendarType.SharePoint) ? "\"unselectSharePointCalendar({0})\"" : "\"unselectExchangeCalendar({0})\"") + " name=\"Calendar_{0}\" checked /><a href=\"#\" alt=\"{1}\"  onclick=\"" + ((calendarType == MLG2007.Helper.CalendarStore.CalendarType.SharePoint) ? "unselectSharePointCalendar({0})\"" : "\"unselectExchangeCalendar({0})\"") + ">{2}</a></li>" : "<li><input type=\"Checkbox\" id=\"Checkbox_{0}\" alt=\"{1}\"  onclick=" + ((calendarType == MLG2007.Helper.CalendarStore.CalendarType.SharePoint) ? "\"selectSharePointCalendar({0})\"" : "\"selectExchangeCalendar({0})\"") + " name=\"Calendar_{0}\"  /><a href=\"#\" alt=\"{1}\"  onclick=" + ((calendarType == MLG2007.Helper.CalendarStore.CalendarType.SharePoint) ? "\"selectSharePointCalendar({0})\"" : "\"selectExchangeCalendar({0})\"") + ">{2}</a></li>";

            return(string.Format(menuItemTemplate, calendarId, calendarDescription, calendarTitle));
        }