public void Dispose() { if (Service != null) { Service.Dispose(); Service = null; } }
public ProxyContagion() { if (GlobalAppConfig.RunningMode == 2) { Service = Function.UnitySection("unity.xml", "unityReport", "contagion").Resolve <ItfContagion>(); } else if (GlobalAppConfig.RunningMode == 3) { try { Service = WcfEndpoint.Fac <ItfContagion>().CreateChannel(WcfEndpoint.HisEndpointAddress(this.GetType().Name)); Service.Verify(); } catch { if (WcfEndpoint.AllowChange) { WcfEndpoint.ChangeServer(); Service = WcfEndpoint.Fac <ItfContagion>().CreateChannel(WcfEndpoint.HisEndpointAddress(this.GetType().Name)); } } } }