This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get User Consent of current band | |
UserConsent uc = bandClient.SensorManager.HeartRate.GetCurrentUserConsent(); | |
bool isConsented = false; | |
if( uc == UserConsent.NotSpecified ) | |
{ | |
isConsented = await bandClient.SensorManager.HeartRate.RequestUserConsentAsync(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check if really consented and check if permissions are granted | |
if( isConsented || uc == UserConsent.Granted ) | |
{ | |
// provide new rate via event | |
bandClient.SensorManager.HeartRate.ReadingChanged += FireHeartRate; | |
// Start reading | |
return ( await andClient.SensorManager.HeartRate.StartReadingsAsync() ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Receives new heart rate and sets <see cref="HeartRate"/> | |
/// </summary> | |
private void OnHeartRate( object sender, EventArgs e ) | |
{ | |
MsBandHeartRateEventArgs args = e as MsBandHeartRateEventArgs; | |
if( args != null ) | |
{ | |
_uiFactory.StartNew( () => | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0"> | |
<edmx:DataServices> | |
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="ODataDemo"> | |
<EntityType Name="Product"> | |
<Key> | |
<PropertyRef Name="ID" /> | |
</Key> | |
<Property Name="ID" Type="Edm.Int32" Nullable="false" /> | |
<Property Name="Name" Type="Edm.String" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@odata.context":"http://services.odata.org/V4/OData/OData.svc/$metadata#Products", | |
"value":[ | |
{ | |
"ID":0, | |
"Name":"Bread", | |
"Description":"Whole grain bread", | |
"ReleaseDate":"1992-01-01T00:00:00Z", | |
"DiscontinuedDate":null, | |
"Rating":4, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@odata.context":"http://services.odata.org/V4/OData/OData.svc/$metadata#Products(ID,Name)", | |
"value":[ | |
{ | |
"ID":0, | |
"Name":"Bread" | |
}, | |
{ | |
"ID":1, | |
"Name":"Milk" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@odata.context":"http://services.odata.org/V4/OData/OData.svc/$metadata#Products(ID,Name,Price)", | |
"value":[ | |
{ | |
"ID":0, | |
"Name":"Bread", | |
"Price":2.5 | |
}, | |
{ | |
"ID":1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@odata.context":"http://services.odata.org/V4/OData/OData.svc/$metadata#Products/ODataDemo.FeaturedProduct/$entity", | |
"@odata.type":"#ODataDemo.FeaturedProduct", | |
"ID":9, | |
"Name":"Lemonade", | |
"Description":"Classic, refreshing lemonade (Single bottle)", | |
"ReleaseDate":"1970-01-01T00:00:00Z", | |
"DiscontinuedDate":null, | |
"Rating":7, | |
"Price":1.01 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Security.Cryptography; | |
using Newtonsoft.Json; | |
namespace ConsoleApp6 | |
{ | |
public class Program |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// QueueClient des NuGet Pakets WindowsAzure.ServiceBus | |
_queueClient = QueueClient.CreateFromConnectionString( connectionString, queueName ); | |
// Senden von Nachrichten | |
// Es empfiehlt sich hier die Serialisierung der Daten, bei Strings zb. als Json | |
_queueClient.Send( new BrokeredMessage( JsonConvert.SerializeObject( payload ) ) ); | |
// Nachrichten werden über Callbacks empfangen | |
// Der Einfachheit halber biete ich den QueueService Empfängern die Informationen als Event an | |
// Niemand muss dabei periodische die Queue anfragen, ob es neue Nachrichten gibt |