473,804 Members | 2,143 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to declare properties across inherited interfaces.

Is it possible to have a property defined in one interface, with just
the get portioned stubbed out, and then in an interface inheriting from
that interface declare the set portion of the inherited stubbed out
property? So that only classes implementing the second interface can
set properties?

Jun 29 '06 #1
3 1880
DaTurk,

Unfortunately it is not possible.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"DaTurk" <mm******@hotma il.com> wrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
Is it possible to have a property defined in one interface, with just
the get portioned stubbed out, and then in an interface inheriting from
that interface declare the set portion of the inherited stubbed out
property? So that only classes implementing the second interface can
set properties?

Jun 29 '06 #2
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
DaTurk,

Unfortunately it is not possible.


Wow, interesting. I'll be honest - when I first read your post I thought
"there is no way that's not possible." So I went and tried it, and sure
enough you can't do it.

Why would this not be allowed?

--
Adam Clauss
Jun 29 '06 #3
I am able to do it using managed C++. I thought it was an interface
problem, but it was a casting problem. I have another post that
outlined what I did, because I was trying to figure out what was going
wrong, but sure enough I have the get portion in the parent interface,
and the set portion in the child interface and then implement them and
then cast the class instance to the child interface and I can set the
properties. All of the code is in C#, except the interface which are
in MCPP.

Jun 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
389
by: thechaosengine | last post by:
Hi all, Is there a way to hide a member in a subclass that has been inherited from a base class? Lets leave aside any issues regarding whether its a good idea for a moment. Here's an example similar to what I'm thinking about. Lets suppose I make a class called RoleCollection.
3
3183
by: John Baro | last post by:
I have a usercontrol that inherits from control. I want to "remove" properties that are not relevant (backcolor, backgroundimage) etc.. How can this be accomplished? TIA John
2
22314
by: Derrick | last post by:
How does one declare an event within an interface, so that every class which implements that interface must implement that event? I think I just need to specifiy the actual event as I would a function, but what about the delegate? Up to now, all my interfaces have only dealt with properties and functions. Here's basically what I want to do (for example): public interface IFoo
9
1644
by: Codex Twin | last post by:
Hi I have a common model for a Data Access Layer scenario. I have an abstract base class, called DalBase which contains a list of abstract methods. Lets call them: public abstract void Shine(); public abstract void Flow(); public abstract void Float(); I then have an inherited class, called DalMain which contains the concrete
1
1990
by: steve kain | last post by:
Hi. I'm just wondering how come the compiler complains when you declare a new sub as overridable but it then lets you define multiple new subs with different interfaces, essentially overriding each other. For example, this doesn't work: public overridable sub new()
2
1770
by: Pieter | last post by:
Hi, I just downloaded the TeeChart tool for easy drawing etc., and try to activate this from my own app. TeeChart comes with many classes, interfaces etc, etc. The problem is that I don't quite understand the structure of the TeeChart classes hierarchy. E.g. in the manual I found next VB .NET code for refering to the chart's left axis: TChart.Axis.Left
1
1230
by: Hans Ruck | last post by:
I'm trying to detect the interfaces directly inherited by a class. I've tried to use the Type.GetInterfaces method but in a situation like this: public interface I { void f(); } public interface I2 : I
3
2366
by: William Youngman | last post by:
I am on a team that is developing a proposal generation web application and we are using a custom base page (ProGenBase.cs) located in the app_code directory and all of the app's web pages inherit from this custom page. Additionally I have a main menu tab control that is located in a master page and certain tabs are displayed dependant on the users authentication level. I am using boolean properties in the master page to control the visible...
12
2106
by: Janaka Perera | last post by:
Hi All, We have done a object oriented design for a system which will create a class multiply inherited by around 1000 small and medium sized classes. I would be greatful if you can help me with the following: Can this create any problems with GNU g++ compilation, linking etc? What would be the impact to the performance of the system? Anything else we have to consider?
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10356
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10099
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3003
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.