.net

Showing a tooltip for a MenuItem

I've got a menu that contains, among other things, some most-recently-used file paths. The paths to these files can be long, so the text sometimes gets clipped like "C:\Progra...\foo.txt" I'd like to pop a tooltip with the full path when the user hovers over the item, but this doesn't seem possible with the Tooltip class in .NET 2.0. ...

UnhandledException handler in a .Net Windows Service

Is it possible to use an UnhandledException Handler in a Windows Service? Normally I would use a custom built Exception Handling Component that does logging, phone home, etc. This component adds a handler to System.AppDomain.CurrentDomain.UnhandledException but as far as I can tell this doesn’t achieve anything win a Windows Service so ...

Tools for manipulating PowerPoint files

Do you know managed tools for manipulating PowerPoint files? The tool should be 100% managed code and offer the option to handle .ppt and .pptx files. ...

How to test a WPF user interface?

Using win forms with an MVC/MVP architecture, I would normally use a class to wrap a view to test the UI while using mocks for the model and controller/presenter. The wrapper class would make most everything in the UI an observable property for the test runner through properties and events. Would this be a viable approach to testing a ...

Avoiding first chance exception messages when the exception is safely handled

The following bit of code catches the EOS Exception using (var reader = new BinaryReader(httpRequestBodyStream)) { try { while (true) { bodyByteList.Add(reader.ReadByte()); } } catch (EndOfStreamException) { } } So why do I still receive first-chance exceptions in my console? A first chance ex...

Saving an open generic type in an array?

I am facing a problem with .NET generics. The thing I want to do is saving an array of generics types (GarphicsItem): public class GraphicsItem<T> { private T _item; public void Load(T item) { _item = item; } } How can I save such open generic type in an array? Thx ...

WPF Application fails on startup with TypeInitializationException

I have a simple WPF application which I am trying to start. I am following the Microsoft Patterns and Practices "Composite Application Guidance for WPF". I've followed their instructions however my WPF application fails immediately with a "TypeInitializationException". The InnerException property reveals that "The type initializer for...

Combining Enums

Is there a way to combine Enums in VB.net? ...

"Quoted-printable line longer than 76 chars" warning when sending HTML E-Mail

Hi, I have written some code in my VB.NET application to send an HTML e-mail (in this case, a lost password reminder). When I test the e-mail, it gets eaten by my spam filter. One of the things that it's scoring badly on is because of the following problem: MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars I've been...

Interview questions: WPF Developer

What should every WPF developer know? Entry Level Strong .NET 2.0 Background & willing to learn! Explain dependency properties? What's a style? What's a template? Binding Differences between base classes: Visual, UIElement, FrameworkElement, Control Visual vs Logical tree? Property Change Notification (INotifyPropertyChange and Observ...

Databinding an enum property to a ComboBox in WPF

As an example take the following code: public enum ExampleEnum { FooBar, BarFoo } public class ExampleClass : INotifyPropertyChanged { private ExampleEnum example; public ExampleEnum ExampleProperty { get { return example; } { /* set and notify */; } } } I want a to databind the property ExampleProperty to a ComboBox, s...

Best way to copy the entire contents of a directory in C#

I want to copy the entire contents of a directory from one location to another in C#. There doesn't appear to be a way to do this using System.IO classes without lots of recursion. There is a method in VB that we can use if we add a reference to Microsoft.VisualBasic: new Microsoft.VisualBasic.Devices.Computer(). FileSystem.CopyDi...

SDK for writing DVD's

I need to add DVD writing functionality to an application I'm working on. However it needs to be able to write out files that are being grabbed "live" from a camera, over a long period of time. I can't wait until all the files are captured before I start writing them to the DVD, I need to write them out in chunks as I go along. I've loo...

Should I use multiple assemblies for an isolated ASP.NET web application?

Coming from a corporate IT environment, the standard was always creating a class library project for each layer, Business Logic, Data Access, and sometimes greater isolation of specific types. Now that I am working on my own web application project, I don't see a real need to isolate my code in this fashion. I don't have multiple app...

Converting SVG to PNG using C#

I've been trying to convert SVG images to PNG using C#, without having to write too much code. Can anyone recommend a library or example code for doing this? ...

ASP.NET how to Render a control to HTML?

I have any ASP.NET control. I want the HTML string how to do I get the HTML string of the control? ...

How do I toggle Caps Lock in VB.NET?

Using VB.NET, how do I toggle the state of Caps Lock? ...

How do I get the current state of Caps Lock in VB.NET?

How do I find out whether or not Caps Lock is activated, using VB.NET? This is a follow-up to my earlier question. ...

How to check which locale is a .NET application running under, without having access to its sourcecode?

Context: I'm in charge of running a service written in .NET. Proprietary application. It uses a SQL Server database. It ran as a user member of the Administrators group in the local machine. It worked alright before I added the machine to a domain. So, I added the machine to a domain (Win 2003) and changed the user to a member of the P...

What's the difference between the inner workings of Java's JVM and .NET's CLR?

What's the difference between the inner workings of Java's JVM and .NET's CLR? Perhaps a starting point would be, are they basically the same thing in their respective environments (Java > JVM > Machine code) (C# > CLR > IL). Update: Several people have alluded to the points I was trying to cover: Garbage Collection Boxing/Unboxi...