Tag Archives: My projects

C# 6.0 Exception Filters. try catch when

Advertisement from Google Exception filters is a new C# 6.0 feature. Visual Basic.NET and F# have this functionality for a long time. That is because exception filtering was implemented in CIL but not in C#. Now, this technique available for us. That’s how you can use it: try { Method(); } catch (Win32Exception ex) when (ex.NativeErrorCode… Read More »

C# 6.0 Auto-Property Initializers

The next new feature of the C# 6.0 is auto-property initializers and get-only auto property. The main problem that they suppose to solve is immutable type declaration. Before C# 6.0, if you want to create immutable type with properties, you have no possibility to use auto property: public string Property { get; set; } So, you… Read More »

C# 6.0 String Interpolation

One of the top ten requests on uservoice is String Interpolation. Today we are going to see how to use this feature and how it is implemented in C# 6.0. We all use similar expressions: var str = string.Format("Date: {0}", DateTime.Now); This is string interpolation in C# before 6.0. Now, in C# 6.0, we have new string interpolation… Read More »

Raspberry Pi 2 Benchmark. Linux vs Windows

I have installed Windows 10 on Raspberry Pi 2, then I have created a simple C# application for it. Now, I am curious what is the difference in performance between Windows 10 IoT Core and Raspbian. To test that I will run a simple C# code on both OS. Code I will do a simple calculation in… Read More »

Create C# Universal Application for Raspberry Pi 2

It is time to create our first C# Windows 10 Universal Application for Raspberry Pi 2. You can find LED blinking example in an official documentation, so today we are gonna create weather application. This application will connect to the remote server and get actual weather information based on city and country name, and display this information… Read More »

[Unity3d] Yet Another State Machine for Unity3d

If logic in your controller to complex for ‘if’ or ‘switch\case’ constructions, here is small State Machine implementation for you. Let’s start with example how to use this state machine, and then we go through implementation details: public class Test : MonoBehaviour { private StateMachine stateMachine; private State firstState = new State(); private State secondState… Read More »

[Unity3d] How-to play video in Unity project. MovieTexture

If you want to play movie clip in your Unity3d project you need to have Pro version! If you are using Windows machine you also need to have QuickTime installed. After you have everything prepared just drag (or copy) your movie clip into Asset folder, after that you will see it imported. You need a MovieTexture instance… Read More »

[vNext] ASP.NET 5 Dependency Injection with Autofac

In this part of the vNext tale, I am gonna tell you about dependency injection in ASP.NET 5 (vNext) stack. Default Dependency Injection container First, let’s see what is shipped with ASP.NET 5 by default. There is already simple DI container. It gives you a possibility to register service with three different lifetimes: scope, singleton and transient.… Read More »

[Unity3d] ReadOnly InputField

New UI system was introduced in Unity3d 4.6, it includes InputField control, but this field could not be read only. You can make it non interactable by disabling “Interactable” property in the editor, but then you will not be able to select and copy text from InputField. To have proper ReadOnly input field you should… Read More »