Example #1
0
        private static void LoadFiles(EasyPropertiesNode node, TMFolder folder)
        {
            int count = node.GetValue <int>("Count", 0);

            for (int i = 0; i < count; i++)
            {
                string pname    = "File" + i.ToString();
                string fileName = node.GetValue <string>(pname + "_fullname", "");

                TMFile tmFile = new TMFile(new FileInfo(fileName), folder);
                tmFile.Version    = node.GetValue <int>(pname + "_version", 1);
                tmFile.ModifyTime = node.GetValue <DateTime>(pname + "_time", DateTime.Now);
                tmFile.Length     = node.GetValue <long>(pname + "_length", 0);

                folder.Files.Add(tmFile);
            }
        }
Example #2
0
        public void InitializeDataGridView(DataGridView dgv)
        {
            string id = this.GetDataGridViewId(dgv);

            this._views.Add(dgv, id);

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

            foreach (DataGridViewColumn col in dgv.Columns)
            {
                col.Width = ps.GetValue <int>(col.Name, col.Width);
            }
        }
Example #3
0
        private void Load()
        {
            string[] files = _properties.GetValue <string[]>("Files", new string[] { });
            foreach (string file in files)
            {
                FileInfo fi = new FileInfo(file);

                if (!fi.Exists)
                {
                    continue;
                }
                if (this.ExistsBase(fi))
                {
                    continue;
                }
                this.Add(fi);
            }
        }
Example #4
0
        public void LoadSettings()
        {
            /* Загрузка настроек подключения к серверу */
            EasyPropertiesNode ps = Global.Properties["Updates"];

            _autoCheckForUpdates = ps.GetValue <bool>("Auto", true);

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

            proxy.Enable       = ps.GetValue <bool>("Enable", false);
            proxy.Server       = ps.GetValue <string>("Server", "");
            proxy.Port         = ps.GetValue <int>("Port", 0);
            proxy.UserName     = ps.GetValue <string>("UserName", "");
            proxy.UserPassword = ps.GetValue <string>("UserPassword", "");
        }