Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

C# Override referenced method

Posted on 2012-03-29
2
Medium Priority
?
249 Views
Last Modified: 2012-04-17
I'm seeking to extend and existing method that I've referenced in my VS2008 project.  I'm trying to extend the NUnit "Assert.True(Boolean sample)" to incorporate custom reporting functionality.  Where can I find an example doing this?  I've looked on Google and cannot find any great tutorials on this topic.
0
Comment
Question by:Phil5780
2 Comments
 
LVL 41

Assisted Solution

by:Kyle Abrahams
Kyle Abrahams earned 1000 total points
ID: 37783296
You would have to inherit the class and then override it.  Calling MyBase or base. as needed and adding other functionality.
0
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 1000 total points
ID: 37796960
You can create Extension method to existing class by creating a static method in a static class and passing this ClassName as first parameter. Please do refer http://msdn.microsoft.com/en-us/library/bb383977.aspx. Try to provide your own implementation this way. Otherwise Override the method and after the overriding the method do not forget to call base.Method()
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question