This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IranianSystemEncoding | |
{ | |
static char[] ByteToChar; | |
static Byte[][] CharToByte; | |
static IranianSystemEncoding() | |
{ | |
InitializeData(); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
How to capture the whole screen: | |
var image = ScreenCapture.CaptureDesktop(); | |
image.Save(@"C:\temp\snippetsource.jpg", ImageFormat.Jpeg); | |
How to capture the active window: | |
var image = ScreenCapture.CaptureActiveWindow(); | |
image.Save(@"C:\temp\snippetsource.jpg", ImageFormat.Jpeg); | |
*/ | |
public class ScreenCapture | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
/// <summary> | |
/// Contains approximate string matching | |
/// </summary> | |
static class LevenshteinDistance | |
{ | |
/// <summary> | |
/// Compute the distance between two strings. | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
namespace NumberToWordsLib | |
{ | |
/// <summary> | |
/// Number to word languages | |
/// </summary> | |
public enum Language | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Utilties for reflection | |
/// </summary> | |
public static class ReflectionExtensions | |
{ | |
/// <summary> | |
/// Get all the fields of a class | |
/// </summary> | |
/// <param name="type">Type object of that class</param> | |
/// <returns></returns> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class BaseViewModel : INotifyPropertyChanged | |
{ | |
public event PropertyChangedEventHandler PropertyChanged; | |
protected virtual void OnPropertyChanged(string propertyName) | |
{ | |
PropertyChangedEventHandler handler = this.PropertyChanged; | |
if (handler != null) | |
{ | |
handler(this, new PropertyChangedEventArgs(propertyName)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Microsoft.Practices.Prism.Regions | |
{ | |
/// <summary> | |
/// Represent ILoadAware functionality for View-Model classes. | |
/// </summary> | |
public interface ILoadAware | |
{ | |
/// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
How use in View? | |
<PasswordBox> | |
<i:Interaction.Behaviors> | |
<local:PasswordBoxBindingBehavior Password="{Binding Password}"/> | |
</i:Interaction.Behaviors> | |
</PasswordBox> | |
How access to orginal string? | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace System | |
{ | |
public static class StringExtensions | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace System.Linq | |
{ | |
public static class LinqExtensions |