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
<?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
/// <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
// 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
// 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
// Find all Bands | |
IBandInfo[ ] allBands = await BandClientManager.Instance.GetBandsAsync(); | |
if( !allBands.Any() ) | |
{ | |
throw new NoBandFoundException(); | |
} | |
// Use first Band | |
IBandInfo bandInfo = allBands.First(); |
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" standalone="yes" ?> | |
<MediaDatenbank> | |
<!-- Liste von Filmen --> | |
<Filme> | |
<Film Id="1" Jahr="1996"> | |
<Name>The Rock</Name> | |
<Land>USA</Land> | |
<FSK>16</FSK> | |
<Person IdRef="1" Typ="Hauptdarsteller" /> | |
<Person IdRef="2" Typ="Regisseur" /> |
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
<XMLRootName demo="SchwabenCode"> | |
<KindElement>Dies ist ein BeispielText</KindElement> | |
</XMLRootName> |
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
XDocument doc = new XDocument( | |
new XElement( "XMLRootName", | |
new XAttribute( "demo", "SchwabenCode" ), | |
new XElement( "KindElement", "Dies ist ein BeispielText" ))); |
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
XmlDocument xmlDoc = new XmlDocument( ); | |
XmlElement xmlRoot = xmlDoc.CreateElement( "XMLRootName" ); | |
root.SetAttribute( "demo", "SchwabenCode" ); | |
XmlElement child = xmlDoc.CreateElement( "KindElement" ); | |
child.InnerText = "Dies ist ein BeispielText"; | |
xmlRoot.AppendChild( child ); | |
xmlDoc.AppendChild( xmlRoot ); |