示例#1
0
        public async Task <DavResponse> Update(string name, string description, string backgroundColor, Uri uri, string userName, string authorization)
        {
            var requestUrl = GetRadicaleUrl(uri.ToString(), userName, IsShared, isRedirectUrl: true, entityId: Uid);

            var davRequest = new DavRequest()
            {
                Url           = requestUrl,
                Authorization = authorization,
                Data          = GetData(strUpdateTemplate, name, description, backgroundColor)
            };

            return(await RadicaleClient.UpdateAsync(davRequest).ConfigureAwait(false));
        }
        public async Task <DavResponse> Update(string name, string description, string backgroundColor, string uri, string userName, string authorization, bool isReadonly = true)
        {
            var addbookId = isReadonly ? readonlyAddBookName : defaultAddBookName;

            var header = uri.StartsWith("http") ? uri : "";

            var requestUrl = defaultRadicaleUrl + "/" + HttpUtility.UrlEncode(userName) + "/" + addbookId;

            var davRequest = new DavRequest()
            {
                Url           = requestUrl,
                Authorization = authorization,
                Data          = GetData(strTemplate, name, description, backgroundColor),
                Header        = header
            };

            return(await RadicaleClient.UpdateAsync(davRequest).ConfigureAwait(false));
        }