private void MoveNotStoredMessageToStoredMessageList(Message newComingMessage) { List <MessageId> removedList = new List <MessageId>(); foreach (var item in notStoredMessages) { MessageIds childMessageIds = item.Value.GetChildMessageIds(); if (childMessageIds.Contains(newComingMessage.MessageId)) { // move to stored message list item.Value.ProtocolLevel = newComingMessage.ProtocolLevel + 1; removedList.Add(item.Key); AddTopLevelMessageList(item.Value); storedMessages.Add(item.Key, item.Value); // move the message whose children contains the message MoveNotStoredMessageToStoredMessageList(item.Value); } } foreach (var messageId in removedList) { notStoredMessages.Remove(messageId); } }
public BDictionary Serialize() { var dict = new BDictionary(MessageIds.ToDictionary(x => new BString(x.Key), x => (IBObject) new BNumber(x.Value))); return(new BDictionary { ["m"] = dict, ["v"] = new BString(Client), }); }
public static byte[] ToBytes(string deviceId, MessageIds messageId, ushort seqNO, byte[] bodyBytesReturn) { HeadPack head = new HeadPack() { BodyProp = 0, MessageId = (ushort)messageId, SeqNO = seqNO }; head.SetDeviceId(deviceId); //BodyPropertyHelper.SetMessageLength(ref head.BodyProp,(ushort)bodyBytesReturn.Length); BodyPropertyHelper.SetMessageLength(ref head.BodyProp, (ushort)bodyBytesReturn.Length); return(RawFormatter.Instance.Struct2Bytes(head).Concat(bodyBytesReturn).ToArray()); }
/// <summary> /// Get child messages /// </summary> /// <returns>A collection of child messages</returns> public ICollection <Message> GetChildMessages() { MessageIds childMessageIds = monitor.GetChildMessages(messageId); if (childMessageIds != null) { ICollection <Message> messageList = new List <Message>(); foreach (MessageId childId in childMessageIds) { messageList.Add(new Message(childId, monitor)); } return(messageList); } return(null); }
private string GetMessageClass(MessageIds msg) { switch (msg) { case MessageIds.AddSuccess: case MessageIds.DeletionSuccess: case MessageIds.EditSuccess: return("alert alert-success alert-dismissible"); case MessageIds.AddFailure: case MessageIds.DeletionFailure: case MessageIds.EditFailure: return("alert alert-danger alert-dismissible"); default: return(""); } }
/// <summary> /// Save captured message into a file. /// </summary> /// <param name="filepath">File path to save captured messages</param> /// <param name="selectedOnly">Indicate save only selected messages or all messages</param> /// <returns></returns> public virtual bool SaveCapturedMessages(string filepath) { // Create and initialize a FileWriterCatalog FileWriterCatalog writerCatalog = new FileWriterCatalog(); writerCatalog.Initialize(monitor.Settings.ExtensionLoadPath); if (PersistUtils.IsPersistTypeSupported(writerCatalog, filepath)) { MessageIds capturedMessageids = CapturedMessageIds; // Save All messages if (capturedMessageids.Count > 0) { PersistUtils.Persist(captureJournal, writerCatalog, filepath, capturedMessageids); return(true); } } return(false); }
private string GetMessage(MessageIds msg) { switch (msg) { case MessageIds.AddFailure: return("Article failed to add!"); case MessageIds.AddSuccess: return("Article added successfuly!"); case MessageIds.DeletionFailure: return("Cannot delete article!"); case MessageIds.DeletionSuccess: return("Article deleted successfuly!"); case MessageIds.EditFailure: return("Article failed to edit!"); case MessageIds.EditSuccess: return("Article edited successfuly!"); default: return(""); } }
public Script GetScriptFromIdHelper(MessageIds id) { switch (id) { case MessageIds.GameLoopPreProcessCode: return(GameLoopPreProcessCode); case MessageIds.GameLoopPostProcessCode: return(GameLoopPostProcessCode); case MessageIds.InitialisationCode: return(InitialisationCode); case MessageIds.CommonCode: return(CommonCode); default: return(null); } }
public MessageAttribute(MessageIds messageId, bool encrypted = true) { MessageId = messageId; Encrypted = encrypted; }
public SPPMessage(MessageIds id, MsgType type, byte[] payload) { Id = id; Type = type; Payload = payload; }
public override string ToString() { var sb = new StringBuilder("MessageCommitResult("); bool __first = true; if (RequestId != null && __isset.requestId) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("RequestId: "); RequestId.ToString(sb); } if (__isset.state) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("State: "); State.ToString(sb); } if (MessageStoreRequestId != null && __isset.messageStoreRequestId) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("MessageStoreRequestId: "); MessageStoreRequestId.ToString(sb); } if (MessageIds != null && __isset.messageIds) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("MessageIds: "); MessageIds.ToString(sb); } if (__isset.receiverCount) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("ReceiverCount: "); ReceiverCount.ToString(sb); } if (__isset.successCount) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("SuccessCount: "); SuccessCount.ToString(sb); } if (__isset.failCount) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("FailCount: "); FailCount.ToString(sb); } if (__isset.blockCount) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("BlockCount: "); BlockCount.ToString(sb); } if (__isset.unregisteredCount) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("UnregisteredCount: "); UnregisteredCount.ToString(sb); } if (__isset.unrelatedCount) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("UnrelatedCount: "); UnrelatedCount.ToString(sb); } if (ErrorDescription != null && __isset.errorDescription) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("ErrorDescription: "); ErrorDescription.ToString(sb); } sb.Append(")"); return(sb.ToString()); }
public MessageHandlerAttribute(MessageIds messageId) { MessageId = messageId; }