Files
Disco/Disco.Services/Interop/ActiveDirectory/ADDirectoryEntry.cs
T
Gary Sharp 09c2a24222 Update #42: AD Migration
Refactor to target specific Domain Controllers, with failover.
2014-04-21 21:43:13 +10:00

48 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.DirectoryServices;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Services.Interop.ActiveDirectory
{
public class ADDirectoryEntry : IDisposable
{
public ADDomain Domain { get; private set; }
public ADDomainController DomainController { get; private set; }
public DirectoryEntry Entry { get; private set; }
internal ADDirectoryEntry(ADDomain Domain, ADDomainController DomainController, DirectoryEntry Entry)
{
if (Domain == null)
throw new ArgumentNullException("Domain");
if (DomainController == null)
throw new ArgumentNullException("DomainController");
if (Entry == null)
throw new ArgumentNullException("Entry");
this.Domain = Domain;
this.DomainController = DomainController;
this.Entry = Entry;
}
public void Dispose()
{
if (Entry != null)
{
Entry.Dispose();
Entry = null;
}
}
public override string ToString()
{
if (this.Entry != null)
return this.Entry.Path;
else
return base.ToString();
}
}
}