Solved

c# internal abstract class

Posted on 2014-12-26
1
184 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 32

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

706 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

18 Experts available now in Live!

Get 1:1 Help Now