Exemplo n.º 1
0
        /// <summary>
        /// Clears the history values and removes from persistent storage.
        /// </summary>
        public void ClearHistory()
        {
            EnvironmentSessionProvider.ClearHistory(Target);

            foreach (EnvironmentVariable v in _vars)
            {
                v.ClearHistory();
            }
        }
Exemplo n.º 2
0
        /// <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);
                    }
                }
            }
        }
Exemplo n.º 3
0
        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();
            }
        }
Exemplo n.º 4
0
        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);
                    }
                }
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Saves current history values into persistent storage.
 /// </summary>
 public void SaveHistory()
 {
     EnvironmentSessionProvider.SaveHistory(Target, _vars);
 }