Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
QuestionRotating an image Pin
suresh sahu1-Sep-05 6:05
suresh sahu1-Sep-05 6:05 
AnswerRe: Rotating an image Pin
leppie1-Sep-05 7:20
leppie1-Sep-05 7:20 
GeneralRe: Rotating an image Pin
suresh sahu3-Sep-05 21:31
suresh sahu3-Sep-05 21:31 
AnswerRe: Rotating an image Pin
Mohamad Al Husseiny2-Sep-05 15:08
Mohamad Al Husseiny2-Sep-05 15:08 
GeneralRe: Rotating an image Pin
suresh sahu3-Sep-05 21:28
suresh sahu3-Sep-05 21:28 
QuestionStill not understanding this stream thing Pin
Tom Wright1-Sep-05 5:50
Tom Wright1-Sep-05 5:50 
AnswerRe: Still not understanding this stream thing Pin
Guffa1-Sep-05 6:10
Guffa1-Sep-05 6:10 
AnswerRe: Still not understanding this stream thing Pin
S. Senthil Kumar1-Sep-05 6:11
S. Senthil Kumar1-Sep-05 6:11 
XML Serialization is a technique that allows to save your object's state in an XML file and read it back.

saveDialog.OpenFile() returns a Stream, most probably a FileStream, which is passed to the SaveAsXML function. That function then serializes the current instance (this, which is commMain.ComSettings) on which it was called to the stream passed to it.

The effect of running this code is that the commMain.ComSettings instance would have gotten serialized to the stream returned by OpenFile.

Tom Wright wrote:
And I may want to change this function so that it does not open saveFileDialog everytime, I may want to pass the name of the settings file instead.


Create a System.IO.FileStream yourself and pass it to SaveAsXML, like this
using (FileStream fs = new FileStream(filePath, ...)
{
  SaveAsXML(fs);
}


Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
Questiondeleting files Pin
OMalleyW1-Sep-05 4:53
OMalleyW1-Sep-05 4:53 
AnswerRe: deleting files Pin
Dan Neely1-Sep-05 5:02
Dan Neely1-Sep-05 5:02 
AnswerRe: deleting files Pin
Dave Kreskowiak1-Sep-05 6:31
mveDave Kreskowiak1-Sep-05 6:31 
GeneralRe: deleting files Pin
OMalleyW1-Sep-05 6:55
OMalleyW1-Sep-05 6:55 
GeneralRe: deleting files Pin
Dan Neely1-Sep-05 7:08
Dan Neely1-Sep-05 7:08 
GeneralRe: deleting files Pin
Dave Kreskowiak1-Sep-05 7:36
mveDave Kreskowiak1-Sep-05 7:36 
GeneralRe: deleting files Pin
OMalleyW1-Sep-05 8:08
OMalleyW1-Sep-05 8:08 
GeneralRe: deleting files Pin
Dan Neely2-Sep-05 3:24
Dan Neely2-Sep-05 3:24 
QuestionDatabinding Problem In My UserControl Pin
User 20930731-Sep-05 4:51
User 20930731-Sep-05 4:51 
QuestionDLL in C# Pin
osvaldorosario1-Sep-05 4:39
osvaldorosario1-Sep-05 4:39 
AnswerRe: DLL in C# Pin
Mohamad Al Husseiny1-Sep-05 8:43
Mohamad Al Husseiny1-Sep-05 8:43 
Questionhow to control scaner by C# Pin
anders horsson1-Sep-05 4:10
anders horsson1-Sep-05 4:10 
QuestionWatching Directory Pin
rakesh_nits1-Sep-05 3:55
rakesh_nits1-Sep-05 3:55 
AnswerRe: Watching Directory Pin
Dave Kreskowiak1-Sep-05 6:25
mveDave Kreskowiak1-Sep-05 6:25 
GeneralRe: Watching Directory Pin
rakesh_nits2-Sep-05 3:42
rakesh_nits2-Sep-05 3:42 
GeneralRe: Watching Directory Pin
Dave Kreskowiak2-Sep-05 11:40
mveDave Kreskowiak2-Sep-05 11:40 
Questionforbidden Internet explorer's button Pin
jzb1-Sep-05 3:30
jzb1-Sep-05 3:30 

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.