title: C# code to VB.net equivalent
body: <p>What is the equivalent of following C# code to VB.net code.</p>
  
  <pre><code>public void RaiseTotalTimeEvent(TotalTimeEventArgs e)
          {
              EventHandler&lt;TotalTimeEventArgs&gt; temp = TotalTimeEvent;
              if (temp != null)
              {
                  temp(this, e);
              }
          }
  </code></pre>
  
  <p><strong>EDIT</strong>
  Thanks for the answer.</p>
  
  <p>But all the answers looks like it was converted using some of the existing CODE converter.
  I have tried <a href="http://converter.telerik.com/" rel="nofollow">Telerik</a>,<a href="http://www.developerfusion.com/tools/convert/csharp-to-vb/" rel="nofollow">DeveloperFusion</a>, And others. All these tools generate same code like below and none of these work.
  Converted Code.</p>
  
  <pre><code>Public Sub RaiseTotalTimeEvent(e As TotalTimeEventArgs)
      Dim temp As EventHandler(Of TotalTimeEventArgs) = TotalTimeEvent
      RaiseEvent temp(Me, e)
  End Sub
  </code></pre>
  
  <p>Compiler Reports with this error:</p>
  
  <blockquote>
    <p>Error 8   'Public Event CountEvent(sender As Object, e As
    CountEventArgs)' is an event, and cannot be called directly. Use a
    'RaiseEvent' statement to raise an event.</p>
  </blockquote>