public void DeleteTree(ADConfigurationObject instanceToDelete, TreeDeleteNotFinishedHandler handler) { if (instanceToDelete == null) { throw new ArgumentNullException("instanceToDelete"); } ADConfigurationSession adconfigurationSession = this; IDirectorySession session = instanceToDelete.Session; try { for (;;) { try { adconfigurationSession.Delete(instanceToDelete, true); } catch (ADTreeDeleteNotFinishedException ex) { ExTraceGlobals.ADTopologyTracer.TraceWarning <string, string>((long)this.GetHashCode(), "ADTreeDeleteNotFinishedException is caught while deleting the whole tree '{0}': {1}", instanceToDelete.Identity.ToString(), ex.Message); if (handler != null) { handler(ex); } if (string.IsNullOrEmpty(adconfigurationSession.DomainController)) { adconfigurationSession = (ADConfigurationSession)this.Clone(); adconfigurationSession.DomainController = ex.Server; instanceToDelete.m_Session = null; } continue; } break; } } finally { instanceToDelete.m_Session = session; } }
void IConfigurationSession.DeleteTree(ADConfigurationObject instanceToDelete, TreeDeleteNotFinishedHandler handler) { FfoDirectorySession.LogNotSupportedInFFO(null); ((IConfigDataProvider)this).Delete(instanceToDelete); }
void IConfigurationSession.DeleteTree(ADConfigurationObject instanceToDelete, TreeDeleteNotFinishedHandler handler) { base.InvokeWithAPILogging <bool>(delegate { this.GetSession().DeleteTree(instanceToDelete, handler); return(true); }, "DeleteTree"); }