Settings and activity
4 results found
-
41 votesKurt supported this idea ·
-
154 votesKurt supported this idea ·
-
198 votesKurt supported this idea ·
-
4 votes
An error occurred while saving the comment Kurt supported this idea ·
The way with the windows.winmd does not work.
I got the following message:
The type 'System.ComponentModel.EditorBrowsableAttribute' is available in both 'c: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ System.dll' and in 'c: \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework \. NETcore \ v4.5.1 \ System.Runtime.dll 'available.
It look like an conflict between this Assemblies.
My Script:
------------
<Query Kind="Statements">
<Reference><ProgramFilesX86>\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5.1\System.Core.dll</Reference>
<Reference><ProgramFilesX86>\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5.1\System.dll</Reference>
<Reference><ProgramFilesX86>\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5.1\System.Runtime.dll</Reference>
<Reference><ProgramFilesX86>\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5.1\System.Runtime.Extensions.dll</Reference>
<Reference><ProgramFilesX86>\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5.1\System.Runtime.InteropServices.dll</Reference>
<Reference><ProgramFilesX86>\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5.1\System.Runtime.InteropServices.WindowsRuntime.dll</Reference>
<Reference><ProgramFilesX86>\Windows Kits\8.1\References\CommonConfiguration\Neutral\Windows.winmd</Reference>
<Namespace>Windows.Devices.Sensors</Namespace>
</Query>
LightSensor light = LightSensor.GetDefault();
Windows.Devices.Sensors.
if (light != null)
{
uint minReportInterval = light.MinimumReportInterval;
uint reportInterval = minReportInterval > 16 ? minReportInterval : 16;
light.ReportInterval = reportInterval;
light.ReadingChanged += (s, a) =>
{
String.Format("There was light! {0}", a.Reading.IlluminanceInLux).Dump();
};
}