.net

AutoMapper Mapping IEnumerable to DataReader Issue

I am using AutoMapper to datareader using code as discussed below http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/ I see it being very flakky...and unpredictable. 1) Same code with same datareader at times brings value back to the dto result set and at times doesnot. 2) I have an ID value coming fr...

How can I refactor this to work without breaking the pattern horribly?

I've got a base class object that is used for filtering. It's a template method object that looks something like this. public class Filter { public void Process(User u, GeoRegion r, int countNeeded) { List<account> selected = this.Select(u, r, countNeeded); // 1 List<account> filtered = this.Filter(selected, u, r...

Concurrent reading and writing to NamePipeClientStream

I have a NamedPipeClientStream instance in my application that is setup for duplex communication (PipeDirection.InOut). I also have two threads, a read thread and a write thread. I want to have the read thread call only the NamedPipeClientStream.Read method, and the write thread only call the NamedPipeClientStream.Write method. They w...

Is there a better way to throttle a high throughput job?

I created a simple class that shows what I am trying to do without any noise. Feel free to bash away at my code. That's why I posted it here. public class Throttled : IDisposable { private readonly Action work; private readonly Func<bool> stop; private readonly ManualResetEvent continueProcessing; private readonly Timer ...

XAML get new width and height for Canvas

I have searched through many times but have not seen this before. Probably really simple question but can't wrap my head around it. Wrote a VSTO add-in for Excel that draws a Grid dynamically. Then launches a new window and replaces the contents of the Canvas with the generated Grid. The problem is with printing. When I call the print p...

developing a GUI in C# on Cosmos OS

How do i develop GUI in C# Cosmos? cosmos OS ...

How to make WebKit or IE call your application (.NET) from HTML page opened in browser?

I have a .NET application running on windows. I want clicking on some page element (button link flash app etc) to launch my app with some special parameters. (It should run not just in IE but on WebKit based windows browsers too) During App install we suppose that user is Admin and is running Vista or Windows 7 or Later. So my question ...

Plugin architecture in .net: unloading

Hello everybody, I need to implement a plugin architecture within c#/.net in order to load custom user defined actions data type handling code for a custom data grid / conversion / ... from non-static linked assembly files. Because the application has to handle many custom user defined actions, Iam in need for unloading them once...

Why can one aliased C# Type not be accessed by another?

good stuff // ok to alias a List Type using AliasStringList = System.Collections.Generic.List<string>; // and ok to alias a List of Lists like this using AliasListOfStringList1 = System.Collections.Generic.List<System.Collections.Generic.List<string>>; bad stuff // However **error** to alias another alias using AliasListOfStringList...

What is AGL on .NET Compact Framework?

What is AGL on .NET Compact Framework?? Any information about it would be very appreciated! For Example(Code from .NET Compact Framework): DllImport("AGL", EntryPoint="@106")] public static extern PAL_ERROR Blt(IntPtr howThis, IntPtr howSrc, ref RC rcSrc, ref RC rcDst, int cvKey, AGL_BLT md); public void Save(Stream stream, ImageFo...

Can we make ASP.NET MVC project to compile on-the-fly just like ASP.NET 2.0?

I really love ASP.NET 2.0 for being able to make code-behind changes without neededing to re-compile project. Now I have moved to ASP.NET MVC but one thing that bother me is the fact that I need to re-compile everytime I make a change in the Controller code. How can I make my ASP.NET MVC application to compile on-demand like ASP.NET 2....

WCF Caching Solution - Need Advice

The company I work for is looking to implement a caching solution. We have several WCF Web Services hosted and we need to cache certain values that can be persisted and fetched regardless of a client's session to a service. I am looking at the following technologies: Caching Application Block 4.1 WCF TCP Service using HttpRuntime Cachi...

Motion detection of a specific object in .net

I need to make a .net application where I must detect a specific object the user is holding, using a camera. If the object must have some specific characteristics so that it can be easily recognized and detected from the surrounding space, please give me some tips (ex a green cube?) What would be the best technique/.net library to use?...

Cant get the catch statement to catch the custom exception

i have created a custom exception in the business layer and also using wcf layer where I am calling the methods in the business layer then in another website i am calling the method from wcf. i can see the message that i wrote in custom exception but the program goes staright to exception (the second catch block) instead of hitting my fi...

How do bind a List<object> to a DataGrid in Silverlight?

I'm trying to create a simple Silverlight application that involves parsing a CSV file and displaying the results in a DataGrid. I've configured my application to parse the CSV file to return a List<CSVTransaction> that contains properties with names: Date, Payee, Category, Memo, Inflow, Outflow. The user clicks a button to select a fi...

.NET Active Directory Password Expiration on Windows 2008

Searched SO and Everywhere else, including the .net developers guide to directory services programming book - no luck. I am trying to create a simple password reset web page that allows the user to change their password. The change password portion of the code is working fine. For the users I would also like to display when their curr...

How do I format the contents of a DataGrid cell as a Date? as Currency?

I have a Silverlight DataGrid that's being populated with different types of data for each column. I'm trying to figure out how to format some of the contents of the DataGrid's cells, specifically for dates and formatting. I have a date column that's currently displaying like: 3/11/2010 12:00:00 AM. I would rather it display like 3/...

Regular Expression for any number divisible by 60 using C# .Net ?

Hi there, I need to apply validation on input time intervals that are taken in as seconds. Now i am not really good at Regular expressions. So can any body help making a regular expression that can test whether a number is divisible by 60. I was wondering if i could use to test one that check that the number is divisible by 10 and then...

C# Open source library for reading and writing swf file,which supports version 8,9 and 10

Hi Chaps, Currently I am using SWFDOTNET libray for reading and writing swf file,which supports swf file from version 1 to 7. Is there any other open C# source lib for reading and writing swf flash which supports swf file version 8,9 and 10? Please reply..I am really in need of it. Thanks in advance, Chandrakala ...

How to stop execution of ASP.NET app on demand during debugging and show line where it happened?

How to stop execution of an ASP.NET app on demand during debugging and show the line of code where the app was aborted at that moment? Using Visual Studio 2010 RC Ultimate. ...