예제 #1
0
파일: Format.cs 프로젝트: SuMinXin/tools
 private void btn_Compress_Click(object sender, EventArgs e)
 {
     txtHiddenCount.Text = string.Empty;
     txtHiddenKey.Text   = string.Empty;
     try {
         richtxt_Output.Text = Compress(txt_Input.Text);
         resetFocus();
     }
     catch (Exception ex) {
         MessageBox.Show(SystemMsg.serializer(ex.Message));
     }
 }
예제 #2
0
파일: Format.cs 프로젝트: SuMinXin/tools
 private void btn_DeCompress_Click(object sender, EventArgs e)
 {
     txtHiddenCount.Text = string.Empty;
     txtHiddenKey.Text   = string.Empty;
     try {
         string _decompressStr = Decompress(txt_Input.Text);
         _decompressStr      = Setting.ReplaceExtra(_decompressStr);
         _decompressStr      = FormatXml(_decompressStr);
         richtxt_Output.Text = _decompressStr.Replace("<?xml version=\"1.0\" encoding=\"utf-16\"?>", "");
         resetFocus();
     }
     catch (Exception ex)
     {
         MessageBox.Show(SystemMsg.serializer(ex.Message));
     }
 }
예제 #3
0
        private void MongoForm_Load(object sender, EventArgs e)
        {
            Menu menu = new Menu(menu_panel, this);

            menu.drawButton();
            try
            {
                //Step 1.取得檔案
                List <JsonPara> _menu       = new List <JsonPara>();
                string          FilePath    = @"../doc/MongoJson.txt";
                string          _strFromtxt = string.Empty;
                using (StreamReader sr = new StreamReader(FilePath, Encoding.Default))
                {
                    string line;
                    while ((line = sr.ReadLine()) != null)
                    {
                        _strFromtxt += line;
                    }
                }
                _menu = JsonConvert.DeserializeObject <List <JsonPara> >(_strFromtxt);
                _menu = _menu.OrderBy(o => o.Orderby).ToList(); //Order By


                //Step 2.處理BTN
                showOnPanel(_menu);

                //其他有的沒的
                btn_Copy.FlatAppearance.BorderSize = 0;
                //btn_Copy.BackgroundImageLayout = ImageLayout.None;
                btn_Copy.FlatStyle = FlatStyle.Flat;
            }
            catch (Exception ex)
            {
                MessageBox.Show(SystemMsg.serializer(ex.ToString()));
            }
        }