Exemplo n.º 1
0
        /// <summary>
        /// Lists the specified folder.
        /// </summary>
        /// <param name="folder">The folder.</param>
        /// <returns></returns>
        public static CalendarInfo[] GetCalendars(CalendarFolder folder)
        {
            CalendarInfo[] retVal = new CalendarInfo[] { };

            if (folder != null)
            {
                retVal = GetCalendars(folder.PrimaryKeyId.Value);
            }

            return(retVal);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Lists the specified folder id.
        /// </summary>
        /// <param name="folderId">The folder id.</param>
        /// <returns></returns>
        public static CalendarInfo[] GetCalendars(int folderId)
        {
            List <CalendarInfo> retVal = new List <CalendarInfo>();

            // Load primary list
            Calendar [] calendars = Calendar.List(new FilterElement("CalendarFolderId",
                                                                    FilterElementType.Equal, folderId));

            List <CalendarFolderLink> links = new List <CalendarFolderLink>
                                                  (CalendarFolderLink.List(new FilterElement("FolderId",
                                                                                             FilterElementType.Equal, folderId)));

            //Get primary calendar
            foreach (Calendar calendar in calendars)
            {
                CalendarInfo newItem = new CalendarInfo(calendar, null);

                foreach (CalendarFolderLink link in new List <CalendarFolderLink>(links))
                {
                    //remove duplicate
                    if (link.CalendarId == calendar.PrimaryKeyId.Value)
                    {
                        links.Remove(link);
                    }
                }

                retVal.Add(newItem);
            }
            //Get links
            foreach (CalendarFolderLink link in links)
            {
                Calendar     calendar = new Calendar(link.CalendarId);
                CalendarInfo newItem  = new CalendarInfo(calendar, link);
                retVal.Add(newItem);
            }

            return(retVal.ToArray());
        }
Exemplo n.º 3
0
        /// <summary>
        /// Lists the specified folder.
        /// </summary>
        /// <param name="folder">The folder.</param>
        /// <returns></returns>
        public static CalendarInfo[] GetCalendars(CalendarFolder folder)
        {
            CalendarInfo[] retVal = new CalendarInfo[] { };

               if(folder != null)
               {
               retVal = GetCalendars(folder.PrimaryKeyId.Value);
               }

               return retVal;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Lists the specified folder id.
        /// </summary>
        /// <param name="folderId">The folder id.</param>
        /// <returns></returns>
        public static CalendarInfo[] GetCalendars(int folderId)
        {
            List<CalendarInfo> retVal = new List<CalendarInfo>();

            // Load primary list
            Calendar [] calendars = Calendar.List(new FilterElement("CalendarFolderId",
                                             FilterElementType.Equal, folderId));

               List<CalendarFolderLink> links = new List<CalendarFolderLink>
                                                (CalendarFolderLink.List(new FilterElement("FolderId",
                                                                         FilterElementType.Equal, folderId)));
            //Get primary calendar
            foreach(Calendar calendar in calendars)
            {
                CalendarInfo newItem = new CalendarInfo(calendar, null);

                foreach(CalendarFolderLink link in new List<CalendarFolderLink>(links))
                {
                    //remove duplicate
                   if(link.CalendarId == calendar.PrimaryKeyId.Value)
                      links.Remove(link);
                }

                retVal.Add(newItem);
            }
            //Get links
            foreach(CalendarFolderLink link in links)
            {
                Calendar calendar = new Calendar(link.CalendarId);
                CalendarInfo newItem = new CalendarInfo(calendar, link);
                retVal.Add(newItem);

            }

            return retVal.ToArray();
        }