Click here to Skip to main content
15,916,432 members
Home / Discussions / C#
   

C#

 
AnswerRe: ActiveX controls are not supported. Pin
VJ Reddy27-Apr-12 14:02
VJ Reddy27-Apr-12 14:02 
QuestionUsage of xmlserializer with two different objects Pin
Ruud23827-Apr-12 7:55
Ruud23827-Apr-12 7:55 
AnswerRe: Usage of xmlserializer with two different objects Pin
ekolis27-Apr-12 9:17
ekolis27-Apr-12 9:17 
GeneralRe: Usage of xmlserializer with two different objects Pin
Ruud23830-Apr-12 22:38
Ruud23830-Apr-12 22:38 
GeneralRe: Usage of xmlserializer with two different objects Pin
ekolis1-May-12 3:24
ekolis1-May-12 3:24 
QuestionExchange Powershell with C# Pin
JD8627-Apr-12 5:31
JD8627-Apr-12 5:31 
Questioninclude a file Pin
__John_27-Apr-12 4:37
__John_27-Apr-12 4:37 
AnswerRe: include a file Pin
__John_27-Apr-12 4:42
__John_27-Apr-12 4:42 
GeneralRe: include a file Pin
Dave Kreskowiak27-Apr-12 8:13
mveDave Kreskowiak27-Apr-12 8:13 
GeneralRe: include a file Pin
PIEBALDconsult27-Apr-12 8:29
mvePIEBALDconsult27-Apr-12 8:29 
JokeRe: include a file Pin
Big Daddy Farang27-Apr-12 10:05
Big Daddy Farang27-Apr-12 10:05 
AnswerRe: include a file Pin
VJ Reddy27-Apr-12 5:03
VJ Reddy27-Apr-12 5:03 
AnswerRe: include a file PinPopular
PIEBALDconsult27-Apr-12 5:32
mvePIEBALDconsult27-Apr-12 5:32 
GeneralRe: include a file Pin
jschell28-Apr-12 7:39
jschell28-Apr-12 7:39 
QuestionC# Media Library Help ! Pin
O.Calderbank27-Apr-12 2:27
O.Calderbank27-Apr-12 2:27 
AnswerRe: C# Media Library Help ! Pin
Richard MacCutchan27-Apr-12 2:42
mveRichard MacCutchan27-Apr-12 2:42 
AnswerRe: C# Media Library Help ! Pin
Wes Aday27-Apr-12 10:03
professionalWes Aday27-Apr-12 10:03 
QuestionDocument opening/saving idiom Pin
Orjan Westin27-Apr-12 1:07
professionalOrjan Westin27-Apr-12 1:07 
AnswerRe: Document opening/saving idiom PinPopular
Pete O'Hanlon27-Apr-12 1:57
mvePete O'Hanlon27-Apr-12 1:57 
AnswerRe: Document opening/saving idiom Pin
PIEBALDconsult27-Apr-12 3:22
mvePIEBALDconsult27-Apr-12 3:22 
AnswerRe: Document opening/saving idiom Pin
Eddy Vluggen27-Apr-12 7:04
professionalEddy Vluggen27-Apr-12 7:04 
AnswerRe: Document opening/saving idiom Pin
OriginalGriff27-Apr-12 9:29
mveOriginalGriff27-Apr-12 9:29 
Yes, a stream would be more normal, although as the others have said, a file path option doesn't hurt.

One of the big strengths of passing a stream rather than a file is that the stream can be encapsulated in the containing class to form a compound document. If you think of your document as an excel sheet, then passing streams enables the excel file to contain a number of encapsulated sheets without your document being aware of it - you can't easily do that with files. Certainly, I would make the commitment to output to file at the highest level I can - if only so that I can easily reuse the lower level components.

foreach is a very, very useful construct: it can't replace a for loop, but it builds on it:
  • If you do not need to know the position of an element in a collection, using a foreach loop makes the code cleaner and easier to read - you aren't creating simple variables unnecessarily.
  • If you do not want the collection to change while you go though it, the a foreach is much better - any attempt to add or remove elements will cause a run time error immediately, rather than waiting until something goes out of range.
  • One of the hardest differences to get used to between C++ and C# is variable naming: gone is Hungarian notation, gone is m_blahblah, g_balhblah, and so forth! I've been using C# almost exclusively for a nuymber of years and I still call Buttons butOK and TextBoxes tbUserName! Laugh | :laugh:
    Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

    NewsExpand the text in the RichTextBox. Pin
    nqs_vn27-Apr-12 0:10
    nqs_vn27-Apr-12 0:10 
    AnswerRe: Expand the text in the RichTextBox. Pin
    VJ Reddy27-Apr-12 1:16
    VJ Reddy27-Apr-12 1:16 
    GeneralRe: Expand the text in the RichTextBox. Pin
    nqs_vn27-Apr-12 16:40
    nqs_vn27-Apr-12 16:40 

    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.