Esempio n. 1
0
 public void Dispose()
 {
     if (Service != null)
     {
         Service.Dispose();
         Service = null;
     }
 }
Esempio n. 2
0
 public ProxyEntityFactory()
 {
     if (GlobalAppConfig.RunningMode == 2)
     {
         Service = Function.UnitySection("unity.xml", "unityCommon", "entityfactory").Resolve <ItfEntityFactory>();
     }
     else if (GlobalAppConfig.RunningMode == 3)
     {
         try
         {
             Service = WcfEndpoint.Fac <ItfEntityFactory>().CreateChannel(WcfEndpoint.HisEndpointAddress(this.GetType().Name));
             Service.Verify();
         }
         catch
         {
             if (WcfEndpoint.AllowChange)
             {
                 WcfEndpoint.ChangeServer();
                 Service = WcfEndpoint.Fac <ItfEntityFactory>().CreateChannel(WcfEndpoint.HisEndpointAddress(this.GetType().Name));
             }
         }
     }
 }