public void AddNewMessage(string iProcessName, ContextMessage iMessage) { if (!this.myContextClient.deserialisedContextContents.Messages.ContainsKey(iProcessName)) { this.myContextClient.deserialisedContextContents.Messages[iProcessName] = new List <ContextMessage>(); } this.myContextClient.deserialisedContextContents.Messages[iProcessName].Add(iMessage); }
public bool GetNextMessage(string iProcessName, ref ContextMessage oContextMessage) { if (!this.myContextClient.deserialisedContextContents.Messages.ContainsKey(iProcessName)) { // Process has never interacted with SharedContext this.myContextClient.deserialisedContextContents.Messages[iProcessName] = new List <ContextMessage>(); } if (this.myContextClient.deserialisedContextContents.Messages[iProcessName].Count == 0) { return(false); } oContextMessage = this.myContextClient.deserialisedContextContents.Messages[iProcessName].First <ContextMessage>(); this.myContextClient.deserialisedContextContents.Messages[iProcessName].RemoveAt(0); return(true); }