Exemplo n.º 1
0
 static System()
 {
     _core = new Core();
     _core.Init();
     _mut = new Mutex(false);
     _rand = new MT19937(DateTime.Now.Ticks);
     _domains = new List<sDomain>();
     _appendEntry = new delAppendEntry(_AppendEntry);
 }
Exemplo n.º 2
0
 public void EstablishParent(Core parent)
 {
     _parent=parent;
     if (_myRoutes != null)
     {
         lock (_myRoutes)
         {
             foreach (sRoute srt in _myRoutes)
                 _parent._RegisterRoute(srt, this);
         }
     }
 }
Exemplo n.º 3
0
 internal void _UnRegisterRoute(sRoute route, Core core)
 {
     lock (_subRoutes)
     {
         List<Core> cores = new List<Core>();
         if (_subRoutes.ContainsKey(route))
         {
             cores = _subRoutes[route];
             _subRoutes.Remove(route);
         }
         cores.Remove(core);
         _subRoutes.Add(route, cores);
     }
     if (_parent != null)
         _parent._UnRegisterRoute(route, this);
 }
Exemplo n.º 4
0
 public sDomain(string name,string configFile)
 {
     if (configFile != null)
     {
         AppDomainSetup setup = AppDomain.CurrentDomain.SetupInformation;
         setup.ConfigurationFile = configFile;
         _domain = AppDomain.CreateDomain((name == null ? System._rand.NextString(32) : name), AppDomain.CurrentDomain.Evidence, setup);
     }else
         _domain = AppDomain.CreateDomain((name == null ? System._rand.NextString(32) : name));
     _domain.Load(typeof(System).Assembly.FullName);
     _core = (Core)_domain.CreateInstanceAndUnwrap(typeof(System).Assembly.FullName, typeof(Core).FullName);
     _processEvent = new delProcessEvent(_core.ProcessEvent);
 }