Archive for the ‘C# 3.0’ Category
Posted by jpluimers on 2010/05/14
I always tend to recompile assemblies when something changes they depend upon.
But now I’m even more careful after reading Fabulous Adventures In Coding : Putting a base in the middle.
Especially his checklist is important.
When you use a newer version of an assembly you depend on:
(1) at the very least test your derived types with the new base type — your derived types are relying on the mechanisms of the base types; when a mechanism changes, you have to re-test the code which relies upon that mechanism.
(2) if there was a breaking change, recompile, re-test and re-ship the derived type. And
(3) you might be surprised by what is a breaking change; adding a new override can potentially be a breaking change in some rare cases.
–jeroen
Posted in .NET, C#, C# 2.0, C# 3.0, C# 4.0, Delphi, Development, Prism, Software Development | Leave a Comment »
Posted by jpluimers on 2010/05/13
When you want to deploy WPF, it is important to check if you have sufficient hardware acceleration for your apps.
The most important things to check is the RenderCapability.
It gives you the Tier on which graphics is rendered.
The Tier tells something about hardware acceleration support, including a broad estimate of the pixel shader and vertex shader levels and DirectX versions.
Currently, there are 3 tiers: Read the rest of this entry »
Posted in .NET, C#, C# 3.0, C# 4.0, Development, Software Development, WPF | 1 Comment »
Posted by jpluimers on 2010/01/19
Recently, I had an issue while validating XML with XSD: validation in .NET using the built in classes in the System.XML namespace, and validation in native Windows using the COM objects exposed by MSXML version 6 (which incidentally ships with the .NET 3.0 framework).
Some documents validating OK in .NET did not validate well with MSXML.
I’ll show my findings below, and try to explain the difference I found, together with my conclusions.
The main conclusion is that MSXML version 6 has a bug, but I wonder why I can’t find much more information on it.
Since there is not so much ready to use for validating XML by XSD in .NET and native, I’ll include complete source code of command-line validations applications for both platforms.
.NET source code is in C#.
Native source code is in Delphi.
Read the rest of this entry »
Posted in .NET, C#, C# 2.0, C# 3.0, Delphi, Development, Software Development, Visual Studio and tools, XML, XML/XSD, XSD | 4 Comments »
Posted by jpluimers on 2010/01/12
Finally someone who explains this topic well: CodeProject: Multi-Threading in ASP.NET.
Most of it is based on Web 405 “Building Highly Scalable ASP.NET Web Sites by Exploiting Asynchronous Programming Models” by Jeff Prosise, which should be here on the Microsoft events site (which currently has connection problems) and is referenced here and here.
Recommended reading!
–jeroen
Posted in .NET, ASP.NET, C#, C# 2.0, C# 3.0, C# 4.0, Development, IIS, Software Development, Visual Studio and tools | 2 Comments »
Posted by jpluimers on 2010/01/05
I always forget the pragma syntax, because it differs substantially from the #if syntax, and I hardly use #pragma.
Contrary to #if … #endif, there is no #pragma … #endpragma.
Instead, there is #pragma warning disable ### … #pragma warning restore ###).
Ken Evans wrote a nice blog article about it (a long time ago, but it is still current): Kirk Evans Blog : Suppress warnings in C# 2.0.
And of course: the official docs, which indicate that when you omit the warning list in a #pragma warning restore, then all warnings are restored.
You can get the error numbers from the compiler output window (no, the errors/warnings/hints window does not show the numbers, that would be to obvious).
–jeroen
Posted in .NET, C#, C# 2.0, C# 3.0, C# 4.0, Development | Leave a Comment »
Posted by jpluimers on 2010/01/05
Gerrit Beuze just announced the new beta of ModelMaker Code Explorer 8.
For me, ModelMaker Code Explorer (especially at a price of only EUR 99!) is an indispensable tool for both creating new sources, and maintaining old sources (the refactorings it can do are awesome, but there are many other useful features in it as well).
Over the years, I’ve been using interfaces in Delphi more and more.
Actually, in some of my projects almost all classes implement interfaces.
Therefore, I’m particularly glad with the new feature ‘auto complete style drop down list’ in the ‘Edit Class dialog’ that this beta brings.
More info: ModelMaker Code Explorer 8.02 beta.
Note: if you use Visual Studio, there is a Visual Studio edition of ModelMaker Code Explorer too.
–jeroen
Posted in C# 2.0, C# 3.0, Delphi, Development, Software Development, Visual Studio and tools | Leave a Comment »
Posted by jpluimers on 2009/07/16
I just found out that in my updates to TFS 2008 Folder Comparison Filter for both C# and Delphi projects somehow some backslashes (\) were missing.
Oops, sorry :-)
These backslashes are important when excluding directories: if omitted, TFS thinks you want to exclude a filename in stead of a directory name (see Folder Comparison Filters).
It might be due to the HTML pasting issue that I explained in Including formatted sourcecode in WordPress.
Anyway, here is the correct one that has the backslashes at the right places:
!*.pdb;!*.obj;!*.dll;!*.exe;!*.res;!*.resources;!*.cache;!*.ilk;!*.ncb;!obj\;!objd\;!bin\;!lib\;!*.local;!*.identcache;!*.dcu;!__history\;!*.dsk;!*.~*;!*.stat;!*.drc;!*.map;!*.csproj.user;!*.vbproj.user;!*.csproj.webinfo;!*.vbproj.webinfo;!*.suo;!*.bpl;!*.dcp;!*.log;!*.lck
(Note these all should be on one line when pasting them).
–jeroen
Posted in .NET, C# 2.0, C# 3.0, Delphi, Development, Prism, Software Development, Source Code Management, TFS (Team Foundation System), WordPress | Leave a Comment »
Posted by jpluimers on 2009/07/15
Somehow, at every client I need a function like GetExecutablePath.
Maybe you do too, so here is the code that I adapted a long time ago from the Delphi 2006 RTL:
using System;
using System.Diagnostics;
using System.Reflection;
namespace bo.Reflection
{
public class AssemblyHelper
{
public static string GetExecutablePath()
{
// borrowed from D2006\source\dotNet\rtl\Borland.Delphi.System.pas function ParamStr():
string result;
Assembly entryAssembly = Assembly.GetEntryAssembly();
if (null != entryAssembly)
{
result = entryAssembly.Location;
}
else
{
Process currentProcess = Process.GetCurrentProcess();
ProcessModule mainModule = currentProcess.MainModule;
result = mainModule.FileName;
}
return result;
}
}
}
Enjoy :-)
–jeroen
Posted in .NET, C#, C# 2.0, C# 3.0, Delphi, Development, Software Development, Visual Studio and tools | 2 Comments »
Posted by jpluimers on 2009/06/02
Last week I spoke at the GeekNight of the Dutch Microsoft DevDays 2009.
A great conference, signalling two important industry wide trends:
- Cloud computing
- Natural user interfaces
There were many interesting presentations on both, and we are only at the beginning of those trends: interesting times are ahead!
My presentation (.NET & hardware – capture video & control servos, in a fun application) was as a GeekNight session.
That imposed geeky stuff, but in addition it addressed an important point: there will be many more means of interaction.
In particular, my ‘geek’ combination of hardware and software would react on movements seen by the webcam by pointing the beam of the laserpointer towards the largest area that moved.
After that I enjoyed the long Pentecost weekend (yes, the monday after Pentecost is a Holiday in the Netherlands, so most people have a day off then).
Today I updated my Conferences, seminars and other public appearances page with my DevDays materials to download.
It contains both the sourcecode, and the presentation in English.
Enjoy the download :-)
–jeroen
Posted in .NET, C#, C# 2.0, C# 3.0, DevDays09, Development, Event, Hardware Interfacing, Servo, Software Development, USB, WebCam | Leave a Comment »