Esempio n. 1
0
        private void HandleRequest(string data)
        {
            ARWObject newObj       = ARWObject.Extract(data);
            ARWEvent  currentEvent = ARWEvents.allEvents.Where(a => a.eventName == newObj.GetRequestName()).FirstOrDefault();

            if (currentEvent != null)
            {
                if (currentEvent.p_handler != null)
                {
                    currentEvent.p_handler(this, newObj);
                }
                else
                {
                    if (currentEvent.handler != null)
                    {
                        currentEvent.handler(newObj);
                    }
                }
            }
            else
            {
                wrongData += data;

                if (ARWObject.CanBeARWObject(wrongData))
                {
                    wrongData += data;
                    HandleRequest(wrongData);
                    wrongData = "";
                    return;
                }
            }
        }
Esempio n. 2
0
        public static bool CanBeARWObject(string data)
        {
            ARWObject newObj       = ARWObject.Extract(data);
            ARWEvent  currentEvent = ARWEvents.allEvents.Where(a => a.eventName == newObj.GetRequestName()).FirstOrDefault();

            if (currentEvent == null)
            {
                return(false);
            }

            return(true);
        }