private void Dispose(bool fDisposing) { try { ManagerRemote mgr = m_mgr; m_mgr = null; if (mgr != null) { /* * Not sure if we care about supporting this case, but this check allows us to * support registering for events, releasing all references to this object, but * still makes sure that the ManagerRemote object does not get disconnected * and will still notify device events */ if (m_insertion == null && m_removal == null) { mgr.Unregister(this); UnregisterRemoteObject(); } } } catch { } }
//--// public Gateway( ManagerRemote mgrRemote, _DBG.PortDefinition pd ) { m_mgrRemote = mgrRemote; m_portDefinition = pd; m_ctrl = new _WP.Controller( _WP.Packet.MARKER_PACKET_V1, this ); m_stubs = ArrayList.Synchronized( new ArrayList() ); m_endpoints = Hashtable.Synchronized( new Hashtable() ); }
//--// public Gateway(ManagerRemote mgrRemote, _DBG.PortDefinition pd) { m_mgrRemote = mgrRemote; m_portDefinition = pd; m_ctrl = new _WP.Controller(_WP.Packet.MARKER_PACKET_V1, this); m_stubs = ArrayList.Synchronized(new ArrayList()); m_endpoints = Hashtable.Synchronized(new Hashtable()); }
void _WP.IController.Stop() { m_stubs.Clear(); m_ctrl.Stop(); if (m_mgrRemote != null) { m_mgrRemote.Disconnect(this); m_mgrRemote = null; } }
static public void InitializeLog() { const string LogFileName = @"%TEMP%\SPOT_connection_manager.txt"; StreamWriter outputWriter = File.AppendText(Environment.ExpandEnvironmentVariables(LogFileName)); _Trace.Listeners.Add(new TextWriterTraceListener(outputWriter)); _Trace.WriteLine(""); _Trace.WriteLine(""); ManagerRemote.LogLine("InitializeLog"); }
private void StopEvents() { ManagerRemote.LogLine("StopEvents"); if (m_usbDiscovery != null) { m_usbDiscovery.Dispose(); m_usbDiscovery = null; } if (m_emulatorDiscovery != null) { m_emulatorDiscovery.Dispose(); m_emulatorDiscovery = null; } }
private void StartEvents() { ManagerRemote.LogLine("StartEvents"); if (m_usbDiscovery == null) { m_usbDiscovery = new _DBG.UsbDeviceDiscovery(); m_usbDiscovery.OnDeviceChanged += new _DBG.UsbDeviceDiscovery.DeviceChangedEventHandler(OnDeviceChanged); } if (m_emulatorDiscovery == null) { m_emulatorDiscovery = new _DBG.EmulatorDiscovery(); m_emulatorDiscovery.OnEmulatorChanged += new _DBG.EmulatorDiscovery.EmulatorChangedEventHandler(OnEmulatorChanged); } }
//--// void Purge(object state) { ManagerRemote.LogLine("Purge GatewayStub"); DateTime threshold = DateTime.Now.AddMinutes(-(double)state); lock (m_requests.SyncRoot) { foreach (object key in new ArrayList(m_requests.Keys)) { if ((DateTime)m_requests[key] < threshold) { m_requests.Remove(key); } } } }
private bool Initialize(ManagerFactory factory) { ManagerRemote mgr = null; try { mgr = factory.ManagerRemote; mgr.Register(this); RegisterRemoteObject(mgr); } catch { return(false); } m_mgr = mgr; return(true); }
void _WP.IController.Stop() { m_stubs.Clear(); m_ctrl.Stop(); if(m_mgrRemote != null) { m_mgrRemote.Disconnect( this ); m_mgrRemote = null; } }
private void Dispose(bool fDisposing) { try { ManagerRemote mgr = m_mgr; m_mgr = null; if(mgr != null) { /* * Not sure if we care about supporting this case, but this check allows us to * support registering for events, releasing all references to this object, but * still makes sure that the ManagerRemote object does not get disconnected * and will still notify device events */ if(m_insertion == null && m_removal == null) { mgr.Unregister( this ); UnregisterRemoteObject(); } } } catch { } }
private bool Initialize( ManagerFactory factory ) { ManagerRemote mgr = null; try { mgr = factory.ManagerRemote; mgr.Register( this ); RegisterRemoteObject( mgr ); } catch { return false; } m_mgr = mgr; return true; }
//--// public ManagerRemote() { ManagerRemote.LogLine("New ManagerRemote"); TrackingServices.RegisterTrackingHandler(this); }