Click here to Skip to main content
15,885,546 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to read/load a certificate stored in a JKS (Java key stores) file format, in .NET (C#) Pin
jkirkerx8-Apr-20 9:38
professionaljkirkerx8-Apr-20 9:38 
QuestionBackground Data Tables In C# Pin
Member 133258467-Apr-20 0:21
Member 133258467-Apr-20 0:21 
AnswerRe: Background Data Tables In C# Pin
Gerry Schmitz7-Apr-20 6:52
mveGerry Schmitz7-Apr-20 6:52 
AnswerRe: Background Data Tables In C# Pin
Mycroft Holmes7-Apr-20 11:11
professionalMycroft Holmes7-Apr-20 11:11 
AnswerRe: Background Data Tables In C# Pin
#realJSOP8-Apr-20 5:45
mve#realJSOP8-Apr-20 5:45 
GeneralRe: Background Data Tables In C# Pin
Mycroft Holmes8-Apr-20 13:15
professionalMycroft Holmes8-Apr-20 13:15 
GeneralRe: Background Data Tables In C# Pin
#realJSOP9-Apr-20 3:37
mve#realJSOP9-Apr-20 3:37 
QuestionNeed some tips... Sharing a collection of classes for display in a listbox? Pin
DaveHopeDev14-Apr-20 10:58
DaveHopeDev14-Apr-20 10:58 
Ok, very basic to you guys but I'm hoping someone can offer some advice.

I'm making a parking lot windows forms project and have a class structure of:

Vehicle
Car:Vehicle
Van:Vehicle
etc.

Then a ParkingLot class which declares a private Dictionary collection of type <string, vehicle=""> to store all the instances. The key is a parking space code e.g. A1, A2, B1, B2 etc, which then returns the vehicle object associated with that slot in the parking lot.

I've made the dictionary private so that all of the functionality is contained in the parkinglot class and the form button presses etc only update the dictionary via public methods in that class for abstraction/separation of concerns (if that's the correct terminology!). The contents of the dictionary are currently displayed in a textbox by calling a parkinglot.displayinventory method which loops through the dictionary items and uses a stringbuilder to create and return the details of all the items to display in the textbox.

All was fine, however, now I want to change it to display the contents in a listbox rather than a text box and now I'm questioning whether using a dictionary object was a good idea (I was thinking of the efficiency of retrieval O(1) of dictionary vs O(n) of list and all that).

Should I just use a public List<vehicle> which I can then bind to the listbox? But then I thought from an abstraction point of view, having the list of items accessible from the form/view was a bad thing?? Should I stick with a private dictionary for efficient retrieval and create and return a readonlycollection object from the displayinventory method for binding (or something similar)?

It's been a while since I've worked with collections and classes and things like this and I've confused myself no end with something so simple! Any tips much appreciated Smile | :)
AnswerRe: Need some tips... Sharing a collection of classes for display in a listbox? Pin
Luc Pattyn4-Apr-20 11:57
sitebuilderLuc Pattyn4-Apr-20 11:57 
GeneralRe: Need some tips... Sharing a collection of classes for display in a listbox? Pin
DaveHopeDev14-Apr-20 22:45
DaveHopeDev14-Apr-20 22:45 
GeneralRe: Need some tips... Sharing a collection of classes for display in a listbox? Pin
Luc Pattyn5-Apr-20 2:11
sitebuilderLuc Pattyn5-Apr-20 2:11 
GeneralRe: Need some tips... Sharing a collection of classes for display in a listbox? Pin
DaveHopeDev15-Apr-20 6:18
DaveHopeDev15-Apr-20 6:18 
GeneralRe: Need some tips... Sharing a collection of classes for display in a listbox? Pin
Luc Pattyn5-Apr-20 6:21
sitebuilderLuc Pattyn5-Apr-20 6:21 
AnswerRe: Need some tips... Sharing a collection of classes for display in a listbox? Pin
Mycroft Holmes4-Apr-20 12:41
professionalMycroft Holmes4-Apr-20 12:41 
AnswerRe: Need some tips... Sharing a collection of classes for display in a listbox? Pin
Gerry Schmitz5-Apr-20 11:03
mveGerry Schmitz5-Apr-20 11:03 
AnswerRe: Need some tips... Sharing a collection of classes for display in a listbox? Pin
BillWoodruff7-Apr-20 0:11
professionalBillWoodruff7-Apr-20 0:11 
AnswerRe: Need some tips... Sharing a collection of classes for display in a listbox? Pin
James Curran7-Apr-20 4:36
James Curran7-Apr-20 4:36 
QuestionFlowlayoutpanel Filter Pin
lakith sandeepa3-Apr-20 20:48
lakith sandeepa3-Apr-20 20:48 
AnswerRe: Flowlayoutpanel Filter Pin
OriginalGriff3-Apr-20 21:32
mveOriginalGriff3-Apr-20 21:32 
AnswerRe: Flowlayoutpanel Filter Pin
Dave Kreskowiak4-Apr-20 4:28
mveDave Kreskowiak4-Apr-20 4:28 
QuestionTraces and Service not shown in Jaeger UI on host server used C# client (tracer) for Jaeger Pin
yuvraj vichare2-Apr-20 18:46
yuvraj vichare2-Apr-20 18:46 
AnswerRe: Traces and Service not shown in Jaeger UI on host server used C# client (tracer) for Jaeger Pin
Richard Andrew x644-Apr-20 8:46
professionalRichard Andrew x644-Apr-20 8:46 
QuestionGet names for all opened Workbook Pin
Member 133187482-Apr-20 4:52
Member 133187482-Apr-20 4:52 
AnswerRe: Get names for all opened Workbook Pin
Richard MacCutchan2-Apr-20 5:50
mveRichard MacCutchan2-Apr-20 5:50 
QuestionEditor, Visualization, C# Pin
Calin Negru1-Apr-20 4:29
Calin Negru1-Apr-20 4:29 

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.