internal static void RegisterGrainService(GrainServiceConfigurations grainServicesConfig, string serviceName, string clientType, string serviceType, IDictionary <string, string> properties = null)
        {
            if (grainServicesConfig.GrainServices.ContainsKey(serviceName))
            {
                throw new InvalidOperationException(
                          string.Format("Grain service of with name '{0}' has been already registered", serviceName));
            }

            var config = new GrainServiceConfiguration(
                properties ?? new Dictionary <string, string>(),
                serviceName, clientType, serviceType);

            grainServicesConfig.GrainServices.Add(config.Name, config);
        }
        internal static GrainServiceConfigurations Load(XmlElement child)
        {
            var container = new GrainServiceConfigurations();

            var nsManager = new XmlNamespaceManager(new NameTable());

            nsManager.AddNamespace("orleans", "urn:orleans");

            GrainServiceConfiguration.LoadProviderConfigurations(
                child, nsManager, container.GrainServices,
                c => container.GrainServices.Add(c.Name, c));

            return(container);
        }