/// <summary> /// Disposes the current instance of the ADObject object. /// </summary> /// <param name="disposing">Whether to dispose unmanaged resources</param> protected virtual void Dispose(bool disposing) { if (!disposed) { if (disposing) { if (InnerPrincipal != null) { InnerPrincipal.Dispose(); } foreach (TreeNode treeNode in TreeNodes) { treeNode.ContextMenuStrip.Dispose(); } } // Instance has been disposed InnerPrincipal = null; disposed = true; } }
/// <summary> /// Gets properties of inner object. /// </summary> public object GetProperty(string name) { PropertyValueCollection attribute = ((DirectoryEntry)InnerPrincipal.GetUnderlyingObject()).Properties[name]; return(attribute.Value); }