Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: Vista/Win7 Gadget's Flyout. Pin
Supriya Tonape2-Jul-09 6:38
Supriya Tonape2-Jul-09 6:38 
QuestionIndex was out of range. Must be non-negative and less than the size of the collection Pin
haleemasher2-Jul-09 0:22
haleemasher2-Jul-09 0:22 
AnswerRe: Index was out of range. Must be non-negative and less than the size of the collection Pin
N a v a n e e t h2-Jul-09 0:28
N a v a n e e t h2-Jul-09 0:28 
GeneralRe: Index was out of range. Must be non-negative and less than the size of the collection Pin
haleemasher2-Jul-09 0:37
haleemasher2-Jul-09 0:37 
GeneralRe: Index was out of range. Must be non-negative and less than the size of the collection Pin
Luc Pattyn2-Jul-09 0:54
sitebuilderLuc Pattyn2-Jul-09 0:54 
QuestionNonSerialized property. Pin
johnnycastle2-Jul-09 0:19
johnnycastle2-Jul-09 0:19 
AnswerRe: NonSerialized property. Pin
Keith Barrow2-Jul-09 1:56
professionalKeith Barrow2-Jul-09 1:56 
GeneralRe: NonSerialized property. Pin
dojohansen2-Jul-09 2:21
dojohansen2-Jul-09 2:21 
Just a few comments in addition to this (which is fine by me).

keefb wrote:
.Net has built-in serializers, and most classes are serializable with only a little extra effort


I find the attribute-driven serializers to be of limited use in some scenarios because of their inability to (de)serialize private fields. Although it is probably a better idea in most cases to implement ISerializable than to create one's own serialization framework I would actually like to have a reflection-based alternative to the framework serializer, so that when speed is not of the essence I could serialize private fields but have the convenience of the attribute-driven model.

(The reason the .net thing can't deserialize private fields is because it dynamically generates a serializer class for the type you want to serialize - thus it cannot access anything but public members, but is very fast once it has been created.)

keefb wrote:
All of the code I've seen for serialization has attributes to opt-in rather than opt out.


That's odd - the framework also has a [NonSerialized] attribute.

keefb wrote:
all the serialization I've worked with doesn't set private fields directly, but uses their equivalent properties instead


But not all properties are get-set, and they have to be for the serializer to use them. For example, I have some DAL classes that have a read-only public property to get the key of the corresponding record in the database, and I want the DAL to set the private field storing the value and only let the outside world read it. Which means the serialization features in .net can't do much for me unless I implement ISerializable, which means I have to do most of the work!
AnswerRe: NonSerialized property. Pin
dojohansen2-Jul-09 2:04
dojohansen2-Jul-09 2:04 
AnswerRe: NonSerialized property. Pin
johnnycastle2-Jul-09 2:43
johnnycastle2-Jul-09 2:43 
QuestionUI Delay [modified] Pin
viciouskinid1-Jul-09 23:28
viciouskinid1-Jul-09 23:28 
AnswerRe: UI Delay Pin
Henry Minute2-Jul-09 0:02
Henry Minute2-Jul-09 0:02 
GeneralRe: UI Delay Pin
Luc Pattyn2-Jul-09 1:09
sitebuilderLuc Pattyn2-Jul-09 1:09 
GeneralRe: UI Delay Pin
MumbleB2-Jul-09 2:08
MumbleB2-Jul-09 2:08 
QuestionOpen File Dialog Box Pin
Satish Pai1-Jul-09 23:10
Satish Pai1-Jul-09 23:10 
AnswerRe: Open File Dialog Box Pin
Manas Bhardwaj1-Jul-09 23:28
professionalManas Bhardwaj1-Jul-09 23:28 
GeneralRe: Open File Dialog Box Pin
Satish Pai1-Jul-09 23:30
Satish Pai1-Jul-09 23:30 
GeneralRe: Open File Dialog Box Pin
OriginalGriff1-Jul-09 23:37
mveOriginalGriff1-Jul-09 23:37 
GeneralRe: Open File Dialog Box Pin
Manas Bhardwaj1-Jul-09 23:37
professionalManas Bhardwaj1-Jul-09 23:37 
GeneralRe: Open File Dialog Box Pin
Satish Pai1-Jul-09 23:51
Satish Pai1-Jul-09 23:51 
GeneralRe: Open File Dialog Box Pin
Manas Bhardwaj2-Jul-09 0:11
professionalManas Bhardwaj2-Jul-09 0:11 
GeneralRe: Open File Dialog Box Pin
Satish Pai2-Jul-09 0:23
Satish Pai2-Jul-09 0:23 
AnswerRe: Open File Dialog Box Pin
J4amieC2-Jul-09 0:08
J4amieC2-Jul-09 0:08 
QuestionIListSource does not contain any data sources Pin
haleemasher1-Jul-09 23:03
haleemasher1-Jul-09 23:03 
AnswerRe: IListSource does not contain any data sources Pin
OriginalGriff1-Jul-09 23:21
mveOriginalGriff1-Jul-09 23:21 

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.