public static void AddInstanceContextMode(this ServiceHostBase host, InstanceContextMode mode) { ServiceHostData data = GetServiceHostData(host); if (data != null) { data.ServiceInstanceContextMode = mode; } }
public static void AddConcurrencyMode(this ServiceHostBase host, ConcurrencyMode mode) { ServiceHostData data = GetServiceHostData(host); if (data != null) { data.ServiceConcurrencyMode = mode; } }
public static void AddServiceType(this ServiceHostBase host, Type t) { ServiceHostData data = GetServiceHostData(host); if (data != null) { data.ServiceType = t; } }
public static ServiceHostData GetServiceHostData(this ServiceHostBase host) { ServiceHostData data = null; if (!serviceHostDataDictionary.TryGetValue(host.Description.Name, out data)) { data = new ServiceHostData(); serviceHostDataDictionary.TryAdd(host.Description.Name, data); } return(data); }
public static void SetBehaviors(this ServiceHostBase host) { ServiceHostData data = GetServiceHostData(host); if (data != null) { foreach (IServiceBehavior beh in host.Description.Behaviors) { data.ServiceBehaviors.Add(beh.ToString()); } } }
public static ConcurrencyMode GetConcurrencyMode(this ServiceHostBase host) { ServiceHostData data = GetServiceHostData(host); if (data != null) { return(data.ServiceConcurrencyMode); } else { Debug.WriteLine("Error, no data for this service"); } return(ConcurrencyMode.Single); }
public static Type GetServiceType(this ServiceHostBase host) { ServiceHostData data = GetServiceHostData(host); if (data != null) { return(data.ServiceType); } else { Debug.WriteLine("Error, no data for this service"); } return(null); }
public static IEnumerable <string> GetServiceBehaviors(this ServiceHostBase host) { ServiceHostData data = GetServiceHostData(host); if (data != null) { return(data.ServiceBehaviors); } else { Debug.WriteLine("Error, no data for this service"); } return(null); }
public static InstanceContextMode GetInstanceContextMode(this ServiceHostBase host) { ServiceHostData data = GetServiceHostData(host); if (data != null) { return(data.ServiceInstanceContextMode); } else { Debug.WriteLine("Error, no data for this service"); } return(InstanceContextMode.PerSession); }