.net

image conversion

I need to convert a RGB (jpg) grayscale CMYK using only to black channel (K). I'm trying to do this with imageglue, but the result is not what i'm looking for since it converts the grays using the C,M and Y channel and leaves the black channel to 0%. What I need is if anyone has experience in using any other library/api in .net that ...

Benefits of an enterprise service bus

Where can I find some information on the uses and benefits of an enterprise service bus (ESB)? I am looking for information about: the kinds of problems and ESB helps to solve the alternatives to an ESB - and the tradeoffs in selecting between them what you need to do as a developer to build ESB-compatible systems I'm looking for a ...

Do I need to have a separate Visual Studio 2010 project for services, classes, website and Silverlight app?

I am starting a new Silverlight 3 project in Visual Studio 2010. My plan is to have a project for each of these: The Silverlight application The hosting web application The WCF service This last one will also contain a typed dataset (that will serve as my data logic layer) and a few classes to do my business logic. The WCF service meth...

C# Winforms Combobox with Label and Value

Hey guys / gals, I have a question that I am shocked I haven't had a need to ask before. I am mostly an ASP.net developer but I am trying to work on a WinForms app and noticed a large difference between the ASP.NET combobox (html select) and that of WinForms. I found (maybe incorrectly so) that WinForm's combobox only has a "label" wh...

dropdownlist value not passed .net

i am working on an already built program with a lot of classes and jscripts. the issue is the code has 3 dropdownlist's month, date, year. I need to remove the date one and passa static "01" value. here's the code for validating date in javascript - function Validate_date(sender, args) { var m = document.getElementBy...

Where is the Shape located on Canvas ?

Hi, Say I put a Shape on a Canvas like this: Canvas.SetLeft(myShape, 50); Canvas.SetTop(myShape, 30); canvas.Children.Add(myShape); After that, myShape was drag & dropped on this Canvas. How can I determine the current myShape coordinates ? For example, before the drag & drop I would like to get (50,30). Thanks ! ...

Calling .NET 2.0 assemblies in .NET 1.1

Recently I developed a internal framework in .NET 2.0 version, which is basically classes and helpers. The problem is I have some .NET 1.1 sites and applications and would like to use my framework from them. I know that I can't call .NET 2.0 in .NET 1.1, but I have an idea. If I create another 2.0 project with ComVisible and reference...

how to use QueueUserWorkItem with ref/out state?

Is it possible to do: ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProc), ref data); such that my ThreadProc could make the caller's data point to a different location than when the call was originated? If it is not possible, is there a way to implement such functionality with IntPtr or something? ...

Scripting engine with static typing

Hi, I am looking for a scripting engine that can be integrated in .NET but NOT with dynamic typing! For example, JavaScript is not suitable, because it is a dynamically typed language. Do you know any? ...

CreateUserWizard change error message runtime.

First time using the ASP.NET CreateUserWizard control and we are aliasing the Username Textbox as the Email Address because the clients wants the username to be an email address. Then hiding that controls EmailAddress. This part is working fine. The problem I'm having is the error message that gets displayed on the UI says "Please enter ...

"An attempt was made to load a program with an incorrect format" even when the platforms are the same.

I'm calling functions from a 32-bit unmanaged DLL on a 64-bit system. What I get is: BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) At first, I had my projects set to the Any CPU platform, so I changed them both to x86, but this error is still occurring....

How to deal with a sealed class when I wanted to inherit and add properties

In a recent question on Stack Overflow, I asked how I might parse through a file name to extra meta info about a file. After I worked through that problem, I decided that I might want to create new type of object to hold the meta data and the original file. I thought I might do something like this: class BackupFileInfo : FileInfo, IEq...

AppDomain.CreateInstanceAndUnwrap fails if library's name has been changed

Greetings, I have an application that allows users to import libraries (.NET DLLs) they've created, as long as the library conforms to specific guidelines I've given them (use my namespace, decorate methods with my attribute, etc.). I copy each user lib to an internal directory and then load it into its own app domain (so user can unloa...

Using a xml column with ADO.NET Entity Framework

In .NET 3.5sp1, I have a table in Sql Server that is defined somehow like this: CREATE TABLE Employee( EmployeeId [int] IDENTITY(1,1) NOT NULL, UserName varchar(128) NOT NULL, [Name] nvarchar(200) NOT NULL, Address xml NULL, ...) I am mapping this table to the ADO.NET Entity Framework. My problem is that the xml column is map...

NPGSQL: Streaming results from Postgres query?

Hi. I have a large table (2,000,000 rows) and I'd like to print each record to the screen, one at time, without loading the entire table into memory. //pseudo code var cmd = new NpgSQLCommand(); cmd.CommandText = "SELECT * FROM mytable;" IReader reader = cmd.ExecuteReader(); //blocks until the entire set is returned while(reader.Read(...

How to name a property when the preferred name is also the name of the type

Possible Duplicate: Giving a property the same name as its class In working on a solution where I was struggling to "add" properties to a sealed class, someone pointed out that my naming of a property with the same name as a type was asking for trouble. Here's a snippet of my code: class BackupFileInfo : IEquatable<BackupFileI...

Is it possible to wildcard logger names in log4net configuration?

In my application, I use log4net, with all types creating their own logger based on their type - e.g. : private static readonly ILog Log = LogManager.GetLogger(typeof(Program)); As I am developing, I leave the root logger on DEBUG so as to catch all log output from my code. However, a third party component also uses this same approa...

Right click with SendKeys in .NET

I am using sendkeys in C# .NET. I have letters, arrow keys and enter working. I cant figure out how to send a right click for the context menu. I know i can press a key on my keyboard to do it but i have no idea how to send the msg. How do i? i googled and saw new MenuItem().PerformClick(); as a solution however i didnt see any affect...

How do you get a dimension of an Array as an Array from a 2D array?

I have this 2D array: Private _Chars As String(,) = {{"`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "="}, {"¬", "!", """", "£", "$", "%", "^", "&", "*", "(", ")", "_", "+"}} I want to Pass a Dimension (ie. the First Line) into a Function, or the Second Line into a function to switch be...

Techniques for finding/avoiding unmanaged leaks in managed code.

Hi, What are the best ways for a .NET developer to hunt down (and avoid) unmanaged leaks in a managed app? There seem to be many excellent resources for tracking down managed leaks, but I haven't found much on tracking unmanaged leaks in a managed app. This question is related, but asks the question from a purely unmanaged point of vi...