예제 #1
0
        // Method to handle requests for the value of the IsUpperCaseEnabled property.
        public IAsyncOperation <SecureInterfaceGetIsUpperCaseEnabledResult> GetIsUpperCaseEnabledAsync(AllJoynMessageInfo info)
        {
            Task <SecureInterfaceGetIsUpperCaseEnabledResult> task = new Task <SecureInterfaceGetIsUpperCaseEnabledResult>(() =>
            {
                return(SecureInterfaceGetIsUpperCaseEnabledResult.CreateSuccessResult(AppData.IsUpperCaseEnabled));
            });

            task.Start();
            return(task.AsAsyncOperation());
        }
        private async void UpdateIsUpperCaseEnabledAsync()
        {
            SecureInterfaceGetIsUpperCaseEnabledResult getIsUpperCaseEnabledResult = await m_consumer.GetIsUpperCaseEnabledAsync();

            if (getIsUpperCaseEnabledResult.Status == AllJoynStatus.Ok)
            {
                m_callSetProperty  = false;
                IsUpperCaseEnabled = getIsUpperCaseEnabledResult.IsUpperCaseEnabled;
            }
            else
            {
                UpdateStatusAsync(string.Format("Get property failed with AllJoyn error: 0x{0:X}.", getIsUpperCaseEnabledResult.Status), NotifyType.ErrorMessage);
            }
        }