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