public static void UnRegisterReceiver(NewInformationDelegate p_rReceiver, eInformationType p_eInformationType) { NewInformationDelegate Delegate; if (!m_lReceivers.TryGetValue(p_eInformationType, out Delegate)) { Delegate -= p_rReceiver; m_lReceivers.Remove(p_eInformationType); m_lReceivers.Add(p_eInformationType, Delegate); } }
public static void SendInformation(string p_sInformation, eInformationType p_eInformationType) { try { NewInformationDelegate Delegate; if (m_lReceivers.TryGetValue(p_eInformationType, out Delegate)) { Delegate(p_sInformation, p_eInformationType); } } catch (Exception){} }
public static void RegisterReceiver(NewInformationDelegate p_rReceiver, eInformationType p_eInformationType) { NewInformationDelegate Delegate; if (!m_lReceivers.TryGetValue(p_eInformationType, out Delegate)) { Delegate += new NewInformationDelegate(p_rReceiver); m_lReceivers.Add(p_eInformationType, Delegate); } else { Delegate += new NewInformationDelegate(p_rReceiver); m_lReceivers.Remove(p_eInformationType); m_lReceivers.Add(p_eInformationType, Delegate); } }
public static void UnRegisterReceiver(IInformationReciver p_rReceiver, eInformationType p_eInformationType) { UnRegisterReceiver(p_rReceiver.NewInformation, p_eInformationType); }