Carolina Code Camp – 2013
You will learn how to structure your app’s code in a way that
– improves maintainability
– enables testability of your app’s UI behavior
– reduces maintenance cost
– enables cross-platform deployment
Tag: C#
Understanding and Using System.Transactions
These are some resources to help grasp System.Transactions functionality and use it effectively in your projects:
- Features Provided by System.Transactions to create transactional applications
- Implementing an Implicit Transaction using Transaction Scope
- MSDN Magazine Articles by John Papa:
- These are specific to TransactionScope (the way to go in most cases):
- Here is a practical example of Using TransactionScope to handle transactions in .net.
- This article in MSDN Magazine gets in depth with the way a TransactionScope like functionality can be implemented. Gives you a good understanding of what is happening under the hood when using TransactionScope in some Repository implementations in multi-threaded scenarios.
- This CodeProject article is another example of implementing a transactional repository.
- There are excellent tips here about configuring TransactionScope when using it with SQL Server.
- This is a good resource for understanding CommitableTransaction usage.
- And this one on the CodeProject has brilliant, in-depth and under-the-hood coverage – Truly Understanding .NET Transactions and WCF Implementation.
Job Opening – Windows GUI Developer
We have a 3-4 month contract position open for a Windows GUI Developer in our group at Calabasas, California:
- 2+ years experience developing C++/C# Windows thick-client applications
- Expert in GUI development on Windows
- Expert in Object Oriented Analysis and Design (OOA/OOD)
- Deep understanding of client-server software development
- Experience in multithreading, and thread synchronization
- Excellent communication skills (written and verbal)
- Highly organized and detail oriented
- BSCS/BSEE or equivalent
If you are interested, contact me. The position is available now.
Dial Gauge is a ProgressBar
I am not just being philosophical here. In WPF, ControlTemplates allow you to transform a control’s appearance. This is not the same as applying stylesheets. This is an entirely new level of customization. What you see in the screenshot below looks like a Dial but is actually a simple ProgressBar control wearing a “Dial” template. The Dial template was created using Microsoft Expression Blend .
Include the ControlTemplate as a Window.Resource and then assign it to ProgressBar element’s Template attribute :
Of course that is not all. The ControlTemplate must define some named elements of FrameworkElement type. Charles Petzold has explained it in detail : MSDN Magazine Article. So, I will not repeat it here.
The sample code can be downloaded here : DialTest.zip
License : Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
WPF – LINQ to SQL Sample
This exercise in binding a WPF ListView control with LINQ to SQL was a lot of fun ! The following image shows data from AdventureWorks sample database displayed in the ListView control. The end result is very admirable, even in this very basic demo. Feeling a complete sense of freedom is unavoidable when working with WPF.
This sample demonstrates :
- LINQ to SQL mapping.
- WPF ListView Control DataBinding.
- Displaying images stored in database as varbinary in WPF control.
The sample code can be downloaded here : WPF-LINQ to SQL Sample
License : Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
Customize log4net Output Path
The default log4net output path is relative to the startup directory of your executable. To customize the output path, you can override the base Appender’s File property in your own Appender class. The following example describes how to route the log files relative to the temp folder :
public class MyOwnAppender : log4net.Appender.RollingFileAppender { public override string File { get { return base.File; } set { if (Path.IsPathRooted(value)) { base.File = value; } else { base.File = Path.Combine(Path.GetTempPath(), value); } } } }
Your log4net config file must be modified so that log4net can locate and use your custom Appender. If MyOwnAppender is in MyNamespace and you have implemented it in MyLoggerLib.dll :