コード例 #1
0
        // Token: 0x06000487 RID: 1159 RVA: 0x00017358 File Offset: 0x00015558
        public void LoadDictionary(string path)
        {
            bool flag = global::System.IO.File.Exists(path);

            if (flag)
            {
                using (global::System.IO.StreamReader streamReader = new global::System.IO.StreamReader(global::System.IO.File.OpenRead(path), global::System.Text.Encoding.UTF8))
                {
                    global::VRGIN.Controls.Speech.VoiceCommand voiceCommand = null;
                    while (!streamReader.EndOfStream)
                    {
                        string text  = streamReader.ReadLine().Trim().ToLowerInvariant();
                        bool   flag2 = global::VRGIN.Controls.Speech.DictionaryReader.IsCommand(text);
                        if (flag2)
                        {
                            bool flag3 = this._Dictionary.TryGetValue(global::VRGIN.Controls.Speech.DictionaryReader.ExtractCommand(text), ref voiceCommand);
                            if (flag3)
                            {
                                voiceCommand.Texts.Clear();
                            }
                        }
                        else
                        {
                            bool flag4 = voiceCommand != null && text.Length > 0;
                            if (flag4)
                            {
                                voiceCommand.Texts.Add(text);
                            }
                        }
                    }
                }
            }
        }
コード例 #2
0
        // Token: 0x060004A2 RID: 1186 RVA: 0x00017D5C File Offset: 0x00015F5C
        public VoiceShortcut(global::VRGIN.Controls.Speech.VoiceCommand command, global::System.Action action)
        {
            this._Action  = action;
            this._Command = command;
            bool flag = global::VRGIN.Core.VR.Speech;

            if (flag)
            {
                global::VRGIN.Core.VR.Speech.SpeechRecognized += new global::System.EventHandler <global::VRGIN.Controls.Speech.SpeechRecognizedEventArgs>(this.OnRecognized);
            }
        }
コード例 #3
0
 // Token: 0x0600048A RID: 1162 RVA: 0x00017568 File Offset: 0x00015768
 private void BuildCommandDictionary()
 {
     foreach (global::System.Reflection.FieldInfo fieldInfo in global::VRGIN.Controls.Speech.DictionaryReader.ExtractCommands(this.BaseType))
     {
         global::VRGIN.Controls.Speech.VoiceCommand voiceCommand = fieldInfo.GetValue(null) as global::VRGIN.Controls.Speech.VoiceCommand;
         bool flag = voiceCommand != null;
         if (flag)
         {
             this._Dictionary[fieldInfo.Name.ToLowerInvariant()] = voiceCommand;
         }
     }
 }
コード例 #4
0
 // Token: 0x06000488 RID: 1160 RVA: 0x00017428 File Offset: 0x00015628
 public void SaveDictionary(string path)
 {
     this.EnsurePath(path);
     using (global::System.IO.StreamWriter streamWriter = new global::System.IO.StreamWriter(global::System.IO.File.Open(path, 4), global::System.Text.Encoding.UTF8))
     {
         streamWriter.BaseStream.SetLength(0L);
         foreach (global::System.Reflection.FieldInfo fieldInfo in global::VRGIN.Controls.Speech.DictionaryReader.ExtractCommands(this.BaseType))
         {
             streamWriter.WriteLine("[{0}]", fieldInfo.Name);
             global::VRGIN.Controls.Speech.VoiceCommand voiceCommand = fieldInfo.GetValue(null) as global::VRGIN.Controls.Speech.VoiceCommand;
             bool flag = voiceCommand != null;
             if (flag)
             {
                 foreach (string text in voiceCommand.Texts)
                 {
                     streamWriter.WriteLine(text);
                 }
             }
             streamWriter.WriteLine();
         }
     }
 }