Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
AnswerRe: UTF-8 Not Displaying Unicode Pin
Curtis Schlak.6-Mar-09 4:05
Curtis Schlak.6-Mar-09 4:05 
AnswerRe: UTF-8 Not Displaying Unicode Pin
Guffa6-Mar-09 6:26
Guffa6-Mar-09 6:26 
Questionabout array and property Pin
clj198705036-Mar-09 2:59
clj198705036-Mar-09 2:59 
AnswerRe: about array and property Pin
musefan6-Mar-09 3:15
musefan6-Mar-09 3:15 
AnswerRe: about array and property Pin
Xmen Real 6-Mar-09 3:24
professional Xmen Real 6-Mar-09 3:24 
AnswerRe: about array and property Pin
clj198705036-Mar-09 3:58
clj198705036-Mar-09 3:58 
GeneralRe: about array and property Pin
musefan6-Mar-09 4:11
musefan6-Mar-09 4:11 
GeneralRe: about array and property PinPopular
Curtis Schlak.6-Mar-09 4:15
Curtis Schlak.6-Mar-09 4:15 
Ok, stay with me on this. Let's say that you have
public class TestClass
{
  private int[] _field;
}
Now, in a method of TestClass, you would have the following to reference the value of _field.
public class TestClass
{
  public void DoSomethingWithTheField()
  {
    if(null == _field)
    {
      this._field = new int[3]; // or just _field = new int[3];
    }
  }
  private int[] _field;
}
Now, let's add a property that allows getting and setting on _field.
public class TestClass
{
  public int[] Property
  {
    get { return _field; }
    set { _field = value; }
  }

  public void DoSomethingWithTheField()
  {
    if(null == _field)
    {
      this._field = new int[3]; // or just _field = new int[3];
    }
  }
  private int[] _field;
}
Now, you can have a method that will do something like this.
public class TestClass
{
  public void DoSomethingWithTheProperty(int secondValue)
  {
    this.Property[1] = secondValue; // or Property[1] = secondValue;
  }

  public int[] Property
  {
    get { return _field; }
    set { _field = value; }
  }

  public void DoSomethingWithTheField()
  {
    if(null == _field)
    {
      this._field = new int[3]; // or just _field = new int[3];
    }
  }
  private int[] _field;
}
You see? When you expose a property as an array of integers, you can just use it like an array of integers.

"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty

GeneralRe: about array and property Pin
Cybernate6-Mar-09 8:55
Cybernate6-Mar-09 8:55 
AnswerRe: about array and property Pin
Curtis Schlak.6-Mar-09 9:35
Curtis Schlak.6-Mar-09 9:35 
GeneralRe: about array and property Pin
Cybernate6-Mar-09 9:38
Cybernate6-Mar-09 9:38 
GeneralRe: about array and property Pin
Curtis Schlak.6-Mar-09 9:42
Curtis Schlak.6-Mar-09 9:42 
QuestionDisabling Crystal login Pin
twsted f86-Mar-09 2:56
twsted f86-Mar-09 2:56 
AnswerRe: Disabling Crystal login Pin
ABitSmart6-Mar-09 3:27
ABitSmart6-Mar-09 3:27 
AnswerRe: Disabling Crystal login Pin
monstale6-Mar-09 5:08
monstale6-Mar-09 5:08 
QuestionFull Screen Application Pin
stancrm6-Mar-09 2:56
stancrm6-Mar-09 2:56 
AnswerRe: Full Screen Application Pin
musefan6-Mar-09 3:13
musefan6-Mar-09 3:13 
AnswerRe: Full Screen Application Pin
Xmen Real 6-Mar-09 3:21
professional Xmen Real 6-Mar-09 3:21 
QuestionScrollBar makes XNA Freeze [modified] Pin
invader826-Mar-09 1:36
invader826-Mar-09 1:36 
AnswerRe: ScrollBar makes XNA Freeze Pin
Xmen Real 6-Mar-09 2:54
professional Xmen Real 6-Mar-09 2:54 
GeneralRe: ScrollBar makes XNA Freeze Pin
invader826-Mar-09 3:10
invader826-Mar-09 3:10 
GeneralRe: ScrollBar makes XNA Freeze Pin
Xmen Real 6-Mar-09 3:12
professional Xmen Real 6-Mar-09 3:12 
GeneralRe: ScrollBar makes XNA Freeze Pin
invader826-Mar-09 3:25
invader826-Mar-09 3:25 
GeneralRe: ScrollBar makes XNA Freeze Pin
Xmen Real 6-Mar-09 3:29
professional Xmen Real 6-Mar-09 3:29 
GeneralRe: ScrollBar makes XNA Freeze Pin
invader826-Mar-09 3:38
invader826-Mar-09 3:38 

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.