Tuesday, February 23, 2010

C# Implementation of Singleton Pattern

In .NET, more than one thread can execute our Singleton concurrently
because .net is multithreaded.

If our class includes multiple static members, the first reference to
any of those members will trigger the type initializer. Also, class
instatiation will trigger them.

This implementation uses an inner class to make the .NET instantiation fully lazy.

The compiler guarantees the thread safety.

Wednesday, February 17, 2010

Synchronizing Two Feature Classes

In this Example We will see how to synchronize data between two feature classes, I'll use the TableSynchronizer class which I added to EAGL recently.

TableSynchronizer will synchronize data between and ITable instances, new rows in the source will be added to the destination, existing rows in both will be updated in destination, and rows that exist only in destination will be deleted.

You can use TableSynchronizer to synchronize data between feature classes from different workspaces, Feature Layers, Tables ...