Click here to Skip to main content
15,889,266 members
Home / Discussions / C#
   

C#

 
AnswerRe: While MouseDown Pin
Not Active17-Oct-09 5:42
mentorNot Active17-Oct-09 5:42 
GeneralRe: While MouseDown Pin
Zap-Man17-Oct-09 5:46
Zap-Man17-Oct-09 5:46 
GeneralRe: While MouseDown Pin
Not Active17-Oct-09 6:15
mentorNot Active17-Oct-09 6:15 
AnswerRe: While MouseDown Pin
dojohansen18-Oct-09 0:49
dojohansen18-Oct-09 0:49 
QuestionOwner drawn TabControl doesn't act as I want it Pin
WebMaster17-Oct-09 0:20
WebMaster17-Oct-09 0:20 
AnswerRe: Owner drawn TabControl doesn't act as I want it Pin
WebMaster17-Oct-09 21:28
WebMaster17-Oct-09 21:28 
GeneralRe: Owner drawn TabControl doesn't act as I want it Pin
Dave Kreskowiak18-Oct-09 2:33
mveDave Kreskowiak18-Oct-09 2:33 
QuestionIndexing a property that returns an array. [modified] Pin
CaptainSeeSharp16-Oct-09 17:15
CaptainSeeSharp16-Oct-09 17:15 
Consider the following...

byte[] theArray = new byte[2];

byte[] TheArray
{
  get { return theArray; }
}

//and then I do this...

byte a = TheArray[0];

TheArray[1] = 255;


Can anyone explain what happens? I would assume a function call to get would be executed for each = TheArray[i]; Correct? What about TheArray[1] = 255;? If there is no set method it should still work, right? If not, I know it would if it were a method that returned an array. TheArray()[1] = 255; I guess my question is, does the C# compiler optimize this code so function calls are not performed when accessing the array through property and method invocations?

How would the set property method work with the indexer? Is that possible? What is the point in it if it were not. Allowing properties that handle arrays seems illogical, especially in the set method and in that you can index it like in the code sample, but.. and @!$#% WTF | :WTF: .


modified on Friday, October 16, 2009 11:24 PM

AnswerRe: Indexing a property that returns an array. [modified] Pin
Luc Pattyn16-Oct-09 17:49
sitebuilderLuc Pattyn16-Oct-09 17:49 
AnswerRe: Indexing a property that returns an array. Pin
dojohansen18-Oct-09 0:59
dojohansen18-Oct-09 0:59 
QuestionCouple of questions regarding Windows Service in C# Pin
Aryan S16-Oct-09 17:14
Aryan S16-Oct-09 17:14 
AnswerRe: Couple of questions regarding Windows Service in C# Pin
Dave Kreskowiak16-Oct-09 18:22
mveDave Kreskowiak16-Oct-09 18:22 
AnswerRe: Couple of questions regarding Windows Service in C# Pin
PIEBALDconsult17-Oct-09 5:40
mvePIEBALDconsult17-Oct-09 5:40 
QuestionForm flickering problem Pin
SimpleData16-Oct-09 9:55
SimpleData16-Oct-09 9:55 
AnswerRe: Form flickering problem Pin
Luc Pattyn16-Oct-09 10:25
sitebuilderLuc Pattyn16-Oct-09 10:25 
GeneralRe: Form flickering problem Pin
SimpleData16-Oct-09 11:24
SimpleData16-Oct-09 11:24 
GeneralRe: Form flickering problem Pin
Luc Pattyn16-Oct-09 12:40
sitebuilderLuc Pattyn16-Oct-09 12:40 
GeneralRe: Form flickering problem Pin
SimpleData16-Oct-09 23:19
SimpleData16-Oct-09 23:19 
GeneralRe: Form flickering problem Pin
Luc Pattyn17-Oct-09 2:18
sitebuilderLuc Pattyn17-Oct-09 2:18 
GeneralRe: Form flickering problem Pin
Lyon Sun17-Oct-09 4:14
Lyon Sun17-Oct-09 4:14 
GeneralRe: Form flickering problem Pin
Luc Pattyn17-Oct-09 4:18
sitebuilderLuc Pattyn17-Oct-09 4:18 
GeneralRe: Form flickering problem Pin
Lyon Sun17-Oct-09 8:09
Lyon Sun17-Oct-09 8:09 
GeneralRe: Form flickering problem Pin
Luc Pattyn17-Oct-09 8:35
sitebuilderLuc Pattyn17-Oct-09 8:35 
GeneralRe: Form flickering problem Pin
Lyon Sun17-Oct-09 10:27
Lyon Sun17-Oct-09 10:27 
QuestionFill Collection With Excel Sheet Column Names Pin
Kevin Marois16-Oct-09 7:14
professionalKevin Marois16-Oct-09 7:14 

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.