Beispiel #1
0
        private void fMain_Load(object sender, EventArgs e)
        {
            // Title label
            lblAppTitle.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name + " " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            // Populate translation menu
            AvailableTranslationServices.List().ForEach(
                delegate(TranslatorService tr)
            {
                var ttb    = new ToolStripMenuItem(tr.Name);
                ttb.Click += new EventHandler(tsddbGenericHandler);
                tsddbServices.DropDownItems.Add(ttb);

                if ((Properties.Settings.Default.TranslatorEngine == tr.Name) || (AvailableTranslationServices.Active == tr))
                {
                    ActivateService(tr.Name);
                }
            });

            // Load settings
            toggleAlwaysOnTop(Properties.Settings.Default.AlwaysOnTop);
            SetOpacity(Properties.Settings.Default.Opacity);
            this.Size        = Properties.Settings.Default.FormSize;
            this.Location    = Properties.Settings.Default.FormPos;
            txtLog.BackColor = Properties.Settings.Default.ColorBackground;
            this.OnResize(e);

            // Start the log watcher
            using (IPso2LogWatcherFactory factory = new Pso2LogWatcherFactory())
                using (IPso2LogWatcher watcher = factory.CreatePso2LogWatcher())
                {
                    watcher.Pso2LogEvent += (sndr, ev) =>
                    {
                        // That's a command, let's quit
                        if (ParsingSupport.isPSO2ChatCommand(ev.Message))
                        {
                            return;
                        }

                        // Let's remove all crap
                        ev.Message = ParsingSupport.chatCleanUp(ev.Message);

                        // If message didn't turned out all crap, let's display
                        if (ev.Message != "")
                        {
                            addLine(ev);
                        }
                    };
                    watcher.Start();
                }
        }
Beispiel #2
0
 override public string DetectLanguage(string text)
 {
     return(ParsingSupport.isJapanese(text) ? "ja" : "en");
 }