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

C#

 
QuestionProblem of counting words from files [modified] Pin
Abhishek Joshi19-Apr-07 1:25
Abhishek Joshi19-Apr-07 1:25 
QuestionIs there any open source tool like Castor(for java) for .NET Pin
Gokulan Venattil19-Apr-07 1:24
Gokulan Venattil19-Apr-07 1:24 
AnswerRe: Is there any open source tool like Castor(for java) for .NET Pin
Judah Gabriel Himango19-Apr-07 4:19
sponsorJudah Gabriel Himango19-Apr-07 4:19 
QuestionObjectDataSource passing an empty object to the BLL when deleting Pin
Ricardo Casquete19-Apr-07 1:10
Ricardo Casquete19-Apr-07 1:10 
QuestionGet a list of resources in Outlook style control Pin
Kapil Singhal19-Apr-07 0:23
Kapil Singhal19-Apr-07 0:23 
AnswerRe: Get a list of resources in Outlook style control Pin
Christian Graus19-Apr-07 0:42
protectorChristian Graus19-Apr-07 0:42 
GeneralRe: Get a list of resources in Outlook style control Pin
Kapil Singhal19-Apr-07 0:53
Kapil Singhal19-Apr-07 0:53 
QuestionHow to serialize a C# class [modified] Pin
mail57235219-Apr-07 0:16
mail57235219-Apr-07 0:16 
I want to make my class serializable. It only has a few fields and I want to store the settings as XML. At the moment I use an XmlSerializer to serialise and deserialize the object but I have all the code in my program's main() method. What I want is to create an instance of my object in my main() and just call the object's own deserialize() method. What's the best way of doing this?

Currently:
MyObject obj;
XmlSerializer s = new XmlSerializer(typeof(MyObject));
TextReader r = new StreamReader("myobject.xml");
weights = (MyObject)s.Deserialize(r);
r.Close();

Prefer:
MyObject obj = new MyObject;
obj.deserialize();


I just want to say as well that there are so many examples out there that ignore the idea of object-oriented programming. If an object is serializable then that object should handle its own serialization. The necessary serialization code shouldn't end up in some separate method in the main() function.
AnswerRe: How to serialize a C# class Pin
vamsimohan2119-Apr-07 1:58
vamsimohan2119-Apr-07 1:58 
AnswerRe: How to serialize a C# class Pin
peterchen19-Apr-07 7:24
peterchen19-Apr-07 7:24 
QuestionGetting ListView Header Text Pin
Farhan Ali18-Apr-07 23:50
Farhan Ali18-Apr-07 23:50 
AnswerRe: Getting ListView Header Text Pin
Svetlin Panayotov19-Apr-07 0:00
Svetlin Panayotov19-Apr-07 0:00 
GeneralRe: Getting ListView Header Text Pin
Farhan Ali19-Apr-07 0:04
Farhan Ali19-Apr-07 0:04 
GeneralRe: Getting ListView Header Text Pin
Svetlin Panayotov19-Apr-07 4:45
Svetlin Panayotov19-Apr-07 4:45 
GeneralRe: Getting ListView Header Text Pin
Farhan Ali19-Apr-07 20:35
Farhan Ali19-Apr-07 20:35 
GeneralRe: Error in Webservice while using datatable Pin
sujithkumarsl18-Apr-07 23:44
sujithkumarsl18-Apr-07 23:44 
QuestionImporting of resources data for Visual Studio 2005 Pin
sfk_ers18-Apr-07 23:38
sfk_ers18-Apr-07 23:38 
QuestionDifference please..... Pin
Uday_Smile18-Apr-07 23:36
Uday_Smile18-Apr-07 23:36 
AnswerRe: Difference please..... Pin
jonwalmsley18-Apr-07 23:41
jonwalmsley18-Apr-07 23:41 
QuestionDataTable.Select - Something strange Pin
jonwalmsley18-Apr-07 23:34
jonwalmsley18-Apr-07 23:34 
QuestionFind System idle time Pin
Subrahmanyam K18-Apr-07 23:18
Subrahmanyam K18-Apr-07 23:18 
AnswerRe: Find System idle time Pin
jonwalmsley18-Apr-07 23:43
jonwalmsley18-Apr-07 23:43 
QuestionHow to localize a WinForm at run-time Pin
Mikael Wiberg18-Apr-07 22:42
Mikael Wiberg18-Apr-07 22:42 
AnswerRe: How to localize a WinForm at run-time Pin
stancrm18-Apr-07 22:49
stancrm18-Apr-07 22:49 
GeneralRe: How to localize a WinForm at run-time Pin
Mikael Wiberg18-Apr-07 22:59
Mikael Wiberg18-Apr-07 22:59 

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.