예제 #1
0
 /// <summary>
 /// This function handles the user-click on the menu item that
 /// deactivates the plugin for the active database
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnDeactivatePlugin(object sender, EventArgs e)
 {
     if (!ActiveDatabase.IsOpen || !IsPluginActive() || IsActiveDbDeltaDb())
     {
         return;
     }
     //we deactivate the plugin by untagging the database
     ActiveDatabase.SetCustomAttribute(KeeShare.AttributeFlags.IsKeeShareEnabled, false);
     m_keeShare.Unregister(ActiveDatabase.IOConnectionInfo);
     UpdateUI(ActiveDatabase.RootGroup, Changes.None, true);
 }
예제 #2
0
        /// <summary>
        /// This function deactivates the plugin on the actual database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnActivatePlugin(object sender, EventArgs e)
        {
            if (!ActiveDatabase.IsOpen || IsPluginActive() || IsActiveDbDeltaDb())
            {
                return;
            }
            //we activate the plugin by tagging the active db and initializing the managers
            ActiveDatabase.SetCustomAttribute(KeeShare.AttributeFlags.IsKeeShareEnabled, true);
            Changes changes = m_keeShare.Initialize(ActiveDatabase)
                              | m_keeShare.Register(ActiveDatabase, ActiveDatabase.IOConnectionInfo);

            UpdateUI(ActiveDatabase.RootGroup, changes, true);
        }