Example #1
0
        public Dictionary <string, object> GetDictionary(string aKey)
        {
            Dictionary <string, object> lResult = null;

            try
            {
                lResult = JSONTokenProcessor.JSonObjectToDictionary((JsonObject)Get(aKey));
            }
            catch (Exception lEx)
            {
                throw new Exception(WebSocketMessage.NO_PARSED_VALUE + lEx.Message);
            }
            return(lResult);
        }
Example #2
0
        public IToken GetToken(string aKey)
        {
            IToken lResult = null;

            try
            {
                lResult = JSONTokenProcessor.JsonStringToToken(Get(aKey).ToString());
            }
            catch (Exception lEx)
            {
                throw new Exception(WebSocketMessage.NO_PARSED_VALUE + lEx.Message);
            }
            return(lResult);
        }
Example #3
0
        public List <object> GetList(string aKey)
        {
            List <object> lResult = null;

            try
            {
                lResult = JSONTokenProcessor.JSonArrayToList(JSONTokenProcessor.JsonStringToJsonArray(Get(aKey).ToString()));
            }
            catch (Exception lEx)
            {
                throw new Exception(WebSocketMessage.NO_PARSED_VALUE + lEx.Message);
            }
            return(lResult);
        }
Example #4
0
 public static IWebSocketPacket TokenToPacket(string aFormat, IToken aToken)
 {
     if (aFormat.Equals(WebSocketConstants.WS_FORMAT_JSON))
     {
         return(JSONTokenProcessor.TokenToPacket(aToken));
     }
     else if (aFormat.Equals(WebSocketConstants.WS_SUBPROT_CSV))
     {
         throw new NotImplementedException(WebSocketMessage.NOT_IMPLEMENTED_YET);
     }
     else if (aFormat.Equals(WebSocketConstants.WS_FORMAT_XML))
     {
         throw new NotImplementedException(WebSocketMessage.NOT_IMPLEMENTED_YET);
     }
     return(null);
 }
 public IWebSocketPacket TokenToPacket(IToken aToken)
 {
     if (mNegotiatedSubProtocol.SubProtocol.Equals(WebSocketConstants.WS_SUBPROT_JSON))
     {
         return(JSONTokenProcessor.TokenToPacket(aToken));
     }
     else if (mNegotiatedSubProtocol.Equals(WebSocketConstants.WS_SUBPROT_CSV))
     {
         throw new NotImplementedException(WebSocketMessage.NOT_IMPLEMENTED_YET);
     }
     else if (mNegotiatedSubProtocol.Equals(WebSocketConstants.WS_FORMAT_XML))
     {
         throw new NotImplementedException(WebSocketMessage.NOT_IMPLEMENTED_YET);
     }
     return(null);
 }
 private IToken PacketToToken(IWebSocketPacket aDataPacket)
 {
     return(JSONTokenProcessor.PacketToToken(aDataPacket));
 }