Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 849773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:09:23+00:00 2026-05-15T07:09:23+00:00

Here’s the deal. I’ve got a program that will load a given assembly, parse

  • 0

Here’s the deal. I’ve got a program that will load a given assembly, parse through all Types and their Members and compile a TreeView (very similar to old MSDN site) and then build HTML pages for each node in the TreeView. It basically takes a given assembly and allows the user to create their own MSDN-like library for it for documentation purposes.

Here’s the problem I’ve run into: whenever an operator overload is encounted in a defined class, reflection returns that as a “MethodInfo” with the name set to something like “op_Assign” or “op_Equality”. I want to be able to capture these and list them properly, but I can’t find anything in the MethodInfo object that is returned to accurately identify that I’m looking at an operator.

I definitely don’t want to just capture everything that starts with “op_”, since that will most certainly (at some point) will pick up a method it’s not supposed to. I know that other methods and properties that are “special cases” like this one have the “IsSpecialName” property set, but appearantly that’s not the case with operators.

I’ve been scouring the ‘net and wracking my brain to two days trying to figure this one out, so any help will be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T07:09:24+00:00Added an answer on May 15, 2026 at 7:09 am

    The op_ naming convention is a standard or defacto standard for .net. When reflecting, I would do something like this:

    public void GenerateDocForMethod(MethodInfo method)
    {
        if(method.Name.StartsWith("op_"))
            GenerateDocForOperator(method);
        else
            GenerateDocForStandardMethod(method);
    }
    
    public void GenerateDocForOperator(MethodInfo method)
    {
        switch(method.Name)
        {
            case "op_Addition":
            //generate and handle other cases...
    
            //handle methods that just happen to start with op_
            default:
                GenerateDocForStandardMethod(method);
        }
    }
    
    public void GenerateDocForStandardMethod(MethodInfo method)
    {
        //generate doc
    }
    

    GenerateDocForOperator will switch on all of the overloadable operators (don’t forget implicit and explicit conversions). If the method name is not one of the standard operator names, it calls the GenerateDocForStandardMethod. I couldn’t find an exhaustive list of operator method names but I could probably provide a complete list if you really need it.

    EDIT:
    Here’s a list of the method names of overloadable operators (taken from http://forums.devx.com/showthread.php?55322-Operator-Overloading…..C-can-do-it….&p=208952#post208952):

    op_Implicit
    op_Explicit
    op_Addition
    op_Subtraction
    op_Multiply
    op_Division
    op_Modulus
    op_ExclusiveOr
    op_BitwiseAnd
    op_BitwiseOr
    op_LogicalAnd
    op_LogicalOr
    op_Assign
    op_LeftShift
    op_RightShift
    op_SignedRightShift
    op_UnsignedRightShift
    op_Equality
    op_GreaterThan
    op_LessThan
    op_Inequality
    op_GreaterThanOrEqual
    op_LessThanOrEqual
    op_MultiplicationAssignment
    op_SubtractionAssignment
    op_ExclusiveOrAssignment
    op_LeftShiftAssignment
    op_ModulusAssignment
    op_AdditionAssignment
    op_BitwiseAndAssignment
    op_BitwiseOrAssignment
    op_Comma
    op_DivisionAssignment
    op_Decrement
    op_Increment
    op_UnaryNegation
    op_UnaryPlus
    op_OnesComplement

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 428k
  • Answers 428k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Many answers are possible. This one relies on the fact… May 15, 2026 at 1:21 pm
  • Editorial Team
    Editorial Team added an answer I believe you want to do this : var dirUserSelected… May 15, 2026 at 1:21 pm
  • Editorial Team
    Editorial Team added an answer If you're allergic to REs, you could use pyparsing: >>>… May 15, 2026 at 1:21 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.