private async void GetToasterDarknessLevel() { ToasterGetDarknessLevelResult toasterGetDarknessLevelResult = await toasterConsumer.GetDarknessLevelAsync(); if (toasterGetDarknessLevelResult.Status == AllJoynStatus.Ok) { darknessLevel = toasterGetDarknessLevelResult.DarknessLevel; } }
public IAsyncOperation <ToasterGetDarknessLevelResult> GetDarknessLevelAsync(AllJoynMessageInfo info) { Task <ToasterGetDarknessLevelResult> task = new Task <ToasterGetDarknessLevelResult>(() => { return(ToasterGetDarknessLevelResult.CreateSuccessResult(darknessLevel)); }); task.Start(); return(task.AsAsyncOperation()); }