Exemple #1
0
 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);
 }
Exemple #2
0
        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);
        }