C#

Dictionary And HashTable In C#

.NET Framework provides several data structures for constant O(1) access. In software engineering we call them lookup tables. In .NET we can list following lookup-tables (at least):

Read more

Func vs Expression

This is another post about C# basics :)

Read more

Throwing Exception In C#

In C# there are 3 of ways to throw an exception.

Read more

TeamCity and W3C Validator

As you may know I'm a big fan of automation. I like to have things done in background and just receive notification if something happens. This saves time and allows me to forget about yet another thing to check situation.

Read more

CodeWatch sample fields with underscore convention check

This time I'll talk little bit about code best practices. Usually one thing what every development team does at the beginning of the project is to agree on some conventions. We agree to call services in certain way. Give view models ViewModel suffix and so on. During code reviews we try to catch all those kind of issues.... it's annoying and silly to waste time on somethings like that.

Read more

Accessing MSMQ system queues in C#

While working with MSMQ you may want to access Dead-Letter Queues. If your messages are not delivered to the expected destination they usually end up in Dead-Letter Queue.

Read more

OperationResult pattern

Communication between layers/modules/subsystems works best when API is simple and self explanatory. Pieter Hintjens wrote a great article about API design.

Read more

CodeWatch 1.0 released

Few days ago I decided to release my CodeWatch library. It's the first version to show the concept.

Read more

BizTalk - how to create message on orchestration programically

Since 2 years I have the opportunity to work with BizTalk. This post is one of "BizTalk series". I'll keep posting interesting tricks that are easy to do, but not so easy to find on internet.

Read more

Why provide interface with your library?

In daily programming activities some of use have the pleasure to use TDD approach :) Going deeper we can introduce the concept of mocks/stubs/shims. For the sake of this article let's call it mocks. Quite often we use 3rd party libs becuase they offer some functionalities we need. For example:

Read more

Autofac, DataContext and MemoryCache issue

In one of my web application I use MemoryCache to improve performance. The code looks like this:

Read more

Debugging WPF Bindings

WPF + MVVM is a very common way to make windows apps. It introduces the concept of data binding. We create a view-model based on one or many models and bind it to the view. Usually, it is easy... But how do you debug bindings if something is not going right? For example, you have Control Templates and styles and so on introduced in your app.

Read more

Logging in application

Logging information on how our application behaves is very often omitted or not properly handled by developers. We don't know what and when to log. We don't have a logging strategy. In this post, I' share my thoughts on this topic. Let's start with what hurt us when it comes to logging information from our projects.

Read more

Pet project - HandyLib

It's a while since my last post.... :) Perhaps there was nothing worth writing from my side. Now it is.

Read more

NoSQL Hackathon at PGS Software

Yesterday (25.10.2014) I have attended a local NoSQL Hackathon. The event was hosted by PGS Software. It started at 9:00 and took a bit less then 9 hours to program a sample version if a twitter-like website.

Read more

Generating xls documents with checkboxes in C#

A short while ago I had a task that required generating excel documents (xls) with special OLE objects. Checkboxes, to be precise.

Read more

Mono profile in Visual Studio 2012

Recently I step upon an issue of compiling a project using Mono. Mono itself comes with a nice tool called xbuild which is a msbuild brother in Mono world. Xbuild can be used to compile a project from the command line.

Read more

Refactoring ScreenCast - PART 3

My third ScreenCast from the Sample refactoring series is already available!

Read more

Refactoring ScreenCast - PART 2

My second ScreenCast from the Sample refactoring series is already available! In polish again.

Read more

Refactoring ScreenCast - PART 1

I want to share with you a ScreenCast I've recorded recently. This is the first of a whole series. The main topic of the series is: Sample refactoring.

Read more

Showing IDataErrorInfo for NULL objects

WPF provides, fairly easy to implement, possibility to validate entered data and notify user when something is incorrect. An example is available in MSDN, so I will skip further explanation how does this work...

Read more

Logging Exception with StackTrace

C# language has a great Exception Handling mechanism build-in. If something in not predictable during compile time developer can easily embed that piece of code in try{ (...) } catch{ (...) } and say "case closed". Sample code taken from MSDN:

Read more

Using different .config file in .NET application

In .NET world executable files using by default configuration file with special name. Microsoft has implemented following pattern: executable: program.exe and corresponding configuration file program.exe.config. In many scenarios this pattern is fitting well, but there are some cases when something else necessary. In my situation common configuration file was desirable! One configuration file with shared app settings, configuration strings, etc.

Read more

WPF - How to show ToolTip when control is disabled

By default tooltip is hidden when control is disabled. There is simple way to enable it. Code below show how to do that:

Read more

WPF - BrushConverter HTML (Hexadecimal) colors

Assigning HTML like colors (i.e. #318D38) in WPF application directly in XAML is very easy and smooth. For example code:

Read more

SnippetCompiler

SnippetCompiler is another useful tool for C# developers. Is quite similar to FastSharp. Both allow you to write and compile sample code very quickly. SnippetCompiler has IntelliSense support (missing in Fast Sharp), that gives benefits. Unfortunately, last version is from year 2008... supports .NET up to 3.5....

Read more

WPF TextBlock StringFormat

This post is not a hot news, but it may help somebody ;)

Read more

C# Configuration Custom Section – Configuration Element

Recently I needed a custom section in my app.config. Everything went fine until I got this exception: "The string must be at least 1 characters long." (System.Configuration.ConfigurationErrorsException type) while reading the custom section.....

Read more

C# Development (Yellow Book) – Rob Miles

Recently I found that book Rob Miles - C# Development, aka. Yellow Book. Available here.

Read more