Ejemplo n.º 1
0
 public bool ExecuteCommand()
 {
     if (VoiceController.IsEnabled && VoiceController.RecognizedText != "")
     {
         RhinoApp.SendKeystrokes(VoiceController.RecognizedText, true);
         VoiceController.RecognizedText = "";
     }
     else
     {
         if (this._selectedToolGroup == null)
         {
             return(false);
         }
         for (int index = 0; index < this._selectedToolGroup.Length; ++index)
         {
             if (this._selectedToolGroup[index].IconBound.Contains(RiftViewportConduit.CursorInLeftViewport))
             {
                 RhinoApp.SendKeystrokes(this._selectedToolGroup[index].EnglishName, true);
             }
         }
     }
     this._selectedToolGroup = (RhinoTool[])null;
     this._voiceOn           = true;
     VoiceController.StopVoice();
     return(true);
 }
Ejemplo n.º 2
0
 protected virtual void DrawOverlay(DrawEventArgs e)
 {
     if (this._voiceOn)
     {
         VoiceController.StartVoice();
         this._voiceOn = false;
     }
     if (UserInput.MiniViewportsOn)
     {
         if (e.Viewport.Name == Viewports.MiniViewportTitles[2])
         {
             this.InitToolBar(e, this._popUpPosLeft);
             this.SelectionBox(e, RiftViewportConduit.CursorInLeftViewport);
             this.MenuLayout(e);
             this.ToolLayout(e);
             Point2d point2d = new Point2d((double)(this._popUpPosLeft.X - 30), (double)(this._popUpPosLeft.Y - 150));
             e.Display.Draw2dText(string.Format("Voice: {0}", (object)VoiceController.RecognizedText), this._voiceCommandColor, point2d, false, this._fontSize);
         }
         if (e.Viewport.Name == Viewports.MiniViewportTitles[0])
         {
             this.InitToolBar(e, this._popUpPosLeft);
             this.SelectionBox(e, RiftViewportConduit.CursorInLeftViewport);
             this.MenuLayout(e);
             this.ToolLayout(e);
             Point2d point2d = new Point2d((double)(this._popUpPosLeft.X - 30), (double)(this._popUpPosLeft.Y - 150));
             e.Display.Draw2dText(string.Format("Voice: {0}", (object)VoiceController.RecognizedText), this._voiceCommandColor, point2d, false, this._fontSize);
         }
         if (!(e.Viewport.Name == Viewports.MiniViewportTitles[1]))
         {
             return;
         }
         this.InitToolBar(e, this._popUpPosRight);
         this.SelectionBox(e, RiftViewportConduit.CursorInRightViewport);
         this.MenuLayout(e);
         this.ToolLayout(e);
         Point2d point2d1 = new Point2d((double)(this._popUpPosRight.X - 30), (double)(this._popUpPosRight.Y - 150));
         e.Display.Draw2dText(string.Format("Voice: {0}", (object)VoiceController.RecognizedText), this._voiceCommandColor, point2d1, false, this._fontSize);
     }
     else
     {
         if (e.Viewport.Name == Viewports.RiftViewportTitles[2])
         {
             this.InitToolBar(e, this._popUpPosLeft);
             this.SelectionBox(e, RiftViewportConduit.CursorInLeftViewport);
             this.MenuLayout(e);
             this.ToolLayout(e);
             Point2d point2d = new Point2d((double)(this._popUpPosLeft.X - 30), (double)(this._popUpPosLeft.Y - 150));
             e.Display.Draw2dText(string.Format("Voice: {0}", (object)VoiceController.RecognizedText), this._voiceCommandColor, point2d, false, this._fontSize);
         }
         if (e.Viewport.Name == Viewports.RiftViewportTitles[0])
         {
             this.InitToolBar(e, this._popUpPosLeft);
             this.SelectionBox(e, RiftViewportConduit.CursorInLeftViewport);
             this.MenuLayout(e);
             this.ToolLayout(e);
             Point2d point2d = new Point2d((double)(this._popUpPosLeft.X - 30), (double)(this._popUpPosLeft.Y - 150));
             e.Display.Draw2dText(string.Format("Voice: {0}", (object)VoiceController.RecognizedText), this._voiceCommandColor, point2d, false, this._fontSize);
         }
         if (!(e.Viewport.Name == Viewports.RiftViewportTitles[1]))
         {
             return;
         }
         this.InitToolBar(e, this._popUpPosRight);
         this.SelectionBox(e, RiftViewportConduit.CursorInRightViewport);
         this.MenuLayout(e);
         this.ToolLayout(e);
         Point2d point2d1 = new Point2d((double)(this._popUpPosRight.X - 30), (double)(this._popUpPosRight.Y - 150));
         e.Display.Draw2dText(string.Format("Voice: {0}", (object)VoiceController.RecognizedText), this._voiceCommandColor, point2d1, false, this._fontSize);
     }
 }