예제 #1
0
        /// <summary>
        /// Continues switch initialization after the application has detected that the
        /// NeonSwitch core service has been started.
        /// </summary>
        internal static void Initialize()
        {
            // Get the installed voices from the core service.

            try
            {
                var voices = new List <string>();

                using (var reader = new StringReader(Switch.ExecuteManaged(Switch.CoreAppName, "getvoices")))
                {
                    for (var line = reader.ReadLine(); line != null; line = reader.ReadLine())
                    {
                        if (string.IsNullOrWhiteSpace(line))
                        {
                            continue;
                        }

                        voices.Add(line);
                    }
                }

                Switch.InstalledVoices = voices.AsReadOnly();
            }
            catch (Exception e)
            {
                SysLog.LogException(e);
            }
        }