.net

Making WPF ListBoxItems selectable

I have a ListBox with a rather simple ItemTemplate defined - containing a TextBlock and a Button. This displays like expected, but there is a problem though. When I click the content of the ListBoxItem, i.e. the text or the button, the line doesn't get selected in the ListBox. If I click the blank parts of the line it does. I'd like the ...

Prompt the user to install ActiveX/.Net Class Library from browser

Hello, I build a .NET Class Library project that accesses the mshtml.HTMLDocument when called (from JavaScript). Everything works ok on my machine since I changed the permissions in .NET Configuration for Trusted Sites to have Full access. But for the end users I would like Internet Explorer to prompt them just like, say, Windows Upda...

vs2008 syntax highlighting for il assembler

hi all, is there a way to get visual studio 2008 to do a nice syntax highlighting for the intermediate language? ...

Comparing floating point values

I just read a statement about the floating point value comparison Floating point values shall not be compared using either the == or != operators. Most floating point values have no exact binary representation and have a limited precision. If so what is the best method for comparing two floating point values? ...

Break point issue

I am putting a break point in a winforms application inside a function like public void FillOutListViewCtrl() { // code to be debugged } I put a breakpoint here. After running the application I just want to know what exactly is going on inside of this function. Is there any way to go to this function directly? Do I need to attach ...

VS2008, no embedded application icon?

Hello everyone. I'm using Visual Studio 2008 and I can set the application icon using the My Project -> Application - Tab with a path. But, is there any way to set the application icon to an embedded resource instead of the file itself? 'cause it seems like that VS is embedding the icon again just for this purpose, instead of reusing an...

Will a large number of timers affect timer firing?

If i have a large number of timers (10 to possibly a couple hundred) all with < 100 ms interval, will that affect the firing of any one of them? ...

How can i do conditional formatting in datgridview in C#?

In windows Application I want to Set colors of different cells in datagridview based on the value range Suppose value 1..22 : cell color should be green value 23.30 : cell color should be gray value >30 : cell color should be red how can i do it..please suggest some code snippet? How can i do conditional formatting in datgridview in C#...

Why is .NET inconstent in calling diretories "Directory" and "Folder"?

If you want to do some thing with a directory/folder you use System.IO.Directory but if you want to display a dialog for browsing one you use FolderBrowserDialog? Why is one named Directory and the other Folder? ...

Better way to design this loop?

I'm building a simple assembly compiler for my own custom flavor of assembly, and i have something like this as the actual code that does the compiling: foreach (KeyValuePair<short, string> kvp in newCommandSet) { string fullCommandString = kvp.Value; string instruction = fullCommandString.Split(new char[] { Con...

I'm being attacked - what can I do?

Someone is putting this code onto my aspx page. What are they doing? How are they doing it? How do I stop them? It's on a shared hosting server. It's on an aspx content page which has a master page and is after the </asp:content> tag... <div style="display:none">qzfmjsdbknmrmlkszrrcehikeapphqq</div> <div style="display:none">o...

How to localize string resource lookups from all threads in an application?

The recommended best practice is to set the current culture of the application's thread to enable resource look ups to use the correct language. Unfortunately, this does not set the culture for any other threads. This is especially a problem for thread-pool threads. The question is: how is it possible to set enable string resource lo...

How do I unlock a folder programatically in .Net?

Basically I want to do what Unlocker does, only from code. I want to unlock all access to a folder (and files under it / subfolders), so I can subsequently delete it. ...

using .NET Reflector on a C# DLL get below unreadable code, how do I correct this class?

The Errors are in public IEnumerator GetEnumerator() and private sealed class d__0 Could you Gurus help to convert those unreadable/understandable code into something I or compiler understand ones... Many Many Thanks first... below is the code using System; using System.Collections.Generic; using System.Linq; using System.Collections...

Upgrading / Patching .Net Mvc

What is the best way to upgrade / patch a .Net MVC application. Ideally from a single file as most installations of the application will be very basic computer users. So asking them to stop IIS, copy files, run sql scripts etc is not possible. Two possible approaches would be Executable which locates the site on the machine and copi...

A case-insensitive list

Hi, I need a case insensitive list or set type of collection (of strings). What is the easiest way to create one? You can specify the type of comparison you want to get on the keys of a Dictionary, but I can't find anything similar for a List. ...

Can WCF contract methods return null?

I have a fixed-sized multidimensional collection exposed via a WCF contract, and I want to be able to return null for any coordinates in the collection that have not been populated. When I try this, I get an exception indicating that this is not supported: "FaultException`1: Object reference not set to an instance of an object." I wonde...

.NET: Inherit from MyControl for Windows.Forms

Hi, I want to add some custom functionality to all my Controls AND my Forms. I have created a class MyControl, and there's no problem just doing: MyControl : Control and then letting my controls inherit from MyControl. However, I want my forms to have the same functionality, and because Form inherits from ContainerControl, Scrollable...

Tools to profile performance of .NET Compact Framework applications

The only thing I've found is EQATEC Profiler. Are there any other profilers out there that can be used to profile .NET CF apps? ...

VSTestHost is crashing and would not work anymore

For my project I am using the integrated Visual Studio unit-testing framework but I am having some issues that I never saw before. One of my classes is causing VSTestHost to crash. So first I though it was because there was a bunch of code causing a stack overflow. What is really strange is that now, even if I create a new project or us...