private void AutoActivityItemsCodeChange(object sender, RoutedEventArgs e)
        {
            Button obj = (Button)sender;

            if (FarmInfoRootData.Sons.Count() > 0)
            {
                ActivityItemsCodeChange(null, null);
            }
            else if (AutoSearch())
            {
                SData.TotalLoadFromUserData(gameinfopath + "\\farms.data", FarmInfoRootData);
                string itemcodes = TxtItemCodes.Text;
                string legalcode = itemcodes.Replace("\"Rewards\":", "").TrimEnd(',');
                Console.WriteLine(legalcode);

                SData dt = FarmInfoRootData.TurnTo("\"Rewards\"");
                dt.sonKind = 0;
                dt.Value   = legalcode;

                if (SData.TotalSaveUserData())
                {
                    MessageBox.Show("修改成功!");
                }
            }
            else
            {
                obj.Content = "自动搜索失败,请使用下面的按钮手动选择存档";
            }
        }
        private void ActivityItemsCodeChange(object sender, RoutedEventArgs e)
        {
            if (FarmInfoRootData.Sons.Count() <= 0)
            {
                Microsoft.Win32.OpenFileDialog op = new Microsoft.Win32.OpenFileDialog();
                op.Title  = "请选择farms.data文件,这通常在remote文件夹中";
                op.Filter = "farms.data文件|farms.data";
                op.ShowDialog();
                string addr = op.FileName;
                if (addr == "" || addr == null)
                {
                    return;
                }
                SData.TotalLoadFromUserData(addr, FarmInfoRootData);
            }

            //下面是修改过程
            string itemcodes = TxtItemCodes.Text;
            string legalcode = itemcodes.Replace("\"Rewards\":", "").TrimEnd(',');

            if (legalcode[0] != '[' || legalcode[legalcode.Length - 1] != ']')
            {
                MessageBox.Show("代码格式错误。请检查输入的代码。");
                return;
            }
            SData dt = FarmInfoRootData.TurnTo("\"Rewards\"");

            dt.sonKind = 0;
            dt.Value   = legalcode;

            if (SData.TotalSaveUserData())
            {
                MessageBox.Show("修改成功!");
            }
        }