Solved

c# internal abstract class

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Timely operations (on order of hours) from within a VM 3 63
Example of WebAPI 7 33
WPF issue with Trigger 2 113
Microsoft C++ code failing in executable that worked 9 108
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

839 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