View TrialService
This file contains 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
class AzureTrialService : ITrialService | |
{ | |
private readonly IMobileServiceClient _service; | |
public AzureTrialService(IMobileServiceClient service) | |
{ | |
_service = service; | |
TrialPeriod = TimeSpan.FromDays(7); | |
} |
View WinRT Behavior
This file contains 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
// WinRT Implementation of the base Behavior classes | |
public abstract class Behavior<T> : Behavior where T : DependencyObject | |
{ | |
protected T AssociatedObject | |
{ | |
get { return base.AssociatedObject as T; } | |
} | |
protected override void OnAttached() | |
{ |
View gist:d497d938ec96a08f3bf0
This file contains 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.Threading.Tasks; | |
using Windows.ApplicationModel.Activation; | |
using Windows.ApplicationModel.Core; | |
using Windows.Storage; | |
using Windows.Storage.Pickers; | |
using Windows.Storage.Streams; | |
namespace Pinnacle.Pickers | |
{ |
View gist:2b2b529605f0b07aba55
This file contains 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 static string EncryptData(PublicKey key, string plainText) | |
{ | |
byte[] exponent = HexToBytes(key.Exponent); | |
byte[] modulus = HexToBytes(key.Modulus); | |
//**************** NEW ************************** | |
IAsymmetricKeyAlgorithmProvider provider = PCLCrypto.WinRTCrypto.AsymmetricKeyAlgorithmProvider.OpenAlgorithm(AsymmetricAlgorithm.RsaSignPssSha512); | |
byte[] keyBlob == null; // how to convert my PublicKey class? | |
ICryptographicKey cryptographicKey = provider.ImportKeyPair(keyBlob) |