Strangely, the code originally posted[1] had BeginUpdate/EndUpdate (it
was the first thing I looked for in the code).
[1]
listImports is a ListView
Hostnames is a Hashtable
HostnameListViewItem is a ListViewItem
listImports.BeginUpdate();
foreach(string hostname in hostnameController.Hostnames.Key
Peter Ritchie wrote:
> I think there is some confusion on how the use of Add() is being done in my
> examples. I am wrapping them (actually, the whole loop) with
> listView.BeginUpdate() and listView.EndUpdate().
Good point. Begin/EndUpdate are helpful, but I've just had better
luck with AddRan
Steve:
We agree on the numbers being almost completely meaningless.
I think there is some confusion on how the use of Add() is being done in my
examples. I am wrapping them (actually, the whole loop) with
listView.BeginUpdate() and listView.EndUpdate(). This essentially
duplicates what AddRange
Peter Ritchie wrote:
> Not using an ArrayList (and using a ListViewItem array) is faster; but it's
> still slower than individual calls to Add, by less than 11%.
I hate to be argumentative about this :)
Numbers really are almost completely meaningless to me on this issue.
Forget the numbers. Pu
Not using an ArrayList (and using a ListViewItem array) is faster; but it's
still slower than individual calls to Add, by less than 11%.
I know, it goes against logic. Maybe .NET 2.0 will be better.
-- Peter
On Thu, 24 Mar 2005 17:48:49 -0500, Jamin Guy <[EMAIL PROTECTED]> wrote:
>>where the A
>where the AddRange snippet is as follows:
> listView.BeginUpdate();
> ArrayList list = new ArrayList();
> for(int i = 1; i < 65300; ++i)
> list.Add(new ListViewItem(i.ToString()));
> listView.Items.AddRange((ListViewItem[])list.ToArray(typeof(ListViewItem)));
> listView.EndUpdate();
I still beli
GetCustomAttribute*s* (note the plural form) returns an array, hence
the indexer [0]. The AssemblyDescriptionAttribute class is attributed
itself with [AttributeUsage(AttributeTargets.Assembly,
AllowMultiple=false)], which means that you can use it once per
assembly, hence again the index 0 used by
Hey All,
I have a MDI application, having some remoting tech.
When a lauching thread (not UI thread) goes to display a dialog box, the focus
is lost. But if it runs inside MDE , the focus is right.
So anyone knows how to regain the focus easily?
Thanks in advance
Tracy Ding at xypro.com
Steve:
I've actually found that the following is *faster* than AddRange:
listView.BeginUpdate();
for(int i = 1; i < 65300; ++i)
listView.Items.Add(i.ToString());
listView.EndUpdate();
where the AddRange snippet is as follows:
listView.BeginUpdate();
ArrayList list = new ArrayList();
for(i
This works great, thanks! The "[0]" implies there might be more than one.
So if there were two or more, they might be referenced by
GetCustomAttributes(typeof(AssemblyDescriptionAttribute), true)[1];
for example. If this is the case, what would be the syntax of the source
assembly info?
---
Peter Ritchie wrote:
> In addition to the AddRange sugeestions (which, by my profiling only
> increases performance by <8%); I would suggest reconsidering whether a list
> view is an appropriate method to navigate 65000+ items.
Your point about reconsidering design is a good one. However,
profil
Jamin:
In addition to the AddRange sugeestions (which, by my profiling only
increases performance by <8%); I would suggest reconsidering whether a list
view is an appropriate method to navigate 65000+ items. The only thing a
list view gives you in this case is the ability to "search" for entries
Help: error in code that creates dynamically generated and compiled dll
help please
Certain times in the day I get the
following error (code creates dynamically compiled dll help please) any
input as to why the error is generated. Can anyone decipher the error
below? I would appreciate any help
(Apologies for the advertisement, but it seems appropriate given the
question.)
My company's product (Kinitos Application Management) does exactly this. We
provide a lightweight, agent-based, offline-capable deployment system that
can handle any sort of installation (Win32 apps, Java, etc.) but is
Thanks Steve. Here's what I ended up with[1]. Saves me from having to
convert the ArrayList. Works SO much faster!
[1]
ListViewItem[] items = new listViewItem[hostnameController.Hostnames.Count];
int i = 0;
foreach(string hostname in hostnameController.Hostnames.Keys)
{
items[i++] = new Hostn
Have you tried AddRange instead of Add? It seems to be faster from what
I've done in the past.
Best Regards,
Mark Smith
DevelopMentor
http://www.develop.com
-Original Message-
From: Unmoderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Jamin Guy
Sent: Thu
Jamin Guy wrote:
> This bit of code[1] runs very slow because I have to add 65000+
> ListViewItems to the ListView. Is there any way to speed this up?
Yes. Create your items and add them to an ArrayList. Then convert
the ArrayList to ListViewItem[] add the array using the AddRange
method.
--
This bit of code[1] runs very slow because I have to add 65000+
ListViewItems to the ListView. Is there any way to speed this up?
[1]
listImports is a ListView
Hostnames is a Hashtable
HostnameListViewItem is a ListViewItem
listImports.BeginUpdate();
foreach(string hostname in hostnameController
Note that the documentation is often misleading - there are plenty of classes
in the framework that claim to be using threads or the thread pool when they're
actually doing intrinsically asynchronous calls as Mike describes.
--
Ian Griffiths
From: Unmoderat
Using System.Reflection;
Assembly ass = Assembly.GetExecutingAssembly();
AssemblyDescriptionAttribute ada = (AssemblyDescriptionAttribute)
ass.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), true)[0];
Best regards
Benny S. Tordrup
-Oprindelig meddelelse-
Fra
20 matches
Mail list logo