.net

Can one listen a twain (Maybe WIA) scanner?

I am evaluating VintaSoft .net control and Atalasoft DotTwain Image Capture. And I am very but very lost with the most of the definitions and keywords. So I am asking this because I think I am in Lala land. Is it possible to listen or have the scanner tell my app that there is a scanned image and I can process it? The idea is to have a...

Calculate the display width of a string in C#?

A Java version of this question was just answered, and, well, I don't know how to do this in .net. So how do you calculate the display width of a string in C# / .net? ...

Using WebDAV to access Exchange 2003 Inbox

How do you (using .NET) use WebDAV to get a listing of emails in a user's inbox (not your own inbox) and then get the properties and/or contents of each email? I'd like to do this without WebDAV.NET, if at all possible. ...

Detecting SqlServr.exe WriteFile Operation Within C#

Hello everyone, There's a requirement that we will need to support querying a local SQL Server database for new data when the database is updated. Since these are external SQL Server databases, we may not be able to use SQL Server Notification Services nor can we make any changes to the database. My basic idea is to watch for data ...

Using an array in the FileHelpers mapping class

I have been searching for a way to allow one element of my FileHelpers mappling class to be an array of specific length. For instance, I have a class like this: [DelimitedRecord(",")] public class Example { public string code; public int month; public int day; public double h1; public double h2; public double h3...

How to set the "insert new row" as first row in DataGridView

Hi there I am trying to get the DataGridView to render the "insert new row" row as the first row in the grid instead of the last row. How do I go about doing that, is it even possible in the control? Regards, Egil. ...

How do I get a .NET assembly running under Delphi from a network drive?

I have a Delphi 5 executable that calls into a .NET assembly via the free Delphi .NET code, and for the most part, this works great. However, one of the requirements of my application is that our clients be able to use this from a networked share as well as local. On my test machine, I can't get this to work, I just get an error messag...

how to remove relations from entity framework

I dont want to include relations in my edmx entity framework, I mean i want to have the foreign key field as a normal property in my entity. how can i do that? ...

Properties in partial class not appearing in Data Sources window!

Entity Framework has created the required partial classes. I can add these partial classes to the Data Sources window and the properties display as expected. However, if I extend any of the classes in a separate source file these properties do not appear in the Data Sources window even after a build and refresh. All properties in partia...

WPF Dispatcher.Invoke 'hanging'

I have a somewhat complex WPF application which seems to be 'hanging' or getting stuck in a Wait call when trying to use the dispatcher to invoke a call on the UI thread. The general process is: Handle the click event on a button Create a new thread (STA) which: creates a new instance of the presenter and UI, then calls the method Dis...

How can I control the order in which event handlers are fired?

Are event handlers fired in the order that they attached to the event? If not, can I enforce some kind of order onto the event handlers such that they are called in a specific order? ...

.config to constructor tricks?

I'm working on a quick project to monitor/process data. Essentially that's just monitors, schedules and processors. The monitor checks for data (ftp, local, imap, pop, etc) using a schedule and sends new data to a processor. They call have interfaces. I'm trying to find a sane way to use config to configure what schedule/processor each ...

Systray Access

Is there a way (in C#) to access the systray? I am not talking about making a notify icon. I want to iterate through the items in the tray (I would guess through the processes but I don't know how to determine what is actually in the tray and what is just a process) and also represent the items with their icons in my own ui. ...

Best Continuous Integration Setup for a solo developer (.NET)

I'm looking for a lightweight, easy to setup CI server that I can run on my laptop along with Visual Studio & Resharper. I'm obviously looking at all the big names like CruiseControl, TeamCity etc etc but the biggest consideration to me is ease of setup and to a lesser extent memory footprint. Edit: I'd also like some suggestions for ot...

Upgrading a large VB6 app to .NET. Opinions on VB Migration Partner

I have a really large VB6 code base with a ton of 3rd party controls. Want to move it to .NET. Rewriting it is out of question - the client sees no value in spending money to get the same thing. Moving to .NET with the built-in upgrade wizard is basically a non-starter. Has anyone tried the VB Migration Partner from http://www.vbmigr...

What should these comparisons return?

I've got an application that's using string.compare(string,string) to sort some values. The thing I can't figure out is why "1022" compares as less than "10-23" and "10-23" compares as less than "1024". Is there something specific to the value of "-" that causes this result? Will that overload of string.compare give the same result wi...

Version controlled production environment

My question is, how do I version control the production environment in a good way? This is our current environment: (Internal server) Development - Version controlled source code (Customer server) Acceptance test environment (Customer server) Staging environment (Customer server) Production environment When we release new functional...

When Would You Prefer DateTime Over DateTimeOffset

A few months ago I was introduced to the new DateTimeOffset type and was glad DateTime's flaws with regard to time zones were finally taken care of. However, I was left wondering if there were any overhead or problems that could occur from using this new type. I work on a multi-locale web application. Does anyone know of anything that ...

Multiple control buttons for a maximised MDI child in .NET WinForms

That's what I get when I try to automatically maximize MDI children. The code is something like this: this.IsMdiContainer = true; child = new Form(); child.MdiParent = this; child.WindowState = FormWindowState.Maximized; child.Show(); Any ideas why do I get multiple control buttons ? ...

Finding out what exceptions a method might throw in C#

Is there any way to find out what exceptions might be thrown by any method in .NET code? Ideally I want to see what might be thrown and choose which ones I want to handle. I guess I want the information you'd get from the throws clause in java. The situation is I'm doing a linq query on an xml document from the network and want to know...