AES Cryptography

Contains the code for AES encryption and decryption in C#. 1: public byte [] EncryptText(string plainData) 2: { 3: RijndaelManaged rij = new RijndaelManaged(); 4: 5: rij.GenerateKey(); 6: _key = rij.Key; 7:  8: rij.GenerateIV(); 9: _intializationVector = rij.IV; 10:  11: ICryptoTransform encryptor = rij.CreateEncryptor(_key, _intializationVector); 12:  13: using (MemoryStream msEncrypt = new MemoryStream()) 14: {... Continue Reading →

UI Updates – Part 1

Updating the UI is a problem and it is tricky. There are very few simple rules to follow. Let’s see Here we’ll see  some smart ways to perform UI updates on Console applications, Windows Forms, WPF, ASP.NET, Silverlight, Windows Phone and Windows Store apps. Console Applications Do they have UI ? No. But we’ll check... Continue Reading →

Extension Methods

Extension methods in C# is a great way to add functionality to a closed class. Here the word ‘closed’ refers to both the sealed ones and the classes which you do not have the access to their source code. Some can argue if we can actually add a method to a sealed class then it... Continue Reading →

Silverlight Dispatcher

Threading in Silverlight is simple and have very few classes and limited functionality. In Silverlight we rarely go for the threading since the platform itself is asynchronous. Click to read how to do asynchronous programming in C# 5.0 In Silverlight the  main thread is incorporated with the Dispatcher, and we can use the BeginInvoke method... Continue Reading →

Adapter Pattern

Adapter pattern is often mentioned as wrapper in normal convention. It is a pattern which introduces loose coupling when creating a middle interface between two unmatched types. The name itself, self describes itself.  Think we have a class which renders a dataset on the screen. So we’ve a working class like this. class Renderer {... Continue Reading →

Powered by WordPress.com.

Up ↑

%d bloggers like this: