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
| private void Update() | |
| { | |
| if (string.IsNullOrEmpty(Text) || string.IsNullOrEmpty(HighlightedText)) | |
| { | |
| TB.Inlines.Clear(); | |
| return; | |
| } | |
| TB.Inlines.Clear(); | |
| var parts = Regex.Split(Text, HighlightedText, RegexOptions.IgnoreCase); |
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
| private string GetGoogleSuccessCode(string data) | |
| { | |
| if (string.IsNullOrEmpty(data)) return null; | |
| var parts = data.Split('='); | |
| for (int i = 0; i < parts.Length; ++i) | |
| { | |
| if (parts[i] == "Success code") | |
| { | |
| return parts[i + 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
| /// <summary> | |
| /// Custom DateTime JSON serializer/deserializer | |
| /// </summary> | |
| public class CustomDateTimeConverter : DateTimeConverterBase | |
| { | |
| /// <summary> | |
| /// DateTime format | |
| /// </summary> | |
| private const string Format = "dd. MM. yyyy HH:mm"; |
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
| <Page.Resoruces> | |
| <ResourceDictionary> | |
| <ResourceDictionary.MergedDictionaries> | |
| <ResourceDictionary Source="ms-appx:///Resources/PlayerFramework.xaml" /> | |
| </ResourceDictionary.MergedDictionaries> | |
| </ResourceDictionary> | |
| </Page.Resoruces> |
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
| MediaPlayer.ResourceLoader = ResourceLoader.GetForCurrentView("PlayerFramework"); //using PlayerFramework.resw in the project |
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> | |
| /// Gets stream data from the server. Uses ETag to cache data locally | |
| /// </summary> | |
| /// <param name="url">Url to get data from</param> | |
| /// <returns>Stream data</returns> | |
| [NotNull] | |
| private async Task<Stream> GetData([NotNull] string url) | |
| { | |
| var client = new HttpClient(); |
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> | |
| /// Gets response with ETag. Returns empty body if ETag matches (no data changes) | |
| /// </summary> | |
| /// <param name="data">Data to match with ETag</param> | |
| /// <param name="model">Model to return</param> | |
| /// <returns>Response</returns> | |
| protected Response GetResponseWithEtag(object data, object model) | |
| { | |
| string etag = Utils.ComputeHash(data); |
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.Net.Http; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace AlzaMedia.Code.PlayReady | |
| { | |
| public static class Extensions |
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
| cat /sys/bus/w1/devices/28-000004e23e98 |
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
| Window.Current.CoreWindow.KeyUp += (_, args) => | |
| { | |
| if (args.VirtualKey == VirtualKey.Back) | |
| { | |
| var element = FocusManager.GetFocusedElement(); | |
| if (element is TextBox || element is PasswordBox) | |
| { | |
| return; //do not disturb user when typing | |
| } | |