/// <summary> /// Loads settings /// </summary> private void LoadSettings() { var settings = Settings.Read(); if (settings == null) { return; } if (settings.SaveInterval != 0) { timer.Interval = settings.SaveInterval; timer.Start(); } if (settings.SaveInterval != 0) { SetTime(settings.SaveInterval); } SetTheme(settings.CurrentTheme); foreach (var settingsOpenPath in settings.OpenPaths) { _fileTabManager.Add(FileTab.CreateFromPath(settingsOpenPath, _currentTheme, contextMenuStrip)); } }
/// <summary> /// Adds new file tab /// </summary> /// <param name="fileTab">FileTab to add</param> public void Add(FileTab fileTab) { if (fileTab == null) { return; } _tabControl.TabPages.Add(fileTab.TabPage); _tabControl.SelectedTab = fileTab.TabPage; _fileTabs.Add(fileTab.TabPage, fileTab); }
private void OpenToolStripMenuItem_Click(object sender, EventArgs e) { _fileTabManager.Add(FileTab.CreateFromFile(_currentTheme, contextMenuStrip)); SaveSettings(); }
private void NewToolStripMenuItem_Click(object sender, EventArgs e) { _fileTabManager.Add(FileTab.CreateEmpty(_currentTheme, contextMenuStrip)); }