Re: [ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Ron O'Rourke
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

Re: [ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Steve Johnson
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

Re: [ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Peter Ritchie
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

Re: [ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Steve Johnson
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

Re: [ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Peter Ritchie
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

Re: [ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Jamin Guy
>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

Re: [ADVANCED-DOTNET] Getting Info from AssemblyInfo.cs

2005-03-24 Thread Stoyan Damov
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

[ADVANCED-DOTNET] Focus lost in MDI application

2005-03-24 Thread Tracy Ding
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

Re: [ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Peter Ritchie
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

Re: [ADVANCED-DOTNET] Getting Info from AssemblyInfo.cs

2005-03-24 Thread Clark, Michael (OFM)
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? ---

Re: [ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Steve Johnson
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

Re: [ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Peter Ritchie
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

[ADVANCED-DOTNET] Help: error in code that creates dynamically generated and compiled dll help please

2005-03-24 Thread SUBSCRIBE ADVANCED-DOTNET Anonymous
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

Re: [ADVANCED-DOTNET] Large-scale WinForms Client Deployments

2005-03-24 Thread Mike Iles
(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

Re: [ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Jamin Guy
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

Re: [ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Mark Smith
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

Re: [ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Steve Johnson
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. --

[ADVANCED-DOTNET] Anyway to speed this up?

2005-03-24 Thread Jamin Guy
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

Re: [ADVANCED-DOTNET] MessageQueue and Thread

2005-03-24 Thread Ian Griffiths
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

[ADVANCED-DOTNET] SV: [ADVANCED-DOTNET] Getting Info from AssemblyInfo.cs

2005-03-24 Thread Benny S. Tordrup
Using System.Reflection; Assembly ass = Assembly.GetExecutingAssembly(); AssemblyDescriptionAttribute ada = (AssemblyDescriptionAttribute) ass.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), true)[0]; Best regards Benny S. Tordrup -Oprindelig meddelelse- Fra