Esempio n. 1
0
        private void LoadSecurityOptions()
        {
            m_numLockAfterTime.Value  = Program.Config.Security.WorkspaceLocking.LockAfterTime;
            m_cbLockAfterTime.Checked = (m_numLockAfterTime.Value > 0);

            int nDefaultExpireDays = Program.Config.Defaults.NewEntryExpiresInDays;

            if (nDefaultExpireDays < 0)
            {
                m_cbDefaultExpireDays.Checked = false;
            }
            else
            {
                m_cbDefaultExpireDays.Checked = true;
                try { m_numDefaultExpireDays.Value = nDefaultExpireDays; }
                catch (Exception) { Debug.Assert(false); }
            }

            int nClipClear = Program.Config.Security.ClipboardClearAfterSeconds;

            if (nClipClear >= 0)
            {
                m_cbClipClearTime.Checked = true;
                m_numClipClearTime.Value  = nClipClear;
            }
            else
            {
                m_cbClipClearTime.Checked = false;
            }

            m_lvSecurityOptions.Columns.Add(string.Empty, 200);             // Resize below

            ListViewGroup lvg = new ListViewGroup(KPRes.Options);

            m_lvSecurityOptions.Groups.Add(lvg);
            Debug.Assert(lvg.ListView == m_lvSecurityOptions);

            m_cdxSecurityOptions.CreateItem(Program.Config.Security.WorkspaceLocking,
                                            "LockOnWindowMinimize", m_lvSecurityOptions, lvg, KPRes.LockOnMinimize);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security.WorkspaceLocking,
                                            "LockOnSessionLock", m_lvSecurityOptions, lvg, KPRes.LockOnSessionLock);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "ClipboardClearOnExit",
                                            m_lvSecurityOptions, lvg, KPRes.ClipboardClearOnExit);

            if (NativeLib.IsLibraryInstalled())
            {
                m_cdxSecurityOptions.CreateItem(Program.Config.Native, "NativeKeyTransformations",
                                                m_lvSecurityOptions, lvg, KPRes.NativeLibUse);
            }

            m_cdxSecurityOptions.UpdateData(false);
            m_lvSecurityOptions.Columns[0].Width = m_lvSecurityOptions.ClientRectangle.Width - 36;
        }
Esempio n. 2
0
        private void LoadSecurityOptions()
        {
            AceWorkspaceLocking aceWL = Program.Config.Security.WorkspaceLocking;

            uint uLockTime = aceWL.LockAfterTime;
            bool bLockTime = (uLockTime > 0);

            m_numLockAfterTime.Value  = (bLockTime ? uLockTime : 300);
            m_cbLockAfterTime.Checked = bLockTime;
            if (AppConfigEx.IsOptionEnforced(aceWL, "LockAfterTime"))
            {
                m_cbLockAfterTime.Enabled = false;
            }

            uLockTime = aceWL.LockAfterGlobalTime;
            bLockTime = (uLockTime > 0);
            m_numLockAfterGlobalTime.Value  = (bLockTime ? uLockTime : 240);
            m_cbLockAfterGlobalTime.Checked = bLockTime;
            if (AppConfigEx.IsOptionEnforced(aceWL, "LockAfterGlobalTime"))
            {
                m_cbLockAfterGlobalTime.Enabled = false;
            }

            int nDefaultExpireDays = Program.Config.Defaults.NewEntryExpiresInDays;

            if (nDefaultExpireDays < 0)
            {
                m_cbDefaultExpireDays.Checked = false;
            }
            else
            {
                m_cbDefaultExpireDays.Checked = true;
                try { m_numDefaultExpireDays.Value = nDefaultExpireDays; }
                catch (Exception) { Debug.Assert(false); }
            }
            if (AppConfigEx.IsOptionEnforced(Program.Config.Defaults, "NewEntryExpiresInDays"))
            {
                m_cbDefaultExpireDays.Enabled = false;
            }

            int nClipClear = Program.Config.Security.ClipboardClearAfterSeconds;

            if (nClipClear >= 0)
            {
                m_cbClipClearTime.Checked = true;
                m_numClipClearTime.Value  = nClipClear;
            }
            else
            {
                m_cbClipClearTime.Checked = false;
            }
            if (AppConfigEx.IsOptionEnforced(Program.Config.Security, "ClipboardClearAfterSeconds"))
            {
                m_cbClipClearTime.Enabled = false;
            }

            m_lvSecurityOptions.Columns.Add(string.Empty);             // Resize below

            ListViewGroup lvg = new ListViewGroup(KPRes.Options);

            m_lvSecurityOptions.Groups.Add(lvg);
            Debug.Assert(lvg.ListView == m_lvSecurityOptions);

            m_cdxSecurityOptions = new CheckedLVItemDXList(m_lvSecurityOptions, true);

            bool?  obNoSEv      = null;       // Allow read-only by enforced config
            string strSEvSuffix = string.Empty;

            if (MonoWorkarounds.IsRequired(1378))
            {
                obNoSEv      = true;
                strSEvSuffix = " (" + KPRes.UnsupportedByMono + ")";
            }

            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnWindowMinimize",
                                            lvg, KPRes.LockOnMinimizeTaskbar);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnWindowMinimizeToTray",
                                            lvg, KPRes.LockOnMinimizeTray);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnSessionSwitch",
                                            lvg, KPRes.LockOnSessionSwitch + strSEvSuffix, obNoSEv);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnSuspend",
                                            lvg, KPRes.LockOnSuspend + strSEvSuffix, obNoSEv);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnRemoteControlChange",
                                            lvg, KPRes.LockOnRemoteControlChange + strSEvSuffix, obNoSEv);
            m_cdxSecurityOptions.CreateItem(aceWL, "ExitInsteadOfLockingAfterTime",
                                            lvg, KPRes.ExitInsteadOfLockingAfterTime);
            m_cdxSecurityOptions.CreateItem(aceWL, "AlwaysExitInsteadOfLocking",
                                            lvg, KPRes.ExitInsteadOfLockingAlways);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "ClipboardClearOnExit",
                                            lvg, KPRes.ClipboardClearOnExit);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security,
                                            "UseClipboardViewerIgnoreFormat", lvg,
                                            KPRes.ClipboardViewerIgnoreFormat + " " + KPRes.NotRecommended);

            if (NativeLib.IsLibraryInstalled())
            {
                m_cdxSecurityOptions.CreateItem(Program.Config.Native, "NativeKeyTransformations",
                                                lvg, KPRes.NativeLibUse);
            }

            bool?obNoWin = null;              // Allow read-only by enforced config

            if (NativeLib.IsUnix())
            {
                obNoWin = true;
            }

            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "MasterKeyOnSecureDesktop",
                                            lvg, KPRes.MasterKeyOnSecureDesktop, obNoWin);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "ClearKeyCommandLineParams",
                                            lvg, KPRes.ClearKeyCmdLineParams);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security.MasterPassword,
                                            "RememberWhileOpen", lvg, KPRes.MasterPasswordRmbWhileOpen);

            m_cdxSecurityOptions.UpdateData(false);
            UIUtil.ResizeColumns(m_lvSecurityOptions, true);
        }
Esempio n. 3
0
        private void LoadSecurityOptions()
        {
            AceWorkspaceLocking aceWL = Program.Config.Security.WorkspaceLocking;

            uint uLockTime = aceWL.LockAfterTime;
            bool bLockTime = (uLockTime > 0);

            m_numLockAfterTime.Value  = (bLockTime ? uLockTime : 300);
            m_cbLockAfterTime.Checked = bLockTime;
            if (AppConfigEx.IsOptionEnforced(aceWL, "LockAfterTime"))
            {
                m_cbLockAfterTime.Enabled = false;
            }

            uLockTime = aceWL.LockAfterGlobalTime;
            bLockTime = (uLockTime > 0);
            m_numLockAfterGlobalTime.Value  = (bLockTime ? uLockTime : 240);
            m_cbLockAfterGlobalTime.Checked = bLockTime;
            if (AppConfigEx.IsOptionEnforced(aceWL, "LockAfterGlobalTime"))
            {
                m_cbLockAfterGlobalTime.Enabled = false;
            }

            int nDefaultExpireDays = Program.Config.Defaults.NewEntryExpiresInDays;

            if (nDefaultExpireDays < 0)
            {
                m_cbDefaultExpireDays.Checked = false;
            }
            else
            {
                m_cbDefaultExpireDays.Checked = true;
                try { m_numDefaultExpireDays.Value = nDefaultExpireDays; }
                catch (Exception) { Debug.Assert(false); }
            }
            if (AppConfigEx.IsOptionEnforced(Program.Config.Defaults, "NewEntryExpiresInDays"))
            {
                m_cbDefaultExpireDays.Enabled = false;
            }

            int nClipClear = Program.Config.Security.ClipboardClearAfterSeconds;

            if (nClipClear >= 0)
            {
                m_cbClipClearTime.Checked = true;
                m_numClipClearTime.Value  = nClipClear;
            }
            else
            {
                m_cbClipClearTime.Checked = false;
            }
            if (AppConfigEx.IsOptionEnforced(Program.Config.Security, "ClipboardClearAfterSeconds"))
            {
                m_cbClipClearTime.Enabled = false;
            }

            m_lvSecurityOptions.Columns.Add(string.Empty, 200);             // Resize below

            ListViewGroup lvg = new ListViewGroup(KPRes.Options);

            m_lvSecurityOptions.Groups.Add(lvg);
            Debug.Assert(lvg.ListView == m_lvSecurityOptions);

            m_cdxSecurityOptions = new CheckedLVItemDXList(m_lvSecurityOptions, true);

            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnWindowMinimize",
                                            lvg, KPRes.LockOnMinimize);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnSessionSwitch",
                                            lvg, KPRes.LockOnSessionSwitch);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnSuspend",
                                            lvg, KPRes.LockOnSuspend);
            m_cdxSecurityOptions.CreateItem(aceWL, "LockOnRemoteControlChange",
                                            lvg, KPRes.LockOnRemoteControlChange);
            m_cdxSecurityOptions.CreateItem(aceWL, "ExitInsteadOfLockingAfterTime",
                                            lvg, KPRes.ExitInsteadOfLockingAfterTime);
            m_cdxSecurityOptions.CreateItem(aceWL, "AlwaysExitInsteadOfLocking",
                                            lvg, KPRes.ExitInsteadOfLockingAlways);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "ClipboardClearOnExit",
                                            lvg, KPRes.ClipboardClearOnExit);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security,
                                            "UseClipboardViewerIgnoreFormat", lvg,
                                            KPRes.ClipboardViewerIgnoreFormat + " " + KPRes.NotRecommended);

            if (NativeLib.IsLibraryInstalled())
            {
                m_cdxSecurityOptions.CreateItem(Program.Config.Native, "NativeKeyTransformations",
                                                lvg, KPRes.NativeLibUse);
            }

            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "MasterKeyOnSecureDesktop",
                                            lvg, KPRes.MasterKeyOnSecureDesktop);
            m_cdxSecurityOptions.CreateItem(Program.Config.Security, "ClearKeyCommandLineParams",
                                            lvg, KPRes.ClearKeyCmdLineParams);

            m_cdxSecurityOptions.UpdateData(false);
            m_lvSecurityOptions.Columns[0].Width = m_lvSecurityOptions.ClientRectangle.Width -
                                                   UIUtil.GetVScrollBarWidth() - 1;
        }