//using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Text; namespace Dist.SpringWebsocket { public class StompFrame { private StatusCodeEnum code; private string content; private Dictionary headers; public object callback; public StompFrame() { } public StompFrame(StatusCodeEnum code):this() { this.code = code; } public StompFrame(StatusCodeEnum code, string content) :this(code) { this.content = content; } public StompFrame(StatusCodeEnum code, string content, Dictionary headers) : this(code, content) { this.headers = headers; } public StompFrame(StatusCodeEnum code, string content, Dictionary headers, object callback) : this(code, content, headers) { this.callback = callback; } public void AddHeader(string key, string value) { if (this.headers == null) { this.headers = new Dictionary(); } this.headers.Add(key, value); } public string GetHeader(string key) { return this.headers[key]; } public bool ContainsHeader(string key) { return this.headers.ContainsKey(key); } public StatusCodeEnum Code { get { return code; } set { code = value; } } public string Content { get { return content; } set { content = value; } } public Dictionary Headers { get { return headers; } set { headers = value; } } } }