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> | |
| /// Wrapper for GDI text rendering functions<br/> | |
| /// This class is not thread-safe as GDI function should be called from the UI thread. | |
| /// </summary> | |
| /// <remarks> | |
| /// http://theartofdev.com/2013/08/12/using-native-gdi-for-text-rendering-in-c/<br/> | |
| /// The MIT License (MIT) Copyright (c) 2014 Arthur Teplitzki. | |
| /// </remarks> | |
| public sealed class NativeTextRenderer : IDisposable | |
| { |
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 class Test | |
| { | |
| private const int BaseIterations = 3; | |
| private const int RenderIterations = 10000; | |
| private const string TestString = "Test-s.tri,ng m(g=j{}3)"; | |
| private static readonly Font _font1 = new Font("Arial", 11); | |
| // private static readonly Font _font1 = new Font("Segoe UI", 9); | |
| // private static readonly Font _font1 = new Font("Tahoma", 10); | |
| // private static readonly Font _font1 = new Font("Microsoft Sans Serif", 9); |
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.Globalization; | |
| using System.Net; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| public class GoogleAuthenticator | |
| { | |
| const int IntervalLength = 30; | |
| const int PinLength = 6; |