Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

C# Override referenced method

Posted on 2012-03-29
2
Medium Priority
?
246 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

661 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