protected bool ReceiveRemoteData(string contextname, IProcessor processor, string data) { bool result = false; if (!contextname.Equals("")) { IRemoteSystem[] rss = CLocalSystem.GetRemoteSystems(); if (rss != null) { foreach (IRemoteSystem rs in rss) { if (rs.SystemContext.IsInit && rs.SystemContext.Name.Equals(contextname)) { result = true; if (OnReceiveData != null) { if (CLocalSystem.MainForm != null) { MethodInvoker form_invoker = delegate { OnReceiveData(rs.SystemContext, processor, data); }; CLocalSystem.MainForm.Invoke(form_invoker); } else { OnReceiveData(rs.SystemContext, processor, data); } } } } } if (result) { if (OnReceiveData != null) { if (CLocalSystem.MainForm != null) { MethodInvoker form_invoker = delegate { OnReceiveData(CLocalSystem.LocalSystemContext, processor, data); }; CLocalSystem.MainForm.Invoke(form_invoker); } else { OnReceiveData(CLocalSystem.LocalSystemContext, processor, data); } } } } return(result); }
protected void ReceiveRemoteConfigData(string contextname, IProcessor processor, string data) { IRemoteSystem[] rss = CLocalSystem.GetRemoteSystems(); if (rss != null) { foreach (IRemoteSystem rs in rss) { if (rs != null && rs.SystemContext.IsInit && rs.SystemContext.Name.Equals(contextname)) { if (processor.Host.Equals(rs.Config.IP) && processor.Port == rs.Config.Port) { CRemoteConfigManager.ReceiveRemoteConfigData(rs.SystemContext, data, false); } } } } }