private IpcMessage GetHashMessage(object data, string hash, Type type = null)
 {
     type = type ?? data.GetType();
     if (!IpcMessage.Exists(hash, type, RootDirectory, out IpcMessage idMessage))
     {
         idMessage = IpcMessage.Create(hash, type, RootDirectory);
     }
     return(idMessage);
 }
Beispiel #2
0
        public void StartMessaging()
        {
            if (IpcMessage.Exists <TestMessage>(messageName))
            {
                IpcMessage.Delete(messageName, typeof(TestMessage));
            }

            IpcMessage msg = IpcMessage.Create <TestMessage>(messageName);

            Timer timer = new Timer((o) =>
            {
                TestMessage message = new TestMessage();
                message.Name        = "Name_".RandomLetters(4);
                message.IsMonkey    = RandomHelper.Bool();

                OutLineFormat("Setting data to:\r\n {0}", ConsoleColor.Cyan, message.PropertiesToString());
                msg.Write(message);
            }, null, 0, 1000);

            Pause();
        }