?
Solved

c# internal abstract class

Posted on 2014-12-26
1
Medium Priority
?
207 Views
Last Modified: 2015-01-24
how will i access members of  internal abstract  class in another class with different name space.

sample ->

file name = a.cs
namespace xyz
{
internal abstract  class bm
    {
      public   bool abc(bool userDefined)
        {
            return true;
      }
   }
}



file name = b.cs

namespace ppp
{
    internal class kl  :    gh   // 2.2
    {
        private xyz.bm  b160 =  null ;    // i did this
      bool b0 = true;

       public void updateFeature(bool Check)  
        {
     
                b0 = this.b160.abc(Check);
             
       
        }

    }
}
0
Comment
Question by:rnsr
[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
1 Comment
 
LVL 35

Accepted Solution

by:
ste5an earned 1500 total points
ID: 40518399
An abstract class is only a basic template which cannot be instantiated. To "use" it, you need to create a class in your second namespace, which derives from it.

So this should work:

namespace ppp
{
	using xyz;
	
	class MyBMImpl : bm {}	

	internal class kl : gh
	{
		private MyBMImpl b160 =  new MyBMImpl();
		bool b0 = true;

		public void updateFeature(bool Check)  
		{     
			b0 = this.b160.abc(Check);            
		}
	}
}

Open in new window

 

p.s. please use the embed code button in future posts..
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

777 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