Click here to Skip to main content
15,913,084 members
Home / Discussions / C#
   

C#

 
GeneralRe: capture window text in c# Pin
krinaljariwala5-Dec-09 1:02
krinaljariwala5-Dec-09 1:02 
GeneralRe: capture window text in c# [modified] Pin
Saksida Bojan5-Dec-09 1:21
Saksida Bojan5-Dec-09 1:21 
Questionword search puzzle Pin
choti74-Dec-09 22:58
choti74-Dec-09 22:58 
AnswerRe: word search puzzle [modified] Pin
DaveyM695-Dec-09 0:17
professionalDaveyM695-Dec-09 0:17 
QuestionSending packet to a specified IP address & predefined the contents of it... Pin
3bood.ghzawi4-Dec-09 22:07
3bood.ghzawi4-Dec-09 22:07 
AnswerMessage Closed Pin
4-Dec-09 22:46
stancrm4-Dec-09 22:46 
GeneralRe: Sending packet to a specified IP address & predefined the contents of it... Pin
3bood.ghzawi5-Dec-09 2:51
3bood.ghzawi5-Dec-09 2:51 
QuestionA Question About Class Properties Pin
Roger Wright4-Dec-09 17:15
professionalRoger Wright4-Dec-09 17:15 
I'm having trouble grasping the value of properties and the get/set accessors in C#. In my reading, typical examples are structured as:

public class SomeClass()
{
    private int myProperty;
    public int MyProperty
    {
        get {return myProperty;}
        set {myProperty = value;)
    }
}


I'm using this feature for the first time in a form that is created by a main form, and every data member collected by the child form is to be returned to the main form. The VS 2008 Designer did all the hard work for me, for which I'm duly grateful, but it created all the form data members as private, and the parent form can't access them. In keeping with what seems to be the preferred design philosophy of C#, I'm busy filling in public get/set accessor pairs for each member so the parent form can retrieve the data, but it seems kind of silly to me. Why not just make all the data members public and be done with it?

I realize this is quite a simple example, as it's my first serious attempt to make something useful with C#, but I really don't see the value of this construct. Can someone explain or provide examples of situations that would make this useful?Confused | :confused:

"A Journey of a Thousand Rest Stops Begins with a Single Movement"

AnswerRe: A Question About Class Properties Pin
PIEBALDconsult4-Dec-09 17:44
mvePIEBALDconsult4-Dec-09 17:44 
GeneralRe: A Question About Class Properties Pin
Roger Wright4-Dec-09 18:02
professionalRoger Wright4-Dec-09 18:02 
GeneralRe: A Question About Class Properties Pin
DaveyM694-Dec-09 21:06
professionalDaveyM694-Dec-09 21:06 
GeneralRe: A Question About Class Properties Pin
Roger Wright5-Dec-09 2:59
professionalRoger Wright5-Dec-09 2:59 
GeneralRe: A Question About Class Properties Pin
PIEBALDconsult5-Dec-09 4:17
mvePIEBALDconsult5-Dec-09 4:17 
AnswerRe: A Question About Class Properties Pin
Richard Blythe4-Dec-09 18:08
Richard Blythe4-Dec-09 18:08 
GeneralRe: A Question About Class Properties Pin
Roger Wright4-Dec-09 18:24
professionalRoger Wright4-Dec-09 18:24 
GeneralRe: A Question About Class Properties Pin
Richard Blythe4-Dec-09 18:39
Richard Blythe4-Dec-09 18:39 
GeneralRe: A Question About Class Properties Pin
Roger Wright4-Dec-09 18:58
professionalRoger Wright4-Dec-09 18:58 
AnswerRe: A Question About Class Properties Pin
Luc Pattyn5-Dec-09 3:06
sitebuilderLuc Pattyn5-Dec-09 3:06 
QuestionReading x64 registry keys from a x86 computer remotely Pin
Jacob Dixon4-Dec-09 14:53
Jacob Dixon4-Dec-09 14:53 
AnswerRe: Reading x64 registry keys from a x86 computer remotely Pin
Dave Kreskowiak4-Dec-09 17:05
mveDave Kreskowiak4-Dec-09 17:05 
GeneralRe: Reading x64 registry keys from a x86 computer remotely Pin
Jacob Dixon4-Dec-09 18:13
Jacob Dixon4-Dec-09 18:13 
GeneralRe: Reading x64 registry keys from a x86 computer remotely Pin
Dave Kreskowiak5-Dec-09 3:41
mveDave Kreskowiak5-Dec-09 3:41 
GeneralRe: Reading x64 registry keys from a x86 computer remotely Pin
Jacob Dixon5-Dec-09 4:04
Jacob Dixon5-Dec-09 4:04 
QuestionActivating a child form Pin
electriac4-Dec-09 13:20
electriac4-Dec-09 13:20 
AnswerRe: Activating a child form Pin
Luc Pattyn4-Dec-09 13:27
sitebuilderLuc Pattyn4-Dec-09 13:27 

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.