Example #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="clientID"></param>
        /// <param name="requestNameEnum"></param>
        /// <param name="state"></param>
        public RequestResult ProcessRequest(string clientID, RequestNameEnum requestNameEnum, object state)
        {
            RequestResult r = null;

            switch (requestNameEnum)
            {
                case RequestNameEnum.GetDeviceID :
                    r = ProcessGetDeviceIDRequest(clientID, state);
                    break;

                case RequestNameEnum.GetDeviceLastDataDateTime :
                    r = ProcessGetDeviceLastDataDateTime(clientID, state);
                    break;

                case RequestNameEnum .SetWLData :
                    r = ProcessSetWLData(clientID, state);
                    break;
            }
            return r;
        }
Example #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="clientID"></param>
        /// <param name="requestName"></param>
        /// <param name="state"></param>
        public RequestResult Request(string clientID, RequestNameEnum requestName,
            object state)
        {
            if (RequestEvent != null)
            {
                RequestEventArgs e = new RequestEventArgs();
                e.ClientID = clientID;
                e.RequestNameEnum = requestName;
                e.State = state;

                RequestEvent(this, e);

                return e.RequestResult;
            }
            return null;
        }