aboutsummaryrefslogtreecommitdiff
path: root/src/test/WixToolsetTest.CoreIntegration/Utility/Pushd.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2017-12-29 03:57:03 -0800
committerRob Mensching <rob@firegiant.com>2017-12-29 03:57:03 -0800
commitbe163ecb92398a8d569a7e97aaf25bc7e5fb9eec (patch)
treed720b23f90a7e9667a4480e11e8aac506f9a8250 /src/test/WixToolsetTest.CoreIntegration/Utility/Pushd.cs
parent58b8be53fd966e3d475362912477a422f5b5aa11 (diff)
downloadwix-be163ecb92398a8d569a7e97aaf25bc7e5fb9eec.tar.gz
wix-be163ecb92398a8d569a7e97aaf25bc7e5fb9eec.tar.bz2
wix-be163ecb92398a8d569a7e97aaf25bc7e5fb9eec.zip
Move to WixBuildTools.TestSupport
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/Utility/Pushd.cs')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/Utility/Pushd.cs46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/Utility/Pushd.cs b/src/test/WixToolsetTest.CoreIntegration/Utility/Pushd.cs
deleted file mode 100644
index efd733a7..00000000
--- a/src/test/WixToolsetTest.CoreIntegration/Utility/Pushd.cs
+++ /dev/null
@@ -1,46 +0,0 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolsetTest.CoreIntegration.Utility
4{
5 using System;
6 using System.IO;
7
8 public class Pushd : IDisposable
9 {
10 protected bool Disposed { get; private set; }
11
12 public Pushd(string path)
13 {
14 this.PreviousDirectory = Directory.GetCurrentDirectory();
15
16 Directory.SetCurrentDirectory(path);
17 }
18
19 public string PreviousDirectory { get; }
20
21 #region // IDisposable
22
23 public void Dispose()
24 {
25 this.Dispose(true);
26 GC.SuppressFinalize(this);
27 }
28
29 protected virtual void Dispose(bool disposing)
30 {
31 if (this.Disposed)
32 {
33 return;
34 }
35
36 if (disposing)
37 {
38 Directory.SetCurrentDirectory(this.PreviousDirectory);
39 }
40
41 this.Disposed = true;
42 }
43
44 #endregion
45 }
46}