/// <summary> /// Clears the history values and removes from persistent storage. /// </summary> public void ClearHistory() { EnvironmentSessionProvider.ClearHistory(Target); foreach (EnvironmentVariable v in _vars) { v.ClearHistory(); } }
/// <summary> /// Loads history values of changed variables from persistent storage. /// </summary> public void LoadHistory() { Dictionary <string, IList <string> > history = EnvironmentSessionProvider.LoadHistory(Target); EnvironmentVariable x; if (history != null) { foreach (KeyValuePair <string, IList <string> > item in history) { x = Find(_vars, item.Key); if (x != null) { x.ApplyHistory(item.Value); } } } }
private void toolStripLoadSession_Click(object sender, EventArgs e) { EnvironmentSessionListForm dlgSessions = new EnvironmentSessionListForm(EnvironmentSessionProvider.LoadSessions()); if (dlgSessions.ShowDialog() == DialogResult.OK) { ActivateVarSet(dlgSessions.SelectedTarget); foreach (EnvironmentSessionItem item in dlgSessions.SelectedSession.Items) { EnvironmentVariable variable = _activeVars.GetVariable(item.Name); _session.Update(dlgSessions.SelectedTarget, item, variable); _activeVars.SetVariable(item.Name, item.Value); } RefreshVarSet(); } }
private void toolStripSaveSession_Click(object sender, EventArgs e) { EnvironmentSessionSaveForm dlgSave = new EnvironmentSessionSaveForm(_session); if (dlgSave.ShowDialog() == DialogResult.OK) { EnvironmentSession sessionToStore = dlgSave.Session; EnvironmentSessionProvider.SaveSession(sessionToStore.Name, sessionToStore); // remove all stored items from current session, if requested: if (dlgSave.ClearCurrentSession) { foreach (EnvironmentSessionItem item in sessionToStore.Items) { _session.Remove(item.Name); } } } }
/// <summary> /// Saves current history values into persistent storage. /// </summary> public void SaveHistory() { EnvironmentSessionProvider.SaveHistory(Target, _vars); }