本文整理汇总了C#中AllJoynMessageInfo类的典型用法代码示例。如果您正苦于以下问题:C# AllJoynMessageInfo类的具体用法?C# AllJoynMessageInfo怎么用?C# AllJoynMessageInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AllJoynMessageInfo类属于命名空间,在下文中一共展示了AllJoynMessageInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLastUploadTimeAsync
public IAsyncOperation<SecuritySystemGetLastUploadTimeResult> GetLastUploadTimeAsync(AllJoynMessageInfo info)
{
return Task.Run(() =>
{
return SecuritySystemGetLastUploadTimeResult.CreateSuccessResult(this.storage.LastUploadTime.ToString());
}).AsAsyncOperation();
}
示例2: GetVersionAsync
public IAsyncOperation<SecuritySystemGetVersionResult> GetVersionAsync(AllJoynMessageInfo info)
{
return Task.Run(() =>
{
return SecuritySystemGetVersionResult.CreateSuccessResult(Package.Current.Id.Version.Major);
}).AsAsyncOperation();
}
示例3:
IAsyncOperation<LampClearLampFaultResult> ILampService.ClearLampFaultAsync(AllJoynMessageInfo info, string lampID, uint lampFault)
{
var light = LightingClientService.GetLightById(lampID);
if (light == null)
return Task.FromResult(LampClearLampFaultResult.CreateFailureResult(16)).AsAsyncOperation();
return light.ClearLampFaultAsync(lampFault).AsAsyncOperation();
}
示例4: GetDoorStateAsync
public IAsyncOperation<GarageDoorGetDoorStateResult> GetDoorStateAsync(AllJoynMessageInfo info)
{
Task<GarageDoorGetDoorStateResult> task = new Task<GarageDoorGetDoorStateResult>(() =>
{
var newState = new GarageDoorDoorState();
var status = _driver.GetCurrentStatus();
newState.Value1 = Convert.ToByte(status);
switch(status)
{
case DoorStatus.Closed:
newState.Value2 = "Closed";
break;
case DoorStatus.Opened:
newState.Value2 = "Opened";
break;
case DoorStatus.Closing:
newState.Value2 = "Closing";
break;
case DoorStatus.Opening:
newState.Value2 = "Opening";
break;
default:
newState.Value2 = "Unknown";
break;
}
return GarageDoorGetDoorStateResult.CreateSuccessResult(newState);
});
task.Start();
return task.AsAsyncOperation();
}
示例5: TriggerCaptureAsync
public IAsyncOperation<SecuritySystemTriggerCaptureResult> TriggerCaptureAsync(AllJoynMessageInfo info)
{
return Task.Run(async () =>
{
await this.camera.TriggerCapture();
return SecuritySystemTriggerCaptureResult.CreateSuccessResult();
}).AsAsyncOperation();
}
示例6: GetRedLedStateAsync
public IAsyncOperation<FezHatGetRedLedStateResult> GetRedLedStateAsync(AllJoynMessageInfo info)
{
return (
Task.Run(() =>
{
return FezHatGetRedLedStateResult.CreateSuccessResult(_redLedState);
}).AsAsyncOperation());
}
示例7: GetPowerAsync
public IAsyncOperation<InternetRadioGetPowerResult> GetPowerAsync(AllJoynMessageInfo info)
{
return Task.Run(() =>
{
StartupTask.WriteTelemetryEvent("Action_AllJoyn");
return InternetRadioGetPowerResult.CreateSuccessResult(PowerState.Powered == this.powerManager.PowerState);
}).AsAsyncOperation();
}
示例8: GetVolumeAsync
public IAsyncOperation<InternetRadioGetVolumeResult> GetVolumeAsync(AllJoynMessageInfo info)
{
return Task.Run(() =>
{
TelemetryManager.WriteTelemetryEvent("Action_AllJoyn");
return InternetRadioGetVolumeResult.CreateSuccessResult(this.playbackManager.Volume);
}).AsAsyncOperation();
}
示例9: GetLocationAsync
public IAsyncOperation<GarageDoorGetLocationResult> GetLocationAsync(AllJoynMessageInfo info)
{
Task<GarageDoorGetLocationResult> task = new Task<GarageDoorGetLocationResult>(() =>
{
return GarageDoorGetLocationResult.CreateSuccessResult(_location);
});
task.Start();
return task.AsAsyncOperation();
}
示例10: GetCurrentlyPlayingAsync
public IAsyncOperation<InternetRadioGetCurrentlyPlayingResult> GetCurrentlyPlayingAsync(AllJoynMessageInfo info)
{
return Task.Run(() =>
{
StartupTask.WriteTelemetryEvent("Action_AllJoyn");
return InternetRadioGetCurrentlyPlayingResult.CreateSuccessResult(
(null != this.playlistManager.CurrentTrack) ? this.playlistManager.CurrentTrack.Name : string.Empty);
}).AsAsyncOperation();
}
示例11:
// Method to handle calls to the GetScanInfo method.
IAsyncOperation<OnboardingGetScanInfoResult> IOnboardingService.GetScanInfoAsync(AllJoynMessageInfo info)
{
Task<OnboardingGetScanInfoResult> task = new Task<OnboardingGetScanInfoResult>(() =>
{
return OnboardingGetScanInfoResult.CreateSuccessResult(1, AppData.SampleNetworkScanList);
});
task.Start();
return task.AsAsyncOperation();
}
示例12: StopToastingAsync
// Implement this function to handle calls to the stopToasting method.
public IAsyncOperation<toasterStopToastingResult> StopToastingAsync(AllJoynMessageInfo info)
{
Task<toasterStopToastingResult> task = new Task<toasterStopToastingResult>(() =>
{
return toasterStopToastingResult.CreateSuccessResult();
});
task.Start();
return task.AsAsyncOperation();
}
示例13: GetDarknessAsync
// Implement this function to handle requests for the value of the Darkness property.
//
// Currently, info will always be null, because no information is available about the requestor.
public IAsyncOperation<toasterGetDarknessResult> GetDarknessAsync(AllJoynMessageInfo info)
{
Task<toasterGetDarknessResult> task = new Task<toasterGetDarknessResult>(() =>
{
return toasterGetDarknessResult.CreateSuccessResult(darkness);
});
task.Start();
return task.AsAsyncOperation();
}
示例14: GetStateAsync
public IAsyncOperation<relaynodeGetStateResult> GetStateAsync(AllJoynMessageInfo info, int interfaceMemberRelayId)
{
Task<relaynodeGetStateResult> task = new Task<relaynodeGetStateResult>(() =>
{
return relaynodeGetStateResult.CreateSuccessResult((byte)(_hm.GetRelayState(interfaceMemberRelayId ) ? 1 : 0));
});
task.Start();
return task.AsAsyncOperation();
}
示例15: SetLocationAsync
public IAsyncOperation<CurrentTemperatureSetLocationResult> SetLocationAsync(AllJoynMessageInfo info, string value)
{
Task<CurrentTemperatureSetLocationResult> task = new Task<CurrentTemperatureSetLocationResult>(() =>
{
_location = value;
return CurrentTemperatureSetLocationResult.CreateSuccessResult();
});
task.Start();
return task.AsAsyncOperation();
}