title: InvokePattern.Invoke() is throwing error
body: <p>I am new to C#. I have to write a code to make an application run Automatically(Completely UI Automation) using C#. Below is the code I have written. </p>
  
  <pre><code>string file = textBox1.Text;
  string plnt_name = "Testing_Kabir_Plant";
  string sspe = "1CK1S01";
  string srev = "0";
  string spe = sspe + ", Rev:" + srev;
  
  ProcessStartInfo pro = new ProcessStartInfo(file);
  Process.Start(pro);
  
  Thread.Sleep(5000);
  AutomationElement RestoreTool = AutomationElement.RootElement.FindFirst(TreeScope.Descendants
      , new PropertyCondition(AutomationElement.AutomationIdProperty, "Form1"));
  Thread.Sleep(5000);
  
  AutomationElement selPlant = RestoreTool.FindFirst(TreeScope.Descendants
      , new PropertyCondition(AutomationElement.AutomationIdProperty, "comboBox1"));
  
  Thread.Sleep(5000);
  
  AutomationElementCollection ciPlants = selPlant.FindAll(TreeScope.Descendants
      , new PropertyCondition(AutomationElement.IsSelectionItemPatternAvailableProperty, true));
  
  foreach (AutomationElement aeplant in ciPlants)
  {
      SelectionItemPattern plant = (SelectionItemPattern)aeplant.GetCurrentPattern(SelectionItemPattern.Pattern);
      if (aeplant.Current.Name == plnt_name)
      {
          try
          {
              plant.Select();
          }
          catch (TimeoutException)
          {
          }
          break;
      }
  }
  
  AutomationElement getbut = RestoreTool.FindFirst(TreeScope.Descendants
      , new PropertyCondition(AutomationElement.AutomationIdProperty, "button5"));
  ((InvokePattern)getbut.GetCurrentPattern(InvokePattern.Pattern)).Invoke();
  
  Thread.Sleep(5000);
  
  AutomationElement speclist = RestoreTool.FindFirst(TreeScope.Descendants
      , new PropertyCondition(AutomationElement.AutomationIdProperty, "checkedListBox1"));
  
  AutomationElementCollection list = speclist.FindAll(TreeScope.Descendants
      , new PropertyCondition(AutomationElement.IsSelectionItemPatternAvailableProperty, true));
  foreach (AutomationElement each in list)
  {
      if (each.Current.Name == spe)
      {
          ((TogglePattern)each.GetCurrentPattern(TogglePattern.Pattern)).Toggle();
      }
  }
  
  AutomationElement log_fol = RestoreTool.FindFirst(TreeScope.Descendants
      , new PropertyCondition(AutomationElement.AutomationIdProperty, "textBox4"));
  ((ValuePattern)log_fol.GetCurrentPattern(ValuePattern.Pattern)).SetValue("E:" + @"\sample" + @"\sample" + @"\testing");
  
  Thread.Sleep(2000);
  AutomationElement finbut = RestoreTool.FindFirst(TreeScope.Descendants
      , new PropertyCondition(AutomationElement.AutomationIdProperty, "button1"));
  ((InvokePattern)finbut.GetCurrentPattern(InvokePattern.Pattern)).Invoke();
  </code></pre>
  
  <p>My tool asks for the exe file of the application to be executed and start the process of giving values automatically.
  The problem I am facing is that the last button, "button1", when invoked is throwing an exception "Specified method is not supported". This I am not facing with "button5". I don't understand why. Please help me in solving this.</p>
  
  <p>Thanks for the help in advance.</p>