예제 #1
0
        private void Test_OnClick(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(_configModel?.FilePath))
            {
                ChromeBookmarks chromeBookmarks =
                    (ChromeBookmarks)StringConvert.JsonToList<ChromeBookmarks>(
                        StringConvert.FileRead(_configModel.FilePath));
                BookmarksData bookmarksData = new BookmarksData();
                _myBookmarkses = bookmarksData.GetBookmarkses(chromeBookmarks);
                ConteView.ItemsSource = _myBookmarkses;
            }
            else
            {
                MessageBox.Show("请先设置书签文件地址");
            }

        }
예제 #2
0
        private void btn_Read_Click(object sender, EventArgs e)
        {
            string filePath = file_textpath.Text;

            if (string.IsNullOrEmpty(filePath))
            {
                MessageBox.Show("请选择书签文件");
            }
            else
            {
                if (File.Exists(filePath))
                {
                    string          str             = StringConvert.FileRead(filePath);
                    ChromeBookmarks chromeBookmarks = (ChromeBookmarks)StringConvert.JsonToList <ChromeBookmarks>(str);
                    BookmarksData   bookmarksData   = new BookmarksData();
                    _myBookmarkses       = bookmarksData.GetBookmarkses(chromeBookmarks);
                    dataG_Man.DataSource = _myBookmarkses;
                }
                else
                {
                    MessageBox.Show("当前文件不存在");
                }
            }
        }