Click here to Skip to main content
16,006,531 members
Home / Discussions / C#
   

C#

 
GeneralPluggin' in the Plug-In - HMOG Pin
Sebastian Schneider3-Sep-04 0:20
Sebastian Schneider3-Sep-04 0:20 
GeneralCant change the Expandable property from property grid Pin
pradeep_pc3-Sep-04 0:15
pradeep_pc3-Sep-04 0:15 
GeneralRe: Cant change the Expandable property from property grid Pin
sreejith ss nair3-Sep-04 2:40
sreejith ss nair3-Sep-04 2:40 
GeneralDisable write in comboBox C# Pin
adnanh752-Sep-04 22:35
adnanh752-Sep-04 22:35 
GeneralRe: Disable write in comboBox C# Pin
Syed Abdul Khader2-Sep-04 23:48
Syed Abdul Khader2-Sep-04 23:48 
GeneralRe: Disable write in comboBox C# Pin
shaunAustin2-Sep-04 23:48
shaunAustin2-Sep-04 23:48 
GeneralThanks Pin
adnanh752-Sep-04 23:50
adnanh752-Sep-04 23:50 
GeneralC# Accessors Pin
carradus2-Sep-04 21:57
carradus2-Sep-04 21:57 
I have two programs. One that will allow the specification of a long list of properties and the other that will use the data in these properties without changing them.

That is I want read/write access in the specification program and readonly access in the program that uses the data, but I want to use the same namespace/class for both. Further, I want to take one of the classes in the namespace and have an instantiation on the side that uses the data with both read and write access.

I have tried putting preprocessor instructions around the set accesors, but this clearly comes to grief when I try to have read and write access for an instantiation of one of the classes on the side that uses the data. (I can't use define or undefine).

I describe my problem in more detail below:

namespace Data
{
public class ADataSet
{
private int n;
....................

public int N
{
get {return n;}
set {n = value;}
}
....................
}
public class BDataSet
{
private int m;
....................

public int M
{
get {return m;}
set {m = value;}
}
....................
}
}

In the above, the first program requires read and write access to all properties. The second program requires readonly access, but also needs to create an additional object of type BDataSet with both read and write access.

There are hundreds of properties in each of ADataSet and BDataSet. How can I get round this problem without having two identical classes, one with readwrite and the other readonly access?

I have not yet got to grips with interfaces, but I don't think these will make any difference.




Roger
GeneralRe: C# Accessors Pin
leppie3-Sep-04 1:10
leppie3-Sep-04 1:10 
GeneralRe: C# Accessors Pin
carradus6-Sep-04 23:33
carradus6-Sep-04 23:33 
GeneralRe: C# Accessors Pin
leppie7-Sep-04 1:59
leppie7-Sep-04 1:59 
QuestionHow to get information of User? Pin
I am kai2-Sep-04 21:47
I am kai2-Sep-04 21:47 
AnswerRe: How to get information of User? Pin
Sebastian Schneider2-Sep-04 22:44
Sebastian Schneider2-Sep-04 22:44 
AnswerRe: How to get information of User? Pin
shaunAustin2-Sep-04 23:58
shaunAustin2-Sep-04 23:58 
Questionhow to use datatable Pin
PrasadVarma2-Sep-04 20:04
PrasadVarma2-Sep-04 20:04 
AnswerRe: how to use datatable Pin
sreejith ss nair2-Sep-04 20:50
sreejith ss nair2-Sep-04 20:50 
GeneralRe: how to use delegates? Pin
mav.northwind2-Sep-04 20:35
mav.northwind2-Sep-04 20:35 
GeneralRe: how to use delegates? Pin
mcsbzu2-Sep-04 20:45
mcsbzu2-Sep-04 20:45 
GeneralRe: how to use delegates? Pin
mav.northwind2-Sep-04 21:31
mav.northwind2-Sep-04 21:31 
GeneralRe: how to use delegates? Pin
sreejith ss nair2-Sep-04 20:48
sreejith ss nair2-Sep-04 20:48 
Generaldraw a dynamic polyline join line Pin
luming11223344552-Sep-04 16:43
luming11223344552-Sep-04 16:43 
QuestionCan I draw my system cursor in Direct3D? Pin
redleafong2-Sep-04 16:27
redleafong2-Sep-04 16:27 
AnswerRe: Can I draw my system cursor in Direct3D? Pin
LongRange.Shooter3-Sep-04 7:00
LongRange.Shooter3-Sep-04 7:00 
Generalcapturing keydown events Pin
jtmtv182-Sep-04 12:38
jtmtv182-Sep-04 12:38 
GeneralRe: capturing keydown events Pin
Heath Stewart2-Sep-04 14:47
protectorHeath Stewart2-Sep-04 14:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.