public static void UpdateGwartLastModified(ITopologyConfigurationSession configSession, ADObjectId sourceRoutingGroup, ManageSendConnectors.ThrowTerminatingErrorDelegate throwDelegate)
		{
			TaskLogger.LogEnter();
			if (ManageSendConnectors.IsE12RoutingGroup(sourceRoutingGroup))
			{
				configSession.UpdateGwartLastModified();
				TaskLogger.Trace("Updated E12 Legacy GWART {0}", new object[]
				{
					LegacyGwart.DefaultName
				});
			}
			TaskLogger.LogExit();
		}
		public static LocalizedException ValidateTransportServers(IConfigurationSession session, SendConnector connector, ref ADObjectId routingGroupId, bool allowEdgeServers, bool sourceValidation, Task task, out bool edgeConnector, out bool multiSiteConnector)
		{
			edgeConnector = false;
			multiSiteConnector = false;
			MultiValuedProperty<ADObjectId> sourceTransportServers = connector.SourceTransportServers;
			if (sourceTransportServers != null && sourceTransportServers.Count != 0)
			{
				bool flag = false;
				ADObjectId adobjectId = null;
				MultiValuedProperty<ADObjectId> multiValuedProperty = new MultiValuedProperty<ADObjectId>();
				List<string> list = new List<string>();
				foreach (ADObjectId adobjectId2 in sourceTransportServers)
				{
					if (adobjectId2 != null)
					{
						Server server = session.Read<Server>(adobjectId2);
						if (server == null)
						{
							list.Add(adobjectId2.Name);
						}
						else
						{
							if (adobjectId == null)
							{
								if (routingGroupId == null)
								{
									routingGroupId = ManageSendConnectors.GetServerRoutingGroup(server);
									if (routingGroupId == null)
									{
										return new SendConnectorUndefinedServerRgException(adobjectId2.Name);
									}
								}
								flag = ManageSendConnectors.IsE12RoutingGroup(routingGroupId);
								if (allowEdgeServers)
								{
									edgeConnector = server.IsEdgeServer;
								}
								adobjectId = server.ServerSite;
							}
							else if (!multiSiteConnector)
							{
								multiSiteConnector = !adobjectId.Equals(server.ServerSite);
							}
							if (!routingGroupId.Equals(server.HomeRoutingGroup))
							{
								bool flag2 = false;
								if (!flag)
								{
									flag2 = true;
								}
								else if (server.HomeRoutingGroup != null)
								{
									flag2 = true;
								}
								else if (!server.IsExchange2007OrLater)
								{
									flag2 = true;
								}
								if (flag2)
								{
									return sourceValidation ? new SendConnectorWrongSourceServerRgException(adobjectId2.Name) : new SendConnectorWrongTargetServerRgException(adobjectId2.Name);
								}
							}
							if (flag)
							{
								if ((!server.IsEdgeServer || !allowEdgeServers) && !server.IsHubTransportServer)
								{
									return sourceValidation ? new SendConnectorWrongSourceServerRoleException(adobjectId2.Name) : new SendConnectorWrongTargetServerRoleException(adobjectId2.Name);
								}
								if (edgeConnector != server.IsEdgeServer)
								{
									return new SendConnectorMixedSourceServerRolesException();
								}
							}
							multiValuedProperty.Add(adobjectId2);
						}
					}
				}
				if (multiValuedProperty.Count != 0)
				{
					if (multiValuedProperty.Count != connector.SourceTransportServers.Count)
					{
						connector.SourceTransportServers = multiValuedProperty;
						if (task != null)
						{
							task.WriteWarning(Strings.WarningSourceServersSkipped(string.Join(", ", list)));
						}
					}
					return null;
				}
				if (!sourceValidation)
				{
					return new SendConnectorValidTargetServerNotFoundException();
				}
				return new SendConnectorValidSourceServerNotFoundException();
			}
			if (!sourceValidation)
			{
				return new SendConnectorTargetServersNotSetException();
			}
			return new SendConnectorSourceServersNotSetException();
		}