public void Unregister(IAgentEx SrvEx) { if (m_nNotifySinkID != -1) { SrvEx.Unregister(m_nNotifySinkID); } }
public void Initialize() { if (m_SrvEx != null) { return; //Already initialized } Thread.CurrentThread.SetApartmentState(ApartmentState.STA); try { AgentServer AgSrv = new AgentServer(); // The following cast does the QueryInterface to fetch IAgentEx interface from the IAgent interface, directly supported by the object m_SrvEx = (IAgentEx)AgSrv; m_Sink = new AgentNotifySink(); m_Sink.Register(m_SrvEx); } catch (Exception e) { AgentServerStartupException ex = new AgentServerStartupException("Agent Server could not be started", e); Console.WriteLine(ex); throw ex; } }
public void Register(IAgentEx SrvEx) { SrvEx.Register(this, out m_nNotifySinkID); }