Esempio n. 1
0
 /// <summary>
 /// Sets the configuration object for given action.
 /// </summary>
 private static void UpdateActionConfig(IPackageConfigUpdater cu, Type actionType, PersistentStorageData config)
 {
     if (cu != null && config != null && actionType != null)
     {
         PersistentStorageHelper.Save(config);
         cu.UpdateConfiguration(actionType, config);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Destroy elements that belong to customizator's GUI.
        /// </summary>
        public void Destroy()
        {
            if (tytanToolbar != null)
            {
                // store the config option:
                config.Add(ShowTytanToolbarOption, (uint)(tytanToolbar.Visible ? 1 : 0));
                PersistentStorageHelper.Save(config);

                tytanToolbar.Visible = false;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Writes the current state of the control to a persistent storage area.
        /// </summary>
        public void StoreState()
        {
            if (treeView.SelectedNode != null)
            {
                PersistentStorageData data = new PersistentStorageData(ToolName);

                data.Add(Settings_Path, treeView.SelectedNode.FullPath);
                data.Add(Settings_Favorites, ExportFavorites());

                PersistentStorageHelper.Save(data);
            }
        }
Esempio n. 4
0
        public void SaveState()
        {
            string[] storedFilter = FilterMessages;

            if (storedFilter != null && storedFilter.Length > 0)
            {
                PersistentStorageData data = new PersistentStorageData(ToolName);

                data.Add("Filter", storedFilter);

                PersistentStorageHelper.Save(data);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Store inside the persistent storage, when the last update took place.
        /// </summary>
        private void StoreCheckState()
        {
            if (lastUpdateCheck == DateTime.MinValue)
            {
                return;
            }

            PersistentStorageData data = new PersistentStorageData(PersistantStorageName);

            data.Add("LastUpdateDate", lastUpdateCheck.ToShortDateString());

            // store:
            PersistentStorageHelper.Save(data);
        }
Esempio n. 6
0
        /// <summary>
        /// Performs the cleanup actions.
        /// </summary>
        public void Dispose()
        {
            // notify about the exit event:
            foreach (IPackageAction addIn in data)
            {
                PersistentStorageData config = addIn.Configuration;

                // write configuration if needed:
                if (config != null && config.IsDirty)
                {
                    PersistentStorageHelper.Save(config);
                }

                // and finally release resources:
                addIn.Destroy();
            }

            data.Clear();
        }