Esempio n. 1
0
        public void Save()
        {
            XmlSerializer ser = new XmlSerializer(typeof(DayExtra));

            using (StreamWriter writer = new StreamWriter(BlogXData.ResolvePath(FileName)))
            {
                ser.Serialize(writer, this);
            }
        }
Esempio n. 2
0
        public void Load()
        {
            string fullPath = BlogXData.ResolvePath(FileName);

            if (File.Exists(fullPath))
            {
                XmlSerializer ser = new XmlSerializer(typeof(EntryIdCache));
                using (StreamReader reader = new StreamReader(fullPath))
                {
                    EntryIdCache e = (EntryIdCache)ser.Deserialize(reader);
                    this.entries      = e.entries;
                    this.changeNumber = e.ChangeNumber;
                }
            }
        }
Esempio n. 3
0
        void LoadBlogCore()
        {
            string fullPath = BlogXData.ResolvePath("blogdata.xml");

            if (File.Exists(fullPath))
            {
                using (StreamReader reader = new StreamReader(fullPath))
                {
                    XmlSerializer ser = new XmlSerializer(typeof(BlogCoreData));
                    data = (BlogCoreData)ser.Deserialize(reader);
                }
            }
            else
            {
                data = new BlogCoreData();
                SaveBlogCore();
            }
        }
Esempio n. 4
0
        public void Load()
        {
            if (entries.Count > 0)
            {
                loaded = true;
            }
            if (loaded)
            {
                return;
            }

            if (BlogXData.Resolver != null)
            {
                XmlSerializer ser = new XmlSerializer(typeof(DayEntry));
                using (StreamReader reader = new StreamReader(BlogXData.ResolvePath(FileName)))
                {
                    DayEntry e = (DayEntry)ser.Deserialize(reader);
                    this.entries = e.entries;
                }
            }
            loaded = true;
        }