.net

Why GetHashCode is not a property like HashCode in .NET

Why GetHashCode is not a property like HashCode in .NET? ...

Why should I NOT use the GAC?

There have been a few questions asked along this line stackoverflow such as What are the advantages and disadvantages of using the GAC and When and when-not to install into the GAC? and a few people have asked it on the web expamle. I can't any convincing arguments for not using the GAC. I am sure I am being naive but it seams like the...

Is there an IDictionary implementation that returns null on missing key instead of throwing?

The indexer into Dictionary throws an exception if the key is missing. Is there an implementation of IDictionary that instead will return default(T)? I know about the "TryGetValue" method, but that's impossible to use with linq. Would this efficiently do what I need?: myDict.FirstOrDefault(a => a.Key == someKeyKalue); I don't think...

What libraries are available for manipulating super large images in .Net

I have some really large files for example 320 MB tif file with 14000 X 9000 pixels. The operations I need to perform are basically scaling the images to get smaller versions of it and breaking the image into tiles. My code works fine with small files and I use the .Net Bitmap objects but I will occasionally get Out of Memory exception...

Can i get the key of a style in code-behind? (WPF)

If I have the following code: Style defaultStyle = (Style)FindResource("MyTestStyle"); Is there a way to get the name of the style (i.e. reverse-lookup)? Something like: string name = defaultStyle.SomeMagicLookUpFunction() Where name would evaluate to "MyTestStyle." Is this possible? ...

How do I get the header height of a Listview - c#

Can sombody tell me how to get the header height of a list view. Thanks ...

Windows Service Stops Automatically

Hi All, I made a window service and let it work automatically and under localsystem account, when the service starts it fires this message for me and then stop "The [service name] service on local computer started and then stopped. Some Services stop automatically if they are not in use by another services or programs." Whats the probl...

Does .NET JIT optimize empty loops away?

This article suggests otherwise. But there is still a need to evaluate the loop condition. Does java just employ a specific trick to recognize this case? ...

Current line in a multiline textbox

Hi, I've got my own custom TextBox control, wich inherits from System.Windows.Forms.TextBox. I've overrided OnKeyDown method, because I want to select the previous or next control if the user press either up or down keys. Protected Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs) MyBase.OnKeyDown(e) ...

Using D programming language in a .NET context

I'm curious: has anyone used D together with .NET languages? Is that even possible? What kind of stuff is easier/makes sense to do in D that's hard to do in, say, C++/CLI? ...

Casting a generic collection to base type

I've got an IList<DerivedClass> that I want to cast to ICollection<BaseClass> but when I attempt an explicit cast, I get null. Is it possible to do this without creating and populating a new collection? Edit: Since I only want to read from the collection, I switched to using a generic method: public void PopulateList<BaseClass>(IColle...

Is there a Free IDE Plugin for extracting interfaces in vb.net?

Is there a plug-in for the Visual Studio IDE that adds the feature available in C# for extracting interfaces from objects? ...

3d chart in .net control

I have a 2 dimensional array of doubles I would like to display as a 3d mesh. Are there any open source libraries that can do this as a .net control? I'd like to choose between shaded and wireframe, be able to color based on elevation, and be able to rotate the view via mouse. ...

Client - Server: If the clients announce their presence to the server, and then the server takes over, is it still client server, or is it P2P?

Greetings readers! So I am trying to develop a client server system.. Since I have not designed a client server system before, I thought that I would post a question and see what the experts here have to say. Requirements: .NET 3.5 WCF minimum of 2 computers, Master and Slave. The use case is a testing environment, where the slave run...

What method of data validation is most appropriate for large data sets

I have a large database and want to implement a feature which would allow a user to do a bulk update of information. The user downloads an excel file, makes the changes and the system accepts the excel file. The user uses a web interface (ASP.NET) to download the data from database to Excel. User modifies the Excel file. Only certain d...

SMTP / POP3 / IMAP Mail Server for Windows

I'm looking for a relatively inexpensive (or free) POP3 mail server for Windows Server that will scale well. Compatible with SQL Server would be fantastic. It would also be great if it had a .net class library for performing simple functions like creating/deleting new accounts, adding aliases, etc. Any ideas would be greatly appreciat...

How does .NET make use of IO Threads or IO Completion Ports?

We have a .NET application that makes several concurrent calls to various web services, collects their responses and then makes a few calculations off those responses. In attempting to derive additional performance, I've been investigating the use of approaches that make use of .NET's IO threading via the use of IO completion ports. I've...

WPF: How do I transition from one docked UserControl to another?

I have quite a basic WPF form with a DockPanel, there's a Menu bar, a Status bar, and a UserControl. Like so: <DockPanel> <Menu DockPanel.Dock="Top"> ... </Menu> <StatusBar DockPanel.Dock="Bottom"> ... </StatusBar> <UserControls:MyUserControl /> <DockPanel> My problem is: Based on an event, I want to transition the U...

Calling a function from a string in C#

I know in php you are able to make a call like: $function_name = 'hello'; $function_name(); function hello() { echo 'hello'; } Is this possible in .Net? ...

Wait for pooled threads to complete.

I'm sorry for a redundant question. However, I've found many solutions to my problem but none of them are very well explained. I'm hoping that it will be made clear, here. My C# application's main thread spawns 1..n background workers using the ThreadPool. I wish for the original thread to lock until all of the workers have completed...