Example #1
0
        public async Task <bool> SetCalendarColorNoThrow(ArgbColor color)
        {
            try
            {
                await _webDavClient.ExecuteWebDavRequestAndReturnResponseHeaders(
                    _serverUrl,
                    "PROPPATCH",
                    0,
                    null,
                    null,
                    "application/xml",
                    string.Format(
                        @"<?xml version='1.0'?>
                      <D:propertyupdate xmlns:D=""DAV:"" xmlns:C=""urn:ietf:params:xml:ns:caldav"" xmlns:E=""http://apple.com/ns/ical/"">
                        <D:set>
                          <D:prop>
                              <E:calendar-color >{0}</E:calendar-color>
                          </D:prop>
                        </D:set>
                      </D:propertyupdate>
                 ", color.ToRgbaHexString())
                    );

                return(true);
            }
            catch (Exception x)
            {
                s_logger.Error(null, x);
                return(false);
            }
        }