Ejemplo n.º 1
0
 public static ParticleCredentials LoadFromFile(string file)
 {
     if (File.Exists(file))
     {
         string contents           = File.ReadAllText(file);
         ParticleCredentials creds = JsonConvert.DeserializeObject <ParticleCredentials>(contents);
         return(creds);
     }
     return(new ParticleCredentials());
 }
Ejemplo n.º 2
0
        public GarageSensorConnector() : base()
        {
            ParticleCredentials creds = ParticleCredentials.LoadFromFile("Configuration/garage.private");

            SetCredentials(creds);
        }
Ejemplo n.º 3
0
 /// <inheritdoc />
 public void SetCredentials(ParticleCredentials credentials)
 {
     _creds = credentials;
 }