Click here to Skip to main content
15,891,423 members
Home / Discussions / C#
   

C#

 
QuestionConvert SQL data to XML data using nHibernate Pin
DJ24524-Aug-09 2:56
DJ24524-Aug-09 2:56 
AnswerRe: Convert SQL data to XML data using nHibernate Pin
Henry Minute24-Aug-09 3:25
Henry Minute24-Aug-09 3:25 
QuestionExcel + C# Pin
GrgBalden24-Aug-09 2:16
GrgBalden24-Aug-09 2:16 
QuestionWorkbookEvents_SheetChangeEventHandler excel delegate Pin
NarVish24-Aug-09 2:16
NarVish24-Aug-09 2:16 
QuestionCollection properties should be readonly. Pin
deep724-Aug-09 1:47
deep724-Aug-09 1:47 
AnswerRe: Collection properties should be readonly. Pin
Henry Minute24-Aug-09 2:07
Henry Minute24-Aug-09 2:07 
GeneralRe: Collection properties should be readonly. Pin
Luc Pattyn24-Aug-09 3:26
sitebuilderLuc Pattyn24-Aug-09 3:26 
AnswerRe: Collection properties should be readonly. Pin
harold aptroot24-Aug-09 2:08
harold aptroot24-Aug-09 2:08 
Why are you using an ArrayList anyway? Are you using .NET 1?

Some things you could do:
- Create the new collection in the ctor of the containing class
- Make a method that takes an ArrayList and assigns that to the field/property which can then have a private setter (or no setter, if it's a field). This is not actually a good way though, it just sidesteps the problem and may generate an other warning
- Make a method that takes items to add to the ArrayList which may then not have to be exposed to the outside anymore
- Stop caring about FXCop (hey it's possible), what it says are not rules, but just guidelines. If you have good reason to ignore its advice then do it - or at least do not blindly follow its advice, following a mere guideline can cause an actual error (as is the case now).
Following the guidelines can lead to a good design, but also to hacking around just to follow guidelines while actually making the design worse.



GeneralRe: Collection properties should be readonly. Pin
Luc Pattyn24-Aug-09 3:27
sitebuilderLuc Pattyn24-Aug-09 3:27 
GeneralRe: Collection properties should be readonly. Pin
harold aptroot24-Aug-09 3:38
harold aptroot24-Aug-09 3:38 
AnswerRe: Collection properties should be readonly. [modified] Pin
Luc Pattyn24-Aug-09 2:11
sitebuilderLuc Pattyn24-Aug-09 2:11 
AnswerRe: Collection properties should be readonly. Pin
Super Lloyd24-Aug-09 3:40
Super Lloyd24-Aug-09 3:40 
Question.NET Remoting...how to? Pin
DIPAK@EMSYS24-Aug-09 1:13
DIPAK@EMSYS24-Aug-09 1:13 
Questionproblem in adding rows to datagrid Pin
myinstincts24-Aug-09 1:07
myinstincts24-Aug-09 1:07 
AnswerRe: problem in adding rows to datagrid Pin
DIPAK@EMSYS24-Aug-09 1:56
DIPAK@EMSYS24-Aug-09 1:56 
GeneralRe: problem in adding rows to datagrid Pin
DIPAK@EMSYS24-Aug-09 1:59
DIPAK@EMSYS24-Aug-09 1:59 
QuestionMS-Charts Pin
hhazan24-Aug-09 0:32
hhazan24-Aug-09 0:32 
AnswerRe: MS-Charts Pin
Dave Kreskowiak24-Aug-09 3:46
mveDave Kreskowiak24-Aug-09 3:46 
Questiondelete Pin
nhqlbaislwfiikqraqnm24-Aug-09 0:08
nhqlbaislwfiikqraqnm24-Aug-09 0:08 
GeneralRe: Firefox Password Backup program! Pin
harold aptroot24-Aug-09 0:29
harold aptroot24-Aug-09 0:29 
AnswerRe: Firefox Password Backup program! Pin
stancrm24-Aug-09 0:30
stancrm24-Aug-09 0:30 
GeneralMessage Closed Pin
24-Aug-09 0:56
nhqlbaislwfiikqraqnm24-Aug-09 0:56 
GeneralRe: Firefox Password Backup program! Pin
nhqlbaislwfiikqraqnm24-Aug-09 1:02
nhqlbaislwfiikqraqnm24-Aug-09 1:02 
GeneralRe: Firefox Password Backup program! Pin
stancrm24-Aug-09 1:05
stancrm24-Aug-09 1:05 
GeneralRe: Firefox Password Backup program! [modified] Pin
nhqlbaislwfiikqraqnm24-Aug-09 1:21
nhqlbaislwfiikqraqnm24-Aug-09 1: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.