Beispiel #1
0
 private void init()
 {
     /*
      * AppDomainSetup ads = new AppDomainSetup();
      * ads.ApplicationBase = enovaPath;
      * ads.PrivateBinPath = enovaPath;
      * ads.ShadowCopyFiles = "true";
      * ads.LoaderOptimization = LoaderOptimization.MultiDomainHost;
      *
      * //ads.DisallowBindingRedirects = false;
      * //ads.DisallowCodeDownload = true;
      * //ads.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
      * Evidence ev = new Evidence(AppDomain.CurrentDomain.Evidence);
      *
      * appDomain = AppDomain.CreateDomain("EnovaConnectorDomain", ev, ads);
      * connector = (Connector.EnovaConnector)appDomain.CreateInstanceFromAndUnwrap(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Enova.API.dll"), typeof(Connector.EnovaConnector).FullName);
      * if (connector != null)
      * {
      *  loaded = connector.Load(AppDomain.CurrentDomain.BaseDirectory);
      *  pingPong = new Timer();
      *  pingPong.Interval = 1000;
      *  pingPong.Elapsed += (o, e) => {
      *      if (connector != null)
      *          connector.PingPong();
      *  };
      *  pingPong.Enabled = true;
      *
      * }
      */
     connector = new Connector.EnovaConnector();
     loaded    = connector.Load(AppDomain.CurrentDomain.BaseDirectory, enovaPath);
 }
Beispiel #2
0
        private void Dispose(bool userCall)
        {
            if (!is_disposed)
            {
                is_disposed = true;
                if (userCall)
                {
                    //user call
                }

                /*
                 * if (appDomain != null)
                 * {
                 *  if (pingPong != null)
                 *      pingPong.Dispose();
                 *  pingPong = null;
                 *  if (connector != null)
                 *      connector.Finish();
                 *  connector = null;
                 *  AppDomain.Unload(appDomain);
                 *  appDomain = null;
                 *
                 * }
                 */
                if (connector != null)
                {
                    connector.Finish();
                    connector = null;
                }
                instance = null;
            }
        }
Beispiel #3
0
        private void Dispose(bool userCall)
        {
            if (!is_disposed)
            {
                is_disposed = true;
                if (userCall)
                {
                    //user call
                }

                if (appDomain != null)
                {
                    if (pingPong != null)
                    {
                        pingPong.Dispose();
                    }
                    pingPong = null;
                    if (connector != null)
                    {
                        connector.Finish();
                    }
                    connector = null;
                    AppDomain.Unload(appDomain);
                    appDomain = null;
                }
            }
        }
Beispiel #4
0
 public EnovaConnector()
 {
     EnovaConnector.Instance = this;
 }