Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

c# internal abstract class

Posted on 2014-12-26
1
Medium Priority
?
209 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

609 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