Exemple #1
0
        public XSetInt64(string path)
        {
            string contents;

            using (var reader = new StreamReader(path))
            {
                contents = reader.ReadToEnd();
            }

            var node = new XSetInt64Node(contents);

            var items = node.GetProperties <long>(L);

            foreach (var l in items)
            {
                _set.Add(l);
            }
        }
Exemple #2
0
        public void SaveTo(string path)
        {
            var directory = Path.GetDirectoryName(path);

            Debug.Assert(null != directory);

            if (string.Empty != directory)
            {
                Directory.CreateDirectory(directory);
            }

            lock (this)
            {
                var node = new XSetInt64Node();

                node.SetProperties(L, _set.ToArray());

                using (var writer = new StreamWriter(path))
                {
                    writer.WriteLine(node.ToString());
                }
            }
        }