/Community

A Support Community for SubMain Products
in Search
Welcome to SubMain Community Sign in | Join | Help

EventHandler

Last post 02-21-2008, 4:17 PM by Serge B.. 1 replies.
Sort Posts: Previous Next
  •  02-21-2008, 6:07 AM 454

    EventHandler

    Hi

     Been looking at Codeit.Right instead of FXCop, seems to work well, but with my code it only picked up things like add XML comment. But when I run FXCop it comes up with more, e.g.

    Error, Certainty 95, for UseGenericEventHandlerInstances

    Error, Certainty 95, for UseGenericEventHandlerInstances

    {

    Target : ????+ChangeTaskEventHandler (IntrospectionTargetType)

    Resolution : "Visual Basic generates EventHandler delegates

    for events that use the following pattern: Event MyEvent(

    ByVal Sender As Object, ByVal e as MyEventArgs). Change

    the event that defines EventHandler '????.ChangeTaskEventHandler'

    to use EventHandler<T> by defining the event type explicitly,

    e.g. Event MyEvent As EventHandler(Of MyEventArgs)

    ."

    Help : http://msdn2.microsoft.com/ms182178(VS.90).aspx (String)

    Category : Microsoft.Design (String)

    CheckId : CA1003 (String)

    RuleFile : Design Rules (String)

    Info : "Do not declare new delegates to be used as event handlers

    when targeting a version of the .NET Framework that

    supports generics. Use an instance EventHandler<T>

    instead."

    "

    Help : http://msdn2.microsoft.com/ms182178(VS.90).aspx (String)

    Category : Microsoft.Design (String)

    CheckId : CA1003 (String)

    RuleFile : Design Rules (String)

    Info : "Do not declare new delegates to be used as event handlers

    when targeting a version of the .NET Framework that

    supports generics. Use an instance EventHandler<T>

    instead."

    ????+ChangeTaskEventHandler (IntrospectionTargetType)

    Resolution : "Visual Basic generates EventHandler delegates

    for events that use the following pattern: Event MyEvent(

    ByVal Sender As Object, ByVal e as MyEventArgs). Change

    the event that defines EventHandler '????.ChangeTaskEventHandler'

    to use EventHandler<T> by defining the event type explicitly,

    e.g. Event MyEvent As EventHandler(Of MyEventArgs)

    ."

    Help : http://msdn2.microsoft.com/ms182178(VS.90).aspx (String)

    Category : Microsoft.Design (String)

    CheckId : CA1003 (String)

    RuleFile : Design Rules (String)

    Info : "Do not declare new delegates to be used as event handlers

    when targeting a version of the .NET Framework that

    supports generics. Use an instance EventHandler<T>

    instead."

    "

    Help : http://msdn2.microsoft.com/ms182178(VS.90).aspx (String)

    Category : Microsoft.Design (String)

    CheckId : CA1003 (String)

    RuleFile : Design Rules (String)

    Info : "Do not declare new delegates to be used as event handlers

    when targeting a version of the .NET Framework that

    supports generics. Use an instance EventHandler<T>

    instead."

    "Visual Basic generates EventHandler delegates

    for events that use the following pattern: Event MyEvent(

    ByVal Sender As Object, ByVal e as MyEventArgs). Change

    the event that defines EventHandler '????.ChangeTaskEventHandler'

    to use EventHandler<T> by defining the event type explicitly,

    e.g. Event MyEvent As EventHandler(Of MyEventArgs)

    ."

    Help : http://msdn2.microsoft.com/ms182178(VS.90).aspx (String)

    Category : Microsoft.Design (String)

    CheckId : CA1003 (String)

    RuleFile : Design Rules (String)

    Info : "Do not declare new delegates to be used as event handlers

    when targeting a version of the .NET Framework that

    supports generics. Use an instance EventHandler<T>

    instead."

    "

    Help : http://msdn2.microsoft.com/ms182178(VS.90).aspx (String)

    Category : Microsoft.Design (String)

    CheckId : CA1003 (String)

    RuleFile : Design Rules (String)

    Info : "Do not declare new delegates to be used as event handlers

    when targeting a version of the .NET Framework that

    supports generics. Use an instance EventHandler<T>

    instead."

    Help : http://msdn2.microsoft.com/ms182178(VS.90).aspx (String)

    Category : Microsoft.Design (String)

    CheckId : CA1003 (String)

    RuleFile : Design Rules (String)

    Info : "Do not declare new delegates to be used as event handlers

    when targeting a version of the .NET Framework that

    supports generics. Use an instance EventHandler<T>

    instead."

    Category : Microsoft.Design (String)

    CheckId : CA1003 (String)

    RuleFile : Design Rules (String)

    Info : "Do not declare new delegates to be used as event handlers

    when targeting a version of the .NET Framework that

    supports generics. Use an instance EventHandler<T>

    instead."

    CheckId : CA1003 (String)

    RuleFile : Design Rules (String)

    Info : "Do not declare new delegates to be used as event handlers

    when targeting a version of the .NET Framework that

    supports generics. Use an instance EventHandler<T>

    instead."

    RuleFile : Design Rules (String)

    Info : "Do not declare new delegates to be used as event handlers

    when targeting a version of the .NET Framework that

    supports generics. Use an instance EventHandler<T>

    instead."

    Info : "Do not declare new delegates to be used as event handlers

    when targeting a version of the .NET Framework that

    supports generics. Use an instance EventHandler<T>

    instead."

    when targeting a version of the .NET Framework that

    supports generics. Use an instance EventHandler<T>

    instead."

    Created : 21/02/2008 13:26:00 (DateTime)

    LastSeen : 21/02/2008 13:56:28 (DateTime)

    Status : Active (MessageStatus)

    Fix Category : Breaking (FixCategories)

    }

     

    Is CodeIt.Right likely to pick up these sort of improvements?

    21/02/2008 13:26:00 (DateTime)

    LastSeen : 21/02/2008 13:56:28 (DateTime)

    Status : Active (MessageStatus)

    Fix Category : Breaking (FixCategories)

    }

     

    Is CodeIt.Right likely to pick up these sort of improvements?

    21/02/2008 13:56:28 (DateTime)

    Status : Active (MessageStatus)

    Fix Category : Breaking (FixCategories)

    }

     

    Is CodeIt.Right likely to pick up these sort of improvements?

    Active (MessageStatus)

    Fix Category : Breaking (FixCategories)

    }

     

    Is CodeIt.Right likely to pick up these sort of improvements?

    Breaking (FixCategories)

    }

     

    Is CodeIt.Right likely to pick up these sort of improvements?

  •  02-21-2008, 4:17 PM 455 in reply to 454

    Re: EventHandler

    Thank you for you feedback. 

    We implement many Rules that cover the FxCop set but not all of them at the moment. We currently implement 75 rules with about 110 rule instances in the default profile. For comparison we have over 200 rules on our list to create - the FxCop set and well beyond. The rules you quoted above are on the list as well.

    BTW, the reason you have mostly XML comment and local variable violations is that you've been using FxCop and fixing reported issues manually. If you code a little then CodeIt.Right, it will pick up more problems and it will help you fix them too. Unlike FxCop :)

    Hopefully there will be community interest to develop some of the rules - CodeIt.Right includes SDK that allows for extending rule libraries via Custom Rule API.

     


    Thank you,
    Serge Baranovsky
    http://submain.com - .NET Developer Tools  |  Microsoft VB MVP  |  http://vbcity.com - VB Developer Community
    » » (Static Code Analysis + Automatic Refactoring) / Painless Coding Guidelines = CodeIt.Right - http://submain.com/codeit.right
    » » C#/VB .NET Coding Guidelines - FREE 100+ page ebook (PDF) http://submain.com/guidelines
View as RSS news feed in XML