Solved

c# internal abstract class

Posted on 2014-12-26
1
193 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
1 Comment
 
LVL 33

Accepted Solution

by:
ste5an earned 500 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

685 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