Ejemplo n.º 1
0
        public static AssemblyManifest DownloadDeploymentManifest(SubscriptionStore subStore, ref Uri sourceUri, out TempFile tempFile, IDownloadNotification notification, DownloadOptions options)
        {
            Logger.AddMethodCall("DownloadDeploymentManifest called.");
            Logger.AddInternalState("SourceUri=" + (object)sourceUri);
            Logger.AddInternalState("DownloadOptions=" + (options != null ? options.ToString() : "null"));
            tempFile = (TempFile)null;
            TempFile tempFile1 = (TempFile)null;
            TempFile tempFile2 = (TempFile)null;

            DownloadManager.ClientCertificate = (X509Certificate2)null;
            AssemblyManifest deployment;

            try
            {
                ServerInformation serverInformation;
                deployment = DownloadManager.DownloadDeploymentManifestDirect(subStore, ref sourceUri, out tempFile1, notification, options, out serverInformation);
                Logger.SetSubscriptionServerInformation(serverInformation);
                bool flag = DownloadManager.FollowDeploymentProviderUri(subStore, ref deployment, ref sourceUri, out tempFile2, notification, options);
                tempFile = flag ? tempFile2 : tempFile1;
            }
            finally
            {
                if (tempFile1 != null && tempFile1 != tempFile)
                {
                    tempFile1.Dispose();
                }
                if (tempFile2 != null && tempFile2 != tempFile)
                {
                    tempFile2.Dispose();
                }
            }
            return(deployment);
        }
Ejemplo n.º 2
0
        public static AssemblyManifest DownloadDeploymentManifestBypass(SubscriptionStore subStore, ref Uri sourceUri, out TempFile tempFile, out SubscriptionState subState, IDownloadNotification notification, DownloadOptions options)
        {
            Logger.AddMethodCall("DownloadDeploymentManifestBypass called.");
            tempFile = (TempFile)null;
            subState = (SubscriptionState)null;
            TempFile tempFile1 = (TempFile)null;
            TempFile tempFile2 = (TempFile)null;

            DownloadManager.ClientCertificate = (X509Certificate2)null;
            AssemblyManifest deployment;

            try
            {
                ServerInformation serverInformation;
                deployment = DownloadManager.DownloadDeploymentManifestDirectBypass(subStore, ref sourceUri, out tempFile1, out subState, notification, options, out serverInformation);
                Logger.SetSubscriptionServerInformation(serverInformation);
                if (subState != null)
                {
                    tempFile = tempFile1;
                    return(deployment);
                }
                bool flag = DownloadManager.FollowDeploymentProviderUri(subStore, ref deployment, ref sourceUri, out tempFile2, notification, options);
                tempFile = flag ? tempFile2 : tempFile1;
            }
            finally
            {
                if (tempFile1 != null && tempFile1 != tempFile)
                {
                    tempFile1.Dispose();
                }
                if (tempFile2 != null && tempFile2 != tempFile)
                {
                    tempFile2.Dispose();
                }
            }
            return(deployment);
        }