コード例 #1
0
 public MainWindow()
 {
     InitializeComponent();
     using (PlatformDataBase dataBase = new PlatformDataBase(
                ((IDefaultSettings)this).path + ((IDefaultSettings)this).data.links,
                ((IDefaultSettings)this).path + ((IDefaultSettings)this).data.data))
         this.books = dataBase.EachBooks(books = new List <Book>());
     insert(ref books);
 }
コード例 #2
0
        private void refresh_Click(object sender, RoutedEventArgs e)
        {
            setData(
                ((IDefaultSettings)this).path + ((IDefaultSettings)this).data.links,
                ((IDefaultSettings)this).path + ((IDefaultSettings)this).data.data);

            using (PlatformDataBase dataBase = new PlatformDataBase((
                                                                        (IDefaultSettings)this).path + ((IDefaultSettings)this).data.links,
                                                                    ((IDefaultSettings)this).path + ((IDefaultSettings)this).data.data))
                books = dataBase.EachBooks(books);
        }
コード例 #3
0
ファイル: Handler.cs プロジェクト: TwinkmrMask/BookShop
        public void SetData(string links, string database)
        {
            XmlDocument document = new XmlDocument();

            document.Load(getPath());
            XmlElement root = document.DocumentElement;

            foreach (XmlElement book in root)
            {
                if ((root != null) && (root.HasChildNodes))
                {
                    using (PlatformDataBase dataBase = new PlatformDataBase(links, database))
                        dataBase.AddBooks(
                            book.Attributes["id"].Value,
                            book.Attributes["author"].Value,
                            book.Attributes["title"].Value,
                            book.Attributes["year"].Value
                            );
                }
            }
        }