public bool TryGetAgentInformation(string agentId, out AgentInformation agentInfo) { if (string.IsNullOrEmpty(agentId)) { throw new ArgumentNullException("agentId"); } Lazy <LocalAgentInformation> local; Lazy <RemoteAgentInformation> remote; if (_localAgents.TryGetValue(agentId, out local)) { agentInfo = local.Value; return(true); } else if (_remoteAgents.TryGetValue(agentId, out remote)) { agentInfo = remote.Value; return(true); } else { agentInfo = null; return(false); } }
public SerializableAgentInformation(AgentInformation agentInfo) : base(agentInfo.PeerNode, agentInfo.AgentId, agentInfo.Contracts, agentInfo.IsInternal) { _isLocal = agentInfo.IsLocal; _isReachable = agentInfo.IsReachable; _displayData = agentInfo.DisplayData; _lastKnownState = agentInfo.LastKnownState; }