public ActiveSyncDeviceIdParameter(ActiveSyncDevice device) : base(device) { }
// Token: 0x060000B5 RID: 181 RVA: 0x000074E8 File Offset: 0x000056E8 internal ActiveSyncDevices GetActiveSyncDeviceContainer() { ADDeviceManager.< > c__DisplayClassf CS$ < > 8__locals1 = new ADDeviceManager.< > c__DisplayClassf(); CS$ < > 8__locals1.< > 4__this = this; CS$ < > 8__locals1.filter = new ComparisonFilter(ComparisonOperator.Equal, ADObjectSchema.Name, "ExchangeActiveSyncDevices"); CS$ < > 8__locals1.containers = null; ADNotificationAdapter.RunADOperation(delegate() { CS$ < > 8__locals1.containers = CS$ < > 8__locals1.< > 4__this.session.Find <ActiveSyncDevices>(CS$ < > 8__locals1.< > 4__this.userId, QueryScope.OneLevel, CS$ < > 8__locals1.filter, ADDeviceManager.defaultSortOrder, 50); }); if (this.protocolLogger != null) { this.protocolLogger.SetValue(ProtocolLoggerData.DomainController, this.session.LastUsedDc); } if (CS$ < > 8__locals1.containers.Length == 1) { return(CS$ < > 8__locals1.containers[0]); } if (CS$ < > 8__locals1.containers.Length == 0) { return(null); } AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.RequestsTracer, this, "User \"{0}\" has more than one device container.", this.userName); if (this.protocolLogger != null) { this.protocolLogger.SetValue(ProtocolLoggerData.Error, "TooManyDeviceContainers"); } int num = -1; int i = 0; while (i < CS$ < > 8__locals1.containers.Length) { if (!CS$ < > 8__locals1.containers[i].Id.Rdn.EscapedName.Equals("ExchangeActiveSyncDevices") || num != -1) { ActiveSyncDevice[] devices = null; ADNotificationAdapter.RunADOperation(delegate() { devices = CS$ < > 8__locals1.< > 4__this.session.Find <ActiveSyncDevice>(CS$ < > 8__locals1.containers[i].Id, QueryScope.OneLevel, null, ADDeviceManager.defaultSortOrder, 50); }); if (devices != null) { ActiveSyncDevice[] devices2 = devices; for (int j = 0; j < devices2.Length; j++) { ActiveSyncDevice device = devices2[j]; try { ADNotificationAdapter.RunADOperation(delegate() { CS$ < > 8__locals1.< > 4__this.session.Delete(device); }); } catch (LocalizedException ex) { AirSyncDiagnostics.TraceError <string, string, string>(ExTraceGlobals.RequestsTracer, this, "Failed to delete device object {0} under CNF-mangled container {1} because: {2}", device.Id.DistinguishedName, CS$ < > 8__locals1.containers[i].Id.DistinguishedName, ex.Message); } } } try { ADNotificationAdapter.RunADOperation(delegate() { CS$ < > 8__locals1.< > 4__this.session.Delete(CS$ < > 8__locals1.containers[i]); }); goto IL_244; } catch (LocalizedException ex2) { AirSyncDiagnostics.TraceError <string, string>(ExTraceGlobals.RequestsTracer, this, "Failed to delete CNF-mangled container {0} because: {0}", CS$ < > 8__locals1.containers[i].Id.DistinguishedName, ex2.Message); goto IL_244; } goto IL_23C; } goto IL_23C; IL_244: i++; continue; IL_23C: num = i; goto IL_244; } if (num == -1) { return(this.CreateActiveSyncDeviceContainer(true)); } return(CS$ < > 8__locals1.containers[num]); }