Example #1
0
        /// <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));
            }
        }
Example #2
0
        /// <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);
        }
Example #3
0
 private void OpenToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _fileTabManager.Add(FileTab.CreateFromFile(_currentTheme, contextMenuStrip));
     SaveSettings();
 }
Example #4
0
 private void NewToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _fileTabManager.Add(FileTab.CreateEmpty(_currentTheme, contextMenuStrip));
 }