Esempio n. 1
0
        public static void LoadTreeViewData(TreeView treeview, string path)
        {
            TreeViewBean nodeBean = XmlSerializer <TreeViewBean> .DeserializeFromFile(path);

            //TreeViewBeanのデータをTreeViewにコンバートする
            nodeBean.PopulateTree(treeview);
        }
Esempio n. 2
0
        public static void SaveTreeViewData(TreeView treeview, string path)
        {
            //TreeViewのデータをTreeViewBeanにコンバートする
            TreeViewBean treeviewBean = new TreeViewBean(treeview);

            XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();

            namespaces.Add("", "");

            XmlWriterSettings settings = new XmlWriterSettings();

            settings.Encoding    = Encoding.UTF8;
            settings.Indent      = true;
            settings.IndentChars = "\t";

            XmlSerializer <TreeViewBean> .SerializeToFile(treeviewBean, path, namespaces, settings);
        }