16,004,782 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by leprechauny (Top 19 by date)
leprechauny
7-May-13 16:37pm
View
Deleted
Sorry for reopening this thread after this long. I've haven't really had time to fiddle around with this project for a while.
public List<ListViewItem> SaveListView(ListView LV)
{
System.Collections.Generic.List<ListViewItem> lSavedLV = new List<ListViewItem>();
for (int i = 0; (i <= animalList.Count - 1); i++)
{
lSavedLV.Add(LV.Items[i]);
}
return lSavedLV;
}
Is that a plausible solution for the saving part? Is that the way to go, if I plan to fill the ListView with such serialised data? Is this then a matching loading method:
public ListView LoadListView(List<ListViewItem> L)
{
ListView lv = new ListView();
for (int i = 0; (i <= (L.Count - 1)); i++)
{
ListViewItem lvi = new ListViewItem();
lvi = ((ListViewItem)(L[i]));
lv.Items.Add(lvi);
}
return lv;
}
leprechauny
5-Apr-13 12:07pm
View
Ah, it's a System.Windows.Forms.ListView. I was thinking that the .AddRange would solve it easily but there is something that I'm missing.
leprechauny
4-Apr-13 16:04pm
View
Just a simple one. How would I, in the most appropriate way (is there ever one), populate a ListView with a List<ListViewItem>?
Thanks in advance!
leprechauny
3-Apr-13 17:41pm
View
Alright. So I'll make some changes to the helper methods so that they return a List<ListViewItem> - that also seems more plausible. Wouldn't one be able to populate the ListView quite easily with such a list as well?
Thanks for the quick and great comments by the way.
leprechauny
3-Apr-13 16:41pm
View
Ye, Sergey, that was pretty much what I was going for. And also what those helper methods was for, but obviously that was where I went wrong, it seems. The idea was that the data would be stored in the ArrayList, in order to avoid serializing the whole ListView control.
Anyways, could you specify or give me a hint of a data layer example? So I get an idea of where I'm to be headed.
leprechauny
1-Apr-13 1:13am
View
There is no actual error. Or, depending on one's viewpoint, there is. I'm unable to save a file with the current ListView data and then load it again, so to speak. The saving part seems to work, the problems lies with the loading of the saved data.
leprechauny
4-Mar-13 19:21pm
View
Well, this is one of the methods that are being called under one of the cases. I don't see why you don't qualify it as late binding?
public static Bird CreateBird(BirdSpecies Species)
{
Bird animalObj = null; //Unknown at this time
//Late binding
switch (Species)
{
case BirdSpecies.Eagle:
animalObj = new Eagle();
break;
case BirdSpecies.Pelican:
animalObj = new Pelican();
break;
default:
Debug.Assert(false, "To be filled.");
break;
}
//Sets category
animalObj.Category = CategoryType.Bird;
//Returns the created object
return animalObj;
}
leprechauny
9-Feb-13 20:06pm
View
Well, it is overridden in the base class as well. Somehow I thought this would nicely follow in a descending manner when working with polymorph and inheritance. Thanks, though. For clarifying it.
leprechauny
9-Feb-13 18:54pm
View
Having the input from run-time being print as name, age, cat, gender simply by calling base, instead of the second. Basically, I'm wondering why the second one works and not the first one, ought they not to work in the same way? What am I missing?
leprechauny
6-Feb-13 17:39pm
View
Cheers, I'll go through your articles. Thanks!
leprechauny
6-Feb-13 17:30pm
View
No. It's quite necessary actually. The thing I'm after is a function like "list all types" checkbox.
leprechauny
3-Feb-13 18:41pm
View
thanks a lot!
leprechauny
3-Feb-13 16:27pm
View
Ye, I assumed that would be part of it. And it seems to work. However, how should I successfully bind it - as you can see the first list is called lstCategory and the second is lstAnimalType - and I can't seem to figure it out. The 'Enum.Parse' just doesn't do it for me. Any advice?
leprechauny
7-Jan-13 14:19pm
View
Ah, seems good. Seems to work, however the following
resultTxt.AppendText("Port " + val[0] + " " + val[1] + "\r\n");
throws a nullrefexception
leprechauny
7-Jan-13 13:32pm
View
Seems fair. Is this done by using a delegate?
leprechauny
7-Jan-13 13:31pm
View
Yes, exactly. How am I going to go about to send the information from the background thread to the main thread using ProgressChanged event?
leprechauny
28-Dec-12 10:56am
View
How silly of me! Cheers, Dave. Great!
leprechauny
28-Dec-12 10:49am
View
I receive the uptime of the system since last reboot. And for the moment being I only get a static such. The counter doesn't go on ticking, so to speak.
leprechauny
29-Oct-12 16:41pm
View
Well, as indicated and correctly assumed there are only four levels. So exactly as you suggest I think it's plausible to use an array to hold the different levels. However, the real number of sellers are six. But is that really an issue? That is, the numbers of sellers ought to be irrelevant when you determine which level has that been reached.
Show More