示例#1
0
        private void ChangePathsRelAbs(bool bMakeAbsolute)
        {
            AceApplication aceApp = this.Application;       // m_aceApp might be null
            AceDefaults    aceDef = this.Defaults;          // m_def might be null

            ChangePathRelAbs(aceApp.LastUsedFile, bMakeAbsolute);

            foreach (IOConnectionInfo iocMru in aceApp.MostRecentlyUsed.Items)
            {
                ChangePathRelAbs(iocMru, bMakeAbsolute);
            }

            List <string> lWDKeys = aceApp.GetWorkingDirectoryContexts();

            foreach (string strWDKey in lWDKeys)
            {
                aceApp.SetWorkingDirectory(strWDKey, ChangePathRelAbsStr(
                                               aceApp.GetWorkingDirectory(strWDKey), bMakeAbsolute));
            }

            foreach (AceKeyAssoc kfp in aceDef.KeySources)
            {
                kfp.DatabasePath = ChangePathRelAbsStr(kfp.DatabasePath, bMakeAbsolute);
                kfp.KeyFilePath  = ChangePathRelAbsStr(kfp.KeyFilePath, bMakeAbsolute);
            }
        }
示例#2
0
        internal void OnLoad()
        {
            AceMainWindow aceMainWindow = this.MainWindow;  // m_uiMainWindow might be null
            AceDefaults   aceDef        = this.Defaults;    // m_def might be null

            // aceInt.UrlSchemeOverrides.SetDefaultsIfEmpty();

            ObfuscateCred(false);
            ChangePathsRelAbs(true);

            // Remove invalid columns
            List <AceColumn> vColumns = aceMainWindow.EntryListColumns;
            int i = 0;

            while (i < vColumns.Count)
            {
                if (((int)vColumns[i].Type < 0) || ((int)vColumns[i].Type >=
                                                    (int)AceColumnType.Count))
                {
                    vColumns.RemoveAt(i);
                }
                else
                {
                    ++i;
                }
            }

            SearchUtil.FinishDeserialize(aceDef.SearchParameters);
            DpiScale();

            if (NativeLib.IsUnix())
            {
                this.Security.MasterKeyOnSecureDesktop = false;

                AceIntegration aceInt = this.Integration;
                aceInt.HotKeyGlobalAutoType   = (ulong)Keys.None;
                aceInt.HotKeySelectedAutoType = (ulong)Keys.None;
                aceInt.HotKeyShowWindow       = (ulong)Keys.None;
            }

            if (MonoWorkarounds.IsRequired(1378))
            {
                AceWorkspaceLocking aceWL = this.Security.WorkspaceLocking;
                aceWL.LockOnSessionSwitch       = false;
                aceWL.LockOnSuspend             = false;
                aceWL.LockOnRemoteControlChange = false;
            }

            if (MonoWorkarounds.IsRequired(1418))
            {
                aceMainWindow.MinimizeAfterOpeningDatabase = false;
                this.Application.Start.MinimizedAndLocked  = false;
            }
        }
示例#3
0
        /// <summary>
        /// Prepare for saving the configuration to disk. None of the
        /// modifications in this method need to be rolled back
        /// (for rollback, use <c>OnSavePre</c> / <c>OnSavePost</c>).
        /// </summary>
        private void PrepareSave()
        {
            AceMeta        aceMeta   = this.Meta;        // m_meta might be null
            AceApplication aceApp    = this.Application; // m_aceApp might be null
            AceSearch      aceSearch = this.Search;      // m_aceSearch might be null
            AceDefaults    aceDef    = this.Defaults;    // m_def might be null

            aceMeta.OmitItemsWithDefaultValues = true;
            aceMeta.DpiFactorX = DpiUtil.FactorX;             // For new (not loaded) cfgs.
            aceMeta.DpiFactorY = DpiUtil.FactorY;

            aceApp.LastUsedFile.ClearCredentials(true);

            foreach (IOConnectionInfo iocMru in aceApp.MostRecentlyUsed.Items)
            {
                iocMru.ClearCredentials(true);
            }

            if (aceDef.RememberKeySources == false)
            {
                aceDef.KeySources.Clear();
            }

            aceApp.TriggerSystem = Program.TriggerSystem;

            SearchUtil.PrepareForSerialize(aceSearch.LastUsedProfile);
            foreach (SearchParameters sp in aceSearch.UserProfiles)
            {
                SearchUtil.PrepareForSerialize(sp);
            }

            const int     m = 64;         // Maximum number of compatibility items
            List <string> l = aceApp.PluginCompatibility;

            if (l.Count > m)
            {
                l.RemoveRange(m, l.Count - m);                         // See reg.
            }
        }
示例#4
0
        /// <summary>
        /// Prepare for saving the configuration to disk. None of the
        /// modifications in this method need to be rolled back
        /// (for rollback, use <c>OnSavePre</c> / <c>OnSavePost</c>).
        /// </summary>
        private void PrepareSave()
        {
            AceMeta        aceMeta = this.Meta;        // m_meta might be null
            AceApplication aceApp  = this.Application; // m_aceApp might be null
            AceDefaults    aceDef  = this.Defaults;    // m_def might be null

            aceMeta.OmitItemsWithDefaultValues = true;

            aceApp.LastUsedFile.ClearCredentials(true);

            foreach (IOConnectionInfo iocMru in aceApp.MostRecentlyUsed.Items)
            {
                iocMru.ClearCredentials(true);
            }

            if (aceDef.RememberKeySources == false)
            {
                aceDef.KeySources.Clear();
            }

            aceApp.TriggerSystem = Program.TriggerSystem;

            SearchUtil.PrepareForSerialize(aceDef.SearchParameters);
        }
示例#5
0
        internal void OnLoad()
        {
            AceMainWindow aceMW     = this.MainWindow;     // m_uiMainWindow might be null
            AceSearch     aceSearch = this.Search;         // m_aceSearch might be null
            AceDefaults   aceDef    = this.Defaults;       // m_def might be null

            // aceInt.UrlSchemeOverrides.SetDefaultsIfEmpty();

            ObfuscateCred(false);
            ChangePathsRelAbs(true);

            // Remove invalid columns
            List <AceColumn> lColumns = aceMW.EntryListColumns;
            int i = 0;

            while (i < lColumns.Count)
            {
                if (((int)lColumns[i].Type < 0) || ((int)lColumns[i].Type >=
                                                    (int)AceColumnType.Count))
                {
                    lColumns.RemoveAt(i);
                }
                else
                {
                    ++i;
                }
            }

            SearchUtil.FinishDeserialize(aceSearch.LastUsedProfile);
            foreach (SearchParameters sp in aceSearch.UserProfiles)
            {
                SearchUtil.FinishDeserialize(sp);
            }

            DpiScale();

            if (aceMW.EscMinimizesToTray)            // For backward compatibility
            {
                aceMW.EscMinimizesToTray = false;    // Default value
                aceMW.EscAction          = AceEscAction.MinimizeToTray;
            }

            if (NativeLib.IsUnix())
            {
                this.Security.MasterKeyOnSecureDesktop = false;

                AceIntegration aceInt = this.Integration;
                aceInt.HotKeyGlobalAutoType         = (long)Keys.None;
                aceInt.HotKeyGlobalAutoTypePassword = (long)Keys.None;
                aceInt.HotKeySelectedAutoType       = (long)Keys.None;
                aceInt.HotKeyShowWindow             = (long)Keys.None;
                aceInt.HotKeyEntryMenu = (long)Keys.None;
            }

            if (MonoWorkarounds.IsRequired(1378))
            {
                AceWorkspaceLocking aceWL = this.Security.WorkspaceLocking;
                aceWL.LockOnSessionSwitch       = false;
                aceWL.LockOnSuspend             = false;
                aceWL.LockOnRemoteControlChange = false;
            }

            if (MonoWorkarounds.IsRequired(1418))
            {
                aceMW.MinimizeAfterOpeningDatabase        = false;
                this.Application.Start.MinimizedAndLocked = false;
            }

            if (MonoWorkarounds.IsRequired(1976))
            {
                aceMW.FocusQuickFindOnRestore = false;
                aceMW.FocusQuickFindOnUntray  = false;
            }
        }