Solved

C# Override referenced method

Posted on 2012-03-29
2
237 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 40

Assisted Solution

by:Kyle Abrahams
Kyle Abrahams earned 250 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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

939 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

Need Help in Real-Time?

Connect with top rated Experts

1 Experts available now in Live!

Get 1:1 Help Now