Posts Tagged ‘C#’

I’ve been using WCF RIA-Services to pass data retrieved via Stored Procedure/EF 4 to a Silverlight 4 application. The system is based on an existing system and a lot of the legwork is already done in Stored Procedures so I was required to re-use them. To start with, I imported my stored procedures to my [...]

Custom URL Protocol in Windows CE

Posted: 13th August 2010 by thegrayzone in Development
Tags: ,

The Problem One requirement for my current application is that when the user clicks on a specific link on a web application from their Windows Mobile device, a pre-installed application will be launched on the device and a parameter from the web application will be passed to the application. The Solution I decided to use [...]

Background worker, passing and returning multiple parameters

Posted: 19th July 2010 by thegrayzone in Development
Tags:

I had a long running method that I decided to use the BackgroundWorker class to process. This process that the BackgroundWorker was running required multiple parameters to be passed to it, and it also returned multiple parameters back in the Completed method. Rather than create a custom object like I had done in the past [...]

In my previous post I wrote about overriding the LinqToEntitiesDomainService.CreateObjectContext() method to dynamically set the connection string for the used by the domain service. I realised that I would be using this in a couple of different services in my current project and potentially use it in the future so I wrote a generic abstract [...]

VB.NET Object Initializer and single line If statements

Posted: 4th June 2010 by thegrayzone in Development
Tags: ,

I’ve recently started working at a company that has quite a few VB.NET application sitting around, and as you can see from the rest of my posts I’m used to using C# A couple of C# language features that I use a lot are Object Initializers and single line if statements. This might be old [...]

Checking for property differences in object

Posted: 14th May 2010 by thegrayzone in Development
Tags: ,

I recently had to come up with a way to check the properties to 2 similar objects and find any differences between them. The solution that I came up with was to write a generic extension method that compares the 2 objects and returns a list of ObjectDifferences objects. The ObjectDifferences class is as follows: [...]

LINQ2SQL GroupBy

Posted: 23rd April 2010 by thegrayzone in Development
Tags: , ,

I’m currently working on a taxi-type system that manages journeys for customers. All journeys need authorised before they can be carried out. There is a page that shows all journeys that require authorisation but this required changing to show 1 row per customer rather than 1 row per journey. I got some help from Andy [...]

Action Delegate

Posted: 12th April 2010 by thegrayzone in Development
Tags: , ,

I recently wrote a small application for transferring files which searches through the specified folder and any child folders for files matching the specified filter. The application has a checkbox for the user to select whether to copy or cut/move the file. I decided to use the Action delegate to set the action to perform [...]

Mocking Request.IsAjaxRequest()

Posted: 22nd March 2010 by thegrayzone in Development
Tags: , , , ,

Recently I was tasked with investigating Controller testing within our ASP.NET MVC apps. Our applications typically use a lot of jQuery AJAX calls to controller methods. To prevent users manually typing the URLs, the first thing that is done in any controller method that is called using AJAX is a check to see if Request.IsAjaxRequest() [...]