public override void ShowPane() { _ini = ICore.Instance.SettingStore; _chkGreetingInReplies.Checked = _ini.ReadBool("MailFormat", "GreetingInReplies", true); _chkPrefixInitials.Checked = _ini.ReadBool("MailFormat", "PrefixInitials", false); _boxPrefix.Text = _ini.ReadString("MailFormat", "GreetingString", "Hello"); /** * signatures */ _chkUseSignature.Checked = _ini.ReadBool("MailFormat", "UseSignature", false); _signatureBox.Enabled = _chkUseSignature.Checked; if (_signatureBox.Enabled) { _signatureBox.Text = _ini.ReadString("MailFormat", "Signature"); } switch (_ini.ReadInt("MailFormat", "SignatureInReplies", 1)) { case 0: _radReplySignatureNone.Checked = true; break; case 1: _radSignatureBeforeQuoting.Checked = true; break; case 2: _radSignatureAfterQuoting.Checked = true; break; } }
public override void ShowPane() { ISettingStore settings = Core.SettingStore; string exts = settings.ReadString("FilePlugin", "PlainTextExts"); if (exts.Length == 0) { exts = ".txt"; } _textExtsList.Text = exts; _indexHiddenCheckBox.Checked = settings.ReadBool("FilePlugin", "IndexHidden", false); _viewHiddenCheckBox.Checked = settings.ReadBool("FilePlugin", "ViewHidden", false); }
public void Startup() { IContactService contactService = (IContactService)Core.PluginLoader.GetPluginService(typeof(IContactService)); if (contactService != null) { ContactBlockCreator creator = ICQContactBlock.CreateBlock; contactService.RegisterContactEditBlock(0, ListAnchor.Last, "ICQ Accounts", creator); contactService.RegisterContactEditBlock(ContactTabNames.GeneralTab, ListAnchor.Last, "ICQ Accounts", creator); } ISettingStore settings = Core.SettingStore; _indexStartDate = settings.ReadDate("Startup", "IndexStartDate", DateTime.MinValue); if (_indexStartDate > DateTime.MinValue) { _idleIndexing = settings.ReadBool("Startup", "IdleIndexing", false); bool needIdle = ObjectStore.ReadBool("ICQ", "NeedIdle", true); if (_idleIndexing && needIdle) { Trace.WriteLine("Queueing conversations rebuild in idle mode", "ICQ.Plugin"); Core.ResourceAP.QueueIdleJob(this); } else { Trace.WriteLine("_idleIndexing = " + _idleIndexing, "ICQ.Plugin"); Trace.WriteLine("NeedIdle = " + needIdle, "ICQ.Plugin"); } } Core.StateChanged += Core_StateChanged; }
/** * Saves the setting store used by the form and restores its settings * from the INI file. */ public void RestoreSettings() { AdjustContolProperties(Controls); KeyPreview = true; _ini = Core.SettingStore; string section = GetFormSettingsSection(); bool maximized = _ini.ReadBool(section, "Maximized", false); if (maximized) { WindowState = FormWindowState.Maximized; } else { int x = _ini.ReadInt(section, "X", -1); int y = _ini.ReadInt(section, "Y", -1); int width = _ini.ReadInt(section, "Width", -1); int height = _ini.ReadInt(section, "Height", -1); if (x != -1 && y != -1) { Screen scr = Screen.FromPoint(new Point(x, y)); // First correct horizontal location (since it is that // what changes most of the time when screens configuration // is changed). If new point is suitable, do not change vertical // location. // NB: pay attention to cases when Screen.WorkingArea is (0, 0, 0, 0)!!! if (!scr.Bounds.Contains(x, y)) { x = scr.WorkingArea.X; if (scr.WorkingArea.Width != 0) { x += Math.Abs(x) % scr.WorkingArea.Width; } } if (!scr.Bounds.Contains(x, y)) { y = scr.WorkingArea.Y; if (scr.WorkingArea.Height != 0) { y += Math.Abs(y) % scr.WorkingArea.Height; } } StartPosition = FormStartPosition.Manual; Location = new Point(x, y); } if (width > 0 && height > 0) { ClientSize = new Size(width, height); } } }
public UnreadManager(WorkspaceManager workspaceManager, IResourceTabProvider tabProvider, ISettingStore settingStore, ICoreProps coreProps) { _tabProvider = tabProvider; _workspaceManager = workspaceManager; _coreProps = coreProps; _defaultUnreadState = new UnreadState(this, null, null); _curUnreadState = _defaultUnreadState; _store = Core.ResourceStore; _propUnreadCount = _store.PropTypes.Register("UnreadCount", PropDataType.Int, PropTypeFlags.Internal); _traceUnreadCounters = settingStore.ReadBool("UnreadCounters", "TraceUnreadCounters", false); Core.ResourceAP.JobFinished += environment_ResourceOperationFinished; Enabled = true; }
public void LoadSettings() { _edtDbPath.Text = OMEnv.WorkDir; LoadLogPath(); ISettingStore ini = Core.SettingStore; if (ini == null) { _enableBackupBox.Visible = false; _backupGroup.Visible = false; } else { _backupPath.Text = ini.ReadString("ResourceStore", "BackupPath", string.Empty); _enableBackupBox.Checked = ini.ReadBool("ResourceStore", "EnableBackup", false); _backupGroup.Enabled = _enableBackupBox.Checked; } }
public override void ShowPane() { ISettingStore ini = Core.SettingStore; _address.Text = ini.ReadString("HttpProxy", "Address"); int port = ini.ReadInt("HttpProxy", "Port", 3128); if (port < (int)_port.Minimum) { port = (int)_port.Minimum; } else if (port > (int)_port.Maximum) { port = (int)_port.Maximum; } _port.Value = port; _user.Text = ini.ReadString("HttpProxy", "User"); _password.Text = ini.ReadString("HttpProxy", "Password"); _bypassLocal.Checked = ini.ReadBool("HttpProxy", "BypassLocal", true); _bypassList.Text = ini.ReadString("HttpProxy", "BypassList"); if (_address.Text.Length > 0) { _configureProxyButton.Checked = true; } else { _defaultProxyButton.Checked = true; } if (IsDefaultProxyAutoconfigured()) { _lblDefaultSetting.Text = "Autoconfigure script not supported, please specify proxy settings manually"; } else if (WebProxy.GetDefaultProxy().Address != null) { _lblDefaultSetting.Text = "Default proxy setting: " + WebProxy.GetDefaultProxy().Address; } else { _lblDefaultSetting.Text = "Default proxy setting: No proxy specified"; } }
public override void ShowPane() { ISettingStore ini = Core.SettingStore; int markReadMS = ini.ReadInt("Resources", "MarkAsReadTimeOut", 2000); if (markReadMS == 0) { _chkMarkAsRead.Checked = false; _udMarkAsReadSeconds.Enabled = false; } else { _chkMarkAsRead.Checked = true; _udMarkAsReadSeconds.Value = markReadMS / 1000; } _chkShowContext.Checked = ini.ReadBool("Resources", "ShowSearchContext", true); _chkUseShortDateFormat.Checked = ini.ReadBool("Resources", "UseShortDateFormat", false); _chkSwitchToTab.Checked = ini.ReadBool("Search", "AutoSwitchToResults", true); _chkMinimizeToTray.Checked = ini.ReadBool("Resources", "MinimizeToTray", false); _chkTrayIconMode.Checked = Core.TrayIconManager.IsOutlookMode; _chkIdleTextIndex.Checked = Core.TextIndexManager.IdleIndexingMode; if (ini.ReadBool("Resources", "LinksInNewWindow", false)) { _radBrowserWindow.Checked = true; } else if (ini.ReadBool("Resources", "LinksInPreviewPane", false)) { _radPreviewPane.Checked = true; } else { _radOmeaWindow.Checked = true; } _udPeriod.Value = Core.SettingStore.ReadInt("General", "BalloonTimeout", ciDefaultVisibilityInterval); ReadBackColor(); ReadFontCharacteristics(); ReadPrefixes(); }
private static WebProxy LoadDefaultProxy() { WebProxy proxy; ISettingStore ini = Core.SettingStore; string address = ini.ReadString("HttpProxy", "Address"); bool haveProxy = false; if (address.Length == 0) { proxy = WebProxy.GetDefaultProxy(); proxy.Credentials = CredentialCache.DefaultCredentials; if (proxy.Address != null) { Trace.WriteLine("Using proxy settings from IE: address " + proxy.Address + ", bypass on local addresses " + proxy.BypassProxyOnLocal); haveProxy = true; } else { Trace.WriteLine("No proxy configured in IE"); } } else { do { int port = ini.ReadInt("HttpProxy", "Port", 3128); try { proxy = new WebProxy(address, port); } catch { proxy = WebProxy.GetDefaultProxy(); } string user = ini.ReadString("HttpProxy", "User"); if (user.Length == 0) { proxy.Credentials = CredentialCache.DefaultCredentials; } else { string password = ini.ReadString("HttpProxy", "Password"); string[] userParts = user.Split('\\', '/'); if (userParts.Length == 2) { proxy.Credentials = new NetworkCredential(userParts[1], password, userParts[0]); } else { proxy.Credentials = new NetworkCredential(user, password); } } proxy.BypassProxyOnLocal = ini.ReadBool("HttpProxy", "BypassLocal", true); string bypassList = ini.ReadString("HttpProxy", "BypassList"); if (bypassList.Trim().Length > 0) { try { proxy.BypassList = bypassList.Split(';'); } catch {} } if (proxy.Address != null) { Trace.WriteLine("Using proxy settings specified by user: address " + proxy.Address + ", bypass on local addresses " + proxy.BypassProxyOnLocal); haveProxy = true; } else { Trace.WriteLine("No proxy configured by user"); } } while(false); } if (haveProxy) { ServicePointManager.DefaultConnectionLimit = 5; } return(proxy); }