Ejemplo n.º 1
0
        public Kalendar.Zero.ApiTerminal.CalDav.CalendarCollection Search(global::Kalendar.Zero.ApiTerminal.CalDav.CalendarQuery query)
        {
            var result = global::Kalendar.Zero.ApiTerminal.CalDav.Client.Common.Request(Url, "REPORT", (XElement)query, Credentials, new Dictionary <string, object> {
                { "Depth", 1 }
            });
            var xdoc       = XDocument.Parse(result.Item2);
            var data       = xdoc.Descendants(global::Kalendar.Zero.ApiTerminal.CalDav.Common.xCalDav.GetName("calendar-data"));
            var serializer = new Kalendar.Zero.ApiTerminal.CalDav.Serializer();

            return(new Kalendar.Zero.ApiTerminal.CalDav.CalendarCollection(data.SelectMany(x => {
                using (var rdr = new System.IO.StringReader(x.Value)) {
                    return serializer.Deserialize <Kalendar.Zero.ApiTerminal.CalDav.CalendarCollection>(rdr);
                }
            })));
        }