Example #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());
 }
Example #2
0
        public GarageSensorConnector() : base()
        {
            ParticleCredentials creds = ParticleCredentials.LoadFromFile("Configuration/garage.private");

            SetCredentials(creds);
        }
Example #3
0
 /// <inheritdoc />
 public void SetCredentials(ParticleCredentials credentials)
 {
     _creds = credentials;
 }