public override ProblemCollection Check(ServiceModelConfigurationManager configurationManager) { foreach (ServiceElement service in configurationManager.ServiceModelSection.Services.Services) { List <string> keys = new List <string>(); foreach (ServiceEndpointElement endpoint in service.Endpoints) { if (keys.Contains(endpoint.Address.OriginalString)) { Resolution resolution = base.GetResolution(endpoint.Address.OriginalString); Problem problem = new Problem(resolution); base.Problems.Add(problem); continue; } keys.Add(endpoint.Address.OriginalString); } } return(base.Problems); }
/// <summary> /// Evaluates the contracts. /// </summary> /// <param name="configurationManager">The configuration manager.</param> /// <param name="module">The module.</param> /// <param name="contract">The contract.</param> public static void EvaluateContracts(ServiceModelConfigurationManager configurationManager, ModuleNode module, Contract contract) { if (configurationManager != null) { foreach (ServiceElement service in configurationManager.GetServices()) { foreach (ServiceEndpointElement endpoint in service.Endpoints) { TypeNode typeNode = LoadTypeNode(endpoint.Contract, module); if (typeNode != null) { contract(typeNode, endpoint); if (typeNode.DeclaringModule != module) { // unload external module, loaded in FileGetType() typeNode.DeclaringModule.Dispose(); } } } } } }
/// <summary> /// Initializes a new instance of the <see cref="T:ContractBindingRule"/> class. /// </summary> /// <param name="name">The name.</param> protected ContractBindingRule(string name) : base(name) { configurationManager = null; }
/// <summary> /// Checks the specified configuration manager. /// </summary> /// <param name="configurationManager">The configuration manager.</param> /// <returns></returns> public override ProblemCollection Check(ServiceModelConfigurationManager configurationManager) { //store the config manager for later use this.configurationManager = configurationManager; return(base.Problems); }
/// <summary> /// Checks the specified configuration manager. /// </summary> /// <param name="configurationManager">The configuration manager.</param> /// <returns></returns> public abstract ProblemCollection Check(ServiceModelConfigurationManager configurationManager);