// Sebastien Pouliot (sebastien@ximian.com)
//
// (C) 2002 Ximian, Inc (http://www.ximian.com)
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// (C) 2004 Novell (http://www.novell.com)
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System;
using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
using System.Security;
namespace System.Security.Principal {
-#if NET_2_0
- [ComVisible (true)]
- public class WindowsImpersonationContext : IDisposable {
-#else
public class WindowsImpersonationContext {
-#endif
private IntPtr _token;
private bool undo;
}
undo = false;
}
-#if NET_2_0
- [ComVisible (false)]
- public void Dispose ()
- {
- if (!undo) {
- Undo ();
- }
- }
-
- [ComVisible (false)]
- protected virtual void Dispose (bool disposing)
- {
- if (!undo) {
- Undo ();
- }
- }
-#else
+
~WindowsImpersonationContext ()
{
if (!undo) {
Undo ();
}
}
-#endif
+
public void Undo ()
{
if (!RevertToSelf ()) {