ZeroInstall.DesktopIntegration.SyncIntegrationManager.UploadAppList C# (CSharp) Method

UploadAppList() private method

Upload the encrypted AppList back to the server (unless the client was reset)
private UploadAppList ( [ appListUri, [ webClient, SyncResetMode resetMode ) : void
appListUri [
webClient [
resetMode SyncResetMode
return void
        private void UploadAppList([NotNull] Uri appListUri, [NotNull] WebClientTimeout webClient, SyncResetMode resetMode)
        {
            if (resetMode == SyncResetMode.Client) return;

            var memoryStream = new MemoryStream();
            AppList.SaveXmlZip(memoryStream, _cryptoKey);

            // Prevent "lost updates" (race conditions) with HTTP ETags
            if (resetMode == SyncResetMode.None && (appListUri.Scheme == "http" || appListUri.Scheme == "https"))
            {
                if (!string.IsNullOrEmpty(webClient.ResponseHeaders[HttpResponseHeader.ETag]))
                    webClient.Headers[HttpRequestHeader.IfMatch] = webClient.ResponseHeaders[HttpResponseHeader.ETag];
            }

            Handler.RunTask(new SimpleTask(Resources.SyncUploading, () => webClient.UploadData(appListUri, "PUT", memoryStream.ToArray())));
        }
        #endregion