Beispiel #1
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            HspConsole.Initialize();
            if (!HspDecoder.Initialize())
            {
                HspConsole.Close();
                return;
            }
            string filename = null;

            if ((args != null) && (args.Length > 0))
            {
                foreach (string file in args)
                {
                    if (File.Exists(file))
                    {
                        filename = file;
                        break;
                    }
                }
            }

            try
            {
                Application.Run(new deHspDialog(filename));
            }
            catch (Exception e)
            {
                try
                {
                    HspConsole.ExceptionHandlingClose(e);
                }
                catch { }
                return;
            }
            HspConsole.Close();
        }
Beispiel #2
0
        internal static bool Initialize()
        {
            string dictionaryPath = Program.ExeDir + dictionaryFileName;

            try
            {
                dictionary = Hsp3Dictionary.FromFile(dictionaryPath);
            }
            catch
            {
                goto err;
            }
            if (dictionary != null)
            {
                HspConsole.WriteLog("load " + dictionaryFileName + ":succeeded");
                return(true);
            }
err:
            HspConsole.WriteLog("load " + dictionaryFileName + ":failed");
            System.Windows.Forms.MessageBox.Show(dictionaryFileName + "の読込に失敗しました");
            dictionary = null;
            return(false);
        }