Exemplo n.º 1
0
        private void SaveFile(string path)
        {
            if (!CheckJson())
            {
                return;
            }

            JToken Jtok_root = JsonTreeViewItem.convertToJToken(json_tree_view.Items[0] as JsonTreeViewItem);

            if (Jtok_root != null && FileContoller.Write(path, Jtok_root.ToString()))
            {
                WindowMain.current.ShowMessageDialog("Save", path + " 파일이 저장되었습니다.");
            }
            else
            {
                string caption = "Save Error";
                string message = path + " 파일을 저장하는데 문제가 생겼습니다.";
                WindowMain.current.ShowMessageDialog(caption, message);
                Console.WriteLine("[" + caption + "] " + message);
            }
        }
Exemplo n.º 2
0
        private void OnClickButtonViewJsonFile(object sender, RoutedEventArgs e)
        {
            if (JsonTreeViewItem.Path == null)
            {
                return;
            }

            JsonTreeViewItem root = json_tree_view.Items[0] as JsonTreeViewItem;

            if (root == null)
            {
                return;
            }

            Window_ViewFile w = new Window_ViewFile(JsonTreeViewItem.convertToJToken(root).ToString(), JsonTreeViewItem.Path);

            //Window_ViewFile w = new Window_ViewFile(FileContoller.read(JsonInfo.current.Path), JsonInfo.current.Path);

            if (w.ShowDialog() == true)
            {
                refreshJsonTree(JsonController.parseJson(w.tb_file.Text));
            }
        }