Click here to Skip to main content
15,902,939 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to return/store references on objects Pin
Heath Stewart26-Jan-04 8:55
protectorHeath Stewart26-Jan-04 8:55 
GeneralRe: How to return/store references on objects Pin
Not Active26-Jan-04 9:56
mentorNot Active26-Jan-04 9:56 
GeneralRe: How to return/store references on objects Pin
Jörgen Sigvardsson26-Jan-04 10:14
Jörgen Sigvardsson26-Jan-04 10:14 
GeneralRe: How to return/store references on objects Pin
Not Active26-Jan-04 10:18
mentorNot Active26-Jan-04 10:18 
GeneralRe: How to return/store references on objects Pin
Jörgen Sigvardsson26-Jan-04 10:20
Jörgen Sigvardsson26-Jan-04 10:20 
GeneralRe: How to return/store references on objects Pin
Heath Stewart26-Jan-04 10:41
protectorHeath Stewart26-Jan-04 10:41 
GeneralRe: How to return/store references on objects Pin
Jörgen Sigvardsson26-Jan-04 12:41
Jörgen Sigvardsson26-Jan-04 12:41 
AnswerRe: How to return/store references on objects Pin
Heath Stewart26-Jan-04 8:53
protectorHeath Stewart26-Jan-04 8:53 
Properties and fields, a basic element of objects:
public class MyClass
{
  private object o1;
  private object o2;
  public MyClass()
  {
  }
  public object O1
  {
    get { return this.o1; }
    set { this.o1 = value; }
  }
  public object O2
  {
    get { return this.o2; }
    set { this.o2 = value; }
  }
}
Can you use fields instead if they are public, but properties are recommended because you can check the value before assigning them to your private fields ("store").

You should read the topics discussed in the .NET Framework SDK as well as vast collection of articles here on CodeProject for examples.

If you're talking about serialization, see http://msdn.microsoft.com/library/en-us/cpguide/html/cpovrserializingobjects.asp[^]. This gives an overview of serialiation as well as advanced topics and many examples using binary and SOAP serialization, as well as the more basic XML Serialization (which doesn't handle everything that true serialization, but is good to use in many cases such as storing configuration options and application state. There are several articles here on CodeProject that discuss those. Just do a search for serialiation.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralCEMAPI use in C# :confused: Pin
camasmartin26-Jan-04 7:08
camasmartin26-Jan-04 7:08 
GeneralRe: CEMAPI use in C# :confused: Pin
Heath Stewart26-Jan-04 8:47
protectorHeath Stewart26-Jan-04 8:47 
GeneralReferring to a 2D array through a 1D array Pin
crushinghellhammer26-Jan-04 6:50
crushinghellhammer26-Jan-04 6:50 
GeneralRe: Referring to a 2D array through a 1D array Pin
Anonymous26-Jan-04 8:21
Anonymous26-Jan-04 8:21 
GeneralRe: Referring to a 2D array through a 1D array Pin
crushinghellhammer26-Jan-04 14:25
crushinghellhammer26-Jan-04 14:25 
GeneralRe: Referring to a 2D array through a 1D array Pin
Heath Stewart26-Jan-04 9:06
protectorHeath Stewart26-Jan-04 9:06 
GeneralRe: Referring to a 2D array through a 1D array Pin
crushinghellhammer26-Jan-04 14:37
crushinghellhammer26-Jan-04 14:37 
GeneralRe: Referring to a 2D array through a 1D array Pin
Heath Stewart27-Jan-04 2:46
protectorHeath Stewart27-Jan-04 2:46 
GeneralRe: Referring to a 2D array through a 1D array Pin
crushinghellhammer27-Jan-04 8:21
crushinghellhammer27-Jan-04 8:21 
GeneralRe: Referring to a 2D array through a 1D array Pin
crushinghellhammer27-Jan-04 8:23
crushinghellhammer27-Jan-04 8:23 
GeneralRe: Referring to a 2D array through a 1D array Pin
Heath Stewart27-Jan-04 8:58
protectorHeath Stewart27-Jan-04 8:58 
GeneralRe: Referring to a 2D array through a 1D array Pin
crushinghellhammer27-Jan-04 9:01
crushinghellhammer27-Jan-04 9:01 
GeneralRe: Referring to a 2D array through a 1D array Pin
Heath Stewart27-Jan-04 9:08
protectorHeath Stewart27-Jan-04 9:08 
GeneralRe: Referring to a 2D array through a 1D array Pin
crushinghellhammer27-Jan-04 8:50
crushinghellhammer27-Jan-04 8:50 
GeneralPreview in Open Dialog box Pin
Shree26-Jan-04 6:23
Shree26-Jan-04 6:23 
GeneralRe: Preview in Open Dialog box Pin
Heath Stewart26-Jan-04 8:43
protectorHeath Stewart26-Jan-04 8:43 
GeneralUploading Images Pin
srt726-Jan-04 4:36
srt726-Jan-04 4:36 

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.