RadegastSpeech.PluginControl.Initialize C# (CSharp) Method

Initialize() private method

Startup code (executed only when needed)
private Initialize ( ) : void
return void
        private void Initialize()
        {
            // Never initialize twice
            if (started) return;

            // Do the one-time only initializations.
            try
            {
                LoadOSLayer();
                env = new Environment.Control(this);
                talker = new Talk.Control(this);
                listener = new Listen.Control(this);
                converse = new Conversation.Control(this);
                sound = new Sound.FmodSound(this);
                StartControls();
                if (!instance.Netcom.IsLoggedIn)
                {
                    talker.SayMore("Press enter to connect.");
                }
                else
                {
                    // Create conversations and pick active one if we are activating
                    // the speech plugin mid-session
                    foreach (RadegastTab tab in instance.TabConsole.Tabs.Values)
                    {
                        converse.CreateConversationFromTab(tab, false);
                    }
                    converse.ActivateConversationFromTab(instance.TabConsole.SelectedTab);

                }
                started = true;
            }
            catch (Exception e)
            {
                SpeechButton.Checked = false;
                config["enabled"] = OSD.FromBoolean(false);
                SaveSpeechSettings();
                System.Windows.Forms.MessageBox.Show("Speech failed initialization: " + e.Message);
                return;
            }
        }