예제 #1
0
        private void SaveDocuments()
        {
            DirectoryInfo dir = this.DocumentsDirectory;

            dir.Create();
            foreach (FileInfo file in dir.GetFiles())
            {
                file.Delete();
            }

            EasyProperties ps = new EasyProperties();

            foreach (IDockContent docContent in this.Documents)
            {
                ITabbedDocument document = docContent as ITabbedDocument;
                if (document == null)
                {
                    continue;
                }

                EasyPropertiesNode node = ps[document.GUID];
                node.SetValue <string>("Type", docContent.GetType().FullName);

                FileInfo file = new FileInfo(Path.Combine(dir.FullName, document.GUID + ".xml"));
                document.SaveProperties(file);
            }
            ps.Save(this.DocumentsListFile);
        }
예제 #2
0
        private static void SaveFolder(EasyPropertiesNode node, TMFolder folder)
        {
            foreach (TMFolder tmFolder in folder.Folders)
            {
                EasyPropertiesNode childNode = node[tmFolder.Name];
                SaveFolder(childNode, tmFolder);
            }

            node.SetValue <int>("Count", folder.Files.Count);
            for (int i = 0; i < folder.Files.Count; i++)
            {
                TMFile   tmFile = folder.Files[i];
                string   pname  = "File" + i.ToString();
                string[] sa     = new string[] { };
                node.SetValue <int>(pname + "_version", tmFile.Version);
                node.SetValue <string>(pname + "_fullname", tmFile.File.FullName);
                node.SetValue <DateTime>(pname + "_time", tmFile.ModifyTime);
                node.SetValue <long>(pname + "_length", tmFile.Length);
            }
        }
예제 #3
0
        private void Save()
        {
            List <RecentFileMenuItem> list  = this.GetArray();
            List <string>             files = new List <string>();

            foreach (RecentFileMenuItem rmi in list)
            {
                files.Add(rmi.RecentFile.FullName);
            }
            _properties.SetValue <string[]>("Files", files.ToArray());
        }
예제 #4
0
        public void SaveDataGridView(DataGridView dgv)
        {
            string id = _views[dgv];

            _views.Remove(dgv);

            EasyPropertiesNode ps = _props[id]["ColumsWidth"];

            foreach (DataGridViewColumn col in dgv.Columns)
            {
                ps.SetValue <int>(col.Name, col.Width);
            }
        }
예제 #5
0
        public void SaveSettings()
        {
            EasyPropertiesNode ps = Global.Properties["Updates"];

            ps.SetValue <bool>("Auto", _autoCheckForUpdates);

            ps = Global.Properties["Updates"]["Proxy"];
            ProxySettings proxy = Configure.Proxy;

            ps.SetValue <bool>("Enable", proxy.Enable);
            ps.SetValue <string>("Server", proxy.Server);
            ps.SetValue <int>("Port", proxy.Port);
            ps.SetValue <string>("UserName", proxy.UserName);
            ps.SetValue <string>("UserPassword", proxy.UserPassword);
        }