Browse by Tags

All Tags » .net code (RSS)

Caching the results from LinqDataSource

I wanted to be able to cache the results of a query from the LinqDataSource that was used in multiple places on the page. I whipped up this little class to do the work of caching for me. The class, LinqCacheDataSource, handles the Selecting and Selected events. The Selected handler inserts the result of the query into cache. The Selecting handler gets the result from the cache. If it doesn't find the result, the query runs as normal. The caching will only work for selecting data. It works great for dropdowns and other fairly static data....
Posted by pwelter34 | 5 comment(s)
Filed under: ,

Easier way to page Linq queries.

The following query extension will make paging a query more natural then skip and take. Simply append Paginate(page, pageSize) to your query. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace System.Linq ...
Posted by pwelter34 | with no comments
Filed under: ,

Calculator.NET - Calculator that evaluates math expressions

I'd like to announce the release of a little project I've been working on. I call it Calculator.NET. I started this project for a couple reasons. First, I was annoyed that Windows Vista doesn't come with a better calculator. Windows XP has Power Calculator...
Posted by pwelter34 | 6 comment(s)

XML Serializable Generic Dictionary

XML Serializable Generic Dictionary For some reason, the generic Dictionary in .net 2.0 is not XML serializable. The following code snippet is a xml serializable generic dictionary. The dictionary is serialzable by implementing the IXmlSerializable interface...
Posted by pwelter34 | 153 comment(s)
Filed under:

Create a Relative path code snippet

Here is a code snippet that is equivalent to the windows API PathRelativePathTo as native c#. The function creates a relative path from one file or folder to another. public class PathUtil { /// <summary> /// Creates a relative path from one file...
Posted by pwelter34 | 10 comment(s)
Filed under:

Draco.NET version 1.6.4.0 Released

I’ve update and released a new version of Draco.NET. This release is mainly to make it compatible with Visual Studio 2005 and MSBuild. The following is a list of changes … 1.6-release-2 (1.6.4.0) Added MSBuild support Added Visual Studio 2005 support...
Posted by pwelter34 | 2 comment(s)
Filed under: ,

MSBuild Community Tasks Project releases version v1.0.0.29

Announcement The MSBuild Community Tasks Project releases version v1.0.0.29. The following is a list of tasks. Current Community Tasks Task Description AssemblyInfo Generates an AssemblyInfo file using the attributes given. FtpUpload Uploads a file using...
Posted by pwelter34 | 2 comment(s)
Filed under: ,

MSBuild Community Task Collaboration Project

I’d like to announce the MSBuild Community Task Collaboration Project. The project was started by me to form a directory of MSBuild Tasks for use in your build scripts. The project is also an open source collection of tasks. The project is broke into...
Posted by pwelter34 | 1 comment(s)
Filed under:

Generics at Runtime

Here is a little test code that demonstrates how to use Generics at runtime. The code has two tests. The first test shows how to create a Generic Class at runtime. The second shows how to call a Generic method. Keep in mind that when using generics at...
Posted by pwelter34 | 3 comment(s)
Filed under:

Google Toolbar Spell Check API

I saw in this post that the Google toolbar could be extracted and looked at. So, I spend an afternoon reverse engineering the spell checker api. The api ends up to be very easy to use. Checking is done with an HTTP post to http://www.google.com/tbproxy...
Posted by pwelter34 | 49 comment(s)
Filed under:
More Posts Next page »