answersLogoWhite

0


Best Answer

Not sure if the constructors should be counted as methods, thus, there are 2 methods below:

  • GetMethodsOf() returns all methods, excluding the properties but including the constructors
  • GetRoutinesOf() similar to GetMethodsOf(), but also excluding the constructors

using System.Reflection;

///

/// generates a sequence of methodInfo of a type t, excluding the getters and the setters

/// constructors are included

///

///

///

static IEnumerable GetMethodsOf(Type t)

{

foreach (MethodInfo info in t.GetMethods())

{

if (!info.Name.StartsWith("get_") && !info.Name.StartsWith("set_"))

{ // properties are filtered

yield return info;

}

}

}

///

/// Similar to GetMethodsof(), but also excluding the constructors

///

///

///

static IEnumerable GetRoutinesOf(Type t)

{

foreach (MethodInfo info in GetMethodsOf(t))

{

if (!info.IsConstructor) // constructors are filtered

yield return info;

}

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program that displays information about methods along with the parameters excluding the set and get method defined for implementing the properties in c sharp?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What parameters must be indentical between OSPF routers in order to form an adjacency?

Area ID Timers Stub Flag Subnet Mask (excluding virtual links and Point-to-point links) and MTU are also important.


What three parameters must be indentical between OSPF routers in order to form an adjacency?

Area ID Timers Stub Flag Subnet Mask (excluding virtual links and Point-to-point links) and MTU are also important.


What is the driving distance From State Capital to State Capital excluding Alaska and Hawaii?

Too much information to display here.


What is Difference between properties rational numbers and integers?

The only mathematical difference is that the set of integers (excluding 0), with two exceptions, does not have inverses whereas the set of rational numbers (excluding 0) does. This is equivalent to the statement that the set of non-zero integers is not closed under division whereas the set of non-zero rationals is.


What is gross living area?

The total area of finished, above-grade residential space excluding unheated areas such as porches and balconies; the standard measure for determining the amount of space in residential properties.


Name a preposition that starts with the letter e?

· except · excepting · excluding


What is the minimum value of 6x plus 5y in the feasible region excluding point (0 0)?

The answer depends on the feasible region and there is no information on which to determine that.


What is an easy way to explain prophase?

Prophase is the first stage of any cell division (excluding interphase). This is the stage where a cell prepares it for upcoming cell division. Further properties can be found in books and elsewhere.


What jobs exclude math?

Jobs excluding math are jobs excluding human beings


How can you use the word excluding in a sentence?

I enjoy all the bands from the 70's, excluding ABBA.


Excluding residential calculations an ordinary outlet shall be calculated at?

Excluding residential calculations, an ordinary outlet shall be calculated at: Excluding residential calculations, an ordinary outlet shall be calculated at:


Is excluding a preposition?

It can be. It is a verb form used as a gerund (noun) or preposition . As a preposition, it lists an exception or exclusion. e.g. The cost, excluding tax, is two hundred dollars.