コード例 #1
0
        public void TestInitialize()
        {
            TestCleanup();

            _updatePackageAccessMock = new UpdatePackageAccessMock() { GetFilenameOnly = _fileName };

            _updatePackageMock = new UpdatePackageMock();
            _updatePackageMock.Access = _updatePackageAccessMock;

            _unzipFile = new UnzipFile(_workFolder, _updatePackageMock);
        }
コード例 #2
0
        public void TestCleanup()
        {
            if (Directory.Exists(_workFolder) && Directory.EnumerateFiles(_workFolder).Any(name => !name.EndsWith(".zip")))
            {
                Directory.Delete(_workFolder, true);
            }

            _unzipFile = null;
            _updatePackageMock = null;
            _updatePackageAccessMock = null;
        }
コード例 #3
0
        public void Dispose()
        {
            // Clearing all of these ensures that the transient APIs
            // can't be called outside of the appropriate scope.

            #region dispose-dispatcher service-apis
            _GetNuGetExePath             = null;
            _GetNuGetDllPath             = null;
            _DownloadFile                = null;
            _AddPinnedItemToTaskbar      = null;
            _RemovePinnedItemFromTaskbar = null;
            _CreateShortcutLink          = null;
            _UnzipFileIncremental        = null;
            _UnzipFile                 = null;
            _AddFileAssociation        = null;
            _RemoveFileAssociation     = null;
            _AddExplorerMenuItem       = null;
            _RemoveExplorerMenuItem    = null;
            _SetEnvironmentVariable    = null;
            _RemoveEnvironmentVariable = null;
            _AddFolderToPath           = null;
            _RemoveFolderFromPath      = null;
            _InstallMSI                = null;
            _RemoveMSI                 = null;
            _StartProcess              = null;
            _InstallVSIX               = null;
            _UninstallVSIX             = null;
            _InstallPowershellScript   = null;
            _UninstallPowershellScript = null;
            _SearchForExecutable       = null;
            _GetUserBinFolder          = null;
            _GetSystemBinFolder        = null;
            _CopyFile                = null;
            _CopyFolder              = null;
            _Delete                  = null;
            _DeleteFolder            = null;
            _CreateFolder            = null;
            _DeleteFile              = null;
            _BeginTransaction        = null;
            _AbortTransaction        = null;
            _EndTransaction          = null;
            _GenerateUninstallScript = null;
            _GetKnownFolder          = null;
            _IsElevated              = null;
            #endregion

            #region dispose-dispatcher core-apis
            _Warning          = null;
            _Message          = null;
            _Error            = null;
            _Debug            = null;
            _Verbose          = null;
            _ExceptionThrown  = null;
            _Progress         = null;
            _ProgressComplete = null;
            _GetHostDelegate  = null;
            _IsCancelled      = null;
            #endregion

            #region dispose-dispatcher request-apis
            _OkToContinue                       = null;
            _YieldPackage                       = null;
            _YieldPackageDetails                = null;
            _YieldPackageSwidtag                = null;
            _YieldSource                        = null;
            _YieldMetadataDefinition            = null;
            _YieldInstallationOptionsDefinition = null;
            #endregion

            #region dispose-dispatcher host-apis
            _GetMetadataKeys             = null;
            _GetMetadataValues           = null;
            _GetInstallationOptionKeys   = null;
            _GetInstallationOptionValues = null;
            _PackageSources   = null;
            _GetConfiguration = null;
            _ShouldContinueWithUntrustedPackageSource = null;
            _ShouldProcessPackageInstall                = null;
            _ShouldProcessPackageUninstall              = null;
            _ShouldContinueAfterPackageInstallFailure   = null;
            _ShouldContinueAfterPackageUninstallFailure = null;
            _ShouldContinueRunningInstallScript         = null;
            _ShouldContinueRunningUninstallScript       = null;
            _AskPermission = null;
            _WhatIf        = null;
            #endregion

            #region dispose-dispatcher protocol-apis
            _ProtocolGetNames        = null;
            _ProtocolIsValidSource   = null;
            _ProtocolGetItemMetadata = null;
            _ProtocolDownloadItem    = null;
            _ProtocolUnpackItem      = null;
            _InstallItem             = null;
            #endregion

            _callback = null;
        }
コード例 #4
0
 public IEnumerable <string> UnzipFile(string zipFile, string folder)
 {
     CheckDisposed();
     return((_UnzipFile ?? (_UnzipFile = (_callback.Resolve <UnzipFile>() ?? ((pzipFile, pfolder) => default(IEnumerable <string>)))))(zipFile, folder));
 }