Click here to Skip to main content
15,905,508 members
Home / Discussions / C#
   

C#

 
GeneralRe: Select all Text in TextBox and Set cursor to Start Pin
StyleGuide27-Oct-08 3:10
StyleGuide27-Oct-08 3:10 
QuestionHow to retrieve sql database tables from the server for web application Pin
anithagaraga26-Oct-08 23:24
anithagaraga26-Oct-08 23:24 
AnswerRe: How to retrieve sql database tables from the server for web application Pin
Eddy Vluggen27-Oct-08 1:31
professionalEddy Vluggen27-Oct-08 1:31 
GeneralRe: How to retrieve sql database tables from the server for web application Pin
anithagaraga28-Oct-08 20:53
anithagaraga28-Oct-08 20:53 
Questionget/set properties with arrays Pin
Dewald26-Oct-08 22:40
Dewald26-Oct-08 22:40 
AnswerRe: get/set properties with arrays Pin
leppie26-Oct-08 22:45
leppie26-Oct-08 22:45 
GeneralRe: get/set properties with arrays Pin
Nagy Vilmos27-Oct-08 3:20
professionalNagy Vilmos27-Oct-08 3:20 
GeneralRe: get/set properties with arrays Pin
Dewald27-Oct-08 3:41
Dewald27-Oct-08 3:41 
williamnw wrote:
To follow on, you would be better to use methods to access the elements rather then the array


Why is that? To me it just seems more unwieldy. Here's an example why I think so:

Let's say you I have two instances of the above class and I want to set the value in one instance to be one bigger than the corresponding value in the other instance.

Using the methods as you recommend it would look like this:
MyFirstInstance.setItem(i, MySecondInstance.getItem(i)+1);
whereas, if using the get/set properties, it would look like this:
MyFirstInstance.MyArray[i] = MySecondInstance.MyArray[i]+1;

Both work, but to me the second line is just much more readable. Also, if I use the methods as suggested, I don't have access to MyArray.Length or any of the member methods of System.Array unless I explicitly code them.

What am I missing?
GeneralRe: get/set properties with arrays Pin
Nagy Vilmos27-Oct-08 4:34
professionalNagy Vilmos27-Oct-08 4:34 
GeneralRe: get/set properties with arrays Pin
Dewald27-Oct-08 3:30
Dewald27-Oct-08 3:30 
GeneralRe: get/set properties with arrays Pin
Mark Salsbery27-Oct-08 5:18
Mark Salsbery27-Oct-08 5:18 
GeneralRe: get/set properties with arrays Pin
Dewald27-Oct-08 5:38
Dewald27-Oct-08 5:38 
Questionmethod in interface Pin
George_George26-Oct-08 21:20
George_George26-Oct-08 21:20 
AnswerRe: method in interface Pin
Guffa26-Oct-08 22:39
Guffa26-Oct-08 22:39 
GeneralRe: method in interface Pin
George_George27-Oct-08 1:42
George_George27-Oct-08 1:42 
GeneralRe: method in interface Pin
DaveyM6927-Oct-08 2:53
professionalDaveyM6927-Oct-08 2:53 
GeneralRe: method in interface Pin
George_George27-Oct-08 3:44
George_George27-Oct-08 3:44 
GeneralRe: method in interface Pin
DaveyM6927-Oct-08 4:12
professionalDaveyM6927-Oct-08 4:12 
GeneralRe: method in interface Pin
George_George30-Oct-08 3:29
George_George30-Oct-08 3:29 
Questionstrongly named assembly issue Pin
George_George26-Oct-08 20:51
George_George26-Oct-08 20:51 
QuestionGet list of all emails in outlook / windows mail / express client Pin
EliottA26-Oct-08 16:22
EliottA26-Oct-08 16:22 
AnswerRe: Get list of all emails in outlook / windows mail / express client Pin
Thomas Stockwell27-Oct-08 1:51
professionalThomas Stockwell27-Oct-08 1:51 
GeneralRe: Get list of all emails in outlook / windows mail / express client Pin
EliottA27-Oct-08 2:11
EliottA27-Oct-08 2:11 
GeneralRe: Get list of all emails in outlook / windows mail / express client Pin
Thomas Stockwell27-Oct-08 2:17
professionalThomas Stockwell27-Oct-08 2:17 
GeneralRe: Get list of all emails in outlook / windows mail / express client Pin
EliottA27-Oct-08 2:53
EliottA27-Oct-08 2:53 

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.