Esempio n. 1
0
        static string MethodA(string payload, out MethodStatusType status)
        {
            Console.WriteLine();
            Console.WriteLine("MethodA()");
            Console.WriteLine("\t{0}", payload);
            Console.WriteLine();

            status = MethodStatusType.Success;
            return(string.Empty);
        }
Esempio n. 2
0
        internal void OnMethodCalled(Method method)
        {
            if (this.deviceMethods.ContainsKey(method.Name))
            {
                /* codes_SRS_DEVICECLIENT_10_011: [** The OnMethodCalled shall invoke the specified delegate. ]*/
                MethodStatusType status = MethodStatusType.NotImplemented;
                method.Result = this.deviceMethods[method.Name](method.Payload, out status);
                method.Status = status;
            }
            else
            {
                /* codes_SRS_DEVICECLIENT_10_012: [ If the given method does not have a delegate, the respose shall be set to Unsupported. ]*/
                method.Result = null;
                method.Status = MethodStatusType.NotSupported;
            }

            // ArgumentNullException is percolated to the caller.
        }