public Connections(CacheCredentials credentials, ICredentialsPersistence credentialsPersistence) { _storedCredentials = credentials; _credentials = credentials.Copy(); //copy the object so we don't affect the main copy _credentialsPersistence = credentialsPersistence; InitializeComponent(); }
private void btnSave_Click(object sender, EventArgs e) { _storedCredentials = _credentials; //save the working credentials over the top of the stored ones _credentialsPersistence.Save(_credentials); this.Close(); }
public void Load() { _credentials = _peristence.Load(); if (string.IsNullOrWhiteSpace(_credentials.CacheName)) { _credentials.CacheName = "default"; } }