title: VarType to GetType()
body: <p>I am converting a VB.NET project to C# and I got stuck on this if-loop, could anyone help me convert this? I am assuming that i'll need to use the GetType()-method for this but I'm not sure how.</p>
  
  <p>The Loop:</p>
  
  <pre><code>Private Sub oOpcGroup_DataChange(ByVal TransactionID As Integer, ByVal NumItems As Integer, ByRef ClientHandles() As Integer, ByRef ItemValues() As Object, ByRef Qualities() As Integer, ByRef TimeStamps() As Date)
  
      Dim i As Integer
  
      For i = 1 To NumItems
          If VarType(ItemValues(i)) And Not VariantType.Array Then
              txtSubValue.Text = ItemValues(i)
          Else
              MsgBox("Data type return error, returned array, expected single item", MsgBoxStyle.Critical, "Data Change Error")
              Exit Sub
          End If
      Next i
      Exit Sub
  End Sub
  </code></pre>
  
  <p>This is what I have so far:</p>
  
  <pre><code>void oOpcGroup_DataChange(int TransactionID, int NumItems, ref Array ClientHandles, ref Array ItemValues, ref Array Qualities, ref Array TimeStamps)    //Events OPCGroup
      {
  
          for (int i = 0; i &lt; NumItems; i++)
          {
              if(){
  
              }
              else
              {
                  MessageBox.Show("Expected single item.", "Data type return error.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
              }
          }
  
      }
  </code></pre>