Esempio n. 1
0
        //public void SaveKnownServers()
        //{
        //    var sh = new SettingsIO();
        //    sh.SaveKnownServers(_knownServers);
        //}

        public void LoadRecentProjects()
        {
            var sh = new SettingsIO();
            IList <Sql8rProjectFile> recentProjects = sh.LoadRecentProjects();

            for (int i = 0; i < recentProjects.Count; i++)
            {
                Sql8rProjectFile project = recentProjects[i];
                var pmt = (PopupMenuTool)_view.tbManager.Ribbon.ApplicationMenu.ToolAreaLeft.Tools["pmtRecent"];
                var bt  = new ButtonTool(project.Path);
                if (!_view.tbManager.Tools.Exists(bt.Key))
                {
                    bt.Tag = project.Path;
                    bt.SharedProps.Caption     = project.Name;
                    bt.SharedProps.ToolTipText = project.Path;
                    bt.SharedProps.AppearancesSmall.Appearance.Image = 1;

                    _view.tbManager.Tools.Add(bt);
                    int recentId = pmt.Tools.Add(bt);
                    pmt.Tools[recentId].Tag = bt.Tag;

                    AddKnownServer(project);
                }
            }
        }
Esempio n. 2
0
        private void updateRecentProject(string filePath)
        {
            string fileName = Path.GetFileName(filePath);
            var    proj     = new Sql8rProjectFile(fileName, filePath);
            var    io       = new SettingsIO();
            IList <Sql8rProjectFile> projs = io.LoadRecentProjects();

            if (!projs.Contains(proj))
            {
                projs.Add(proj);
                io.SaveRecentProjects(projs);
            }
        }