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(); }
public virtual bool Delete(object data, Type type = null) { try { if (data == null) { return(false); } type = type ?? data.GetType(); string idHash = GetIdHash(data, type); IpcMessage.Delete(idHash, type, RootDirectory); string uuidHash = GetUuidHash(data, type); IpcMessage.Delete(uuidHash, type, RootDirectory); DeleteObjectProperties(type, data); DeleteHash(data, type); return(true); } catch (Exception ex) { Message = ex.Message; OnDeleteFailed(); return(false); } }