コード例 #1
0
ファイル: HunterEditor.cs プロジェクト: zhangrl/Hunter3
        public void OpenFileByHunter3Editor()
        {
            OpenFileDialog ofd    = new OpenFileDialog();
            String         Filter = "Hunter 3 策略(*.h3s)|*.h3s";

            ofd.Filter = Filter;
            HunterRichTextBox.TextType t = HunterRichTextBox.TextType.Plain;

            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                try
                {
                    String filename = ofd.FileName;
                    switch (Path.GetExtension(filename))
                    {
                    case ".h3":
                        t = HunterRichTextBox.TextType.Xml;
                        break;

                    case ".hip":
                        t = HunterRichTextBox.TextType.ProxyFilter;
                        break;

                    case ".h3s":
                        t = HunterRichTextBox.TextType.Xml;
                        break;
                    }

                    new HunterEditor(Console, Config, ofd.FileName, false, Filter, false, null, null, t).Show();
                }
                catch (Exception ex)
                {
                    Console.WriteException(ex);
                }
            }
            else
            {
                return;
            }
        }
コード例 #2
0
ファイル: HunterEditor.cs プロジェクト: zhangrl/Hunter3
        public void ToSyntax(HunterRichTextBox.TextType t)
        {
            hTextBox.ContentType = t;

            hTextBox.PrettifyText();
        }