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.IO; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace Signatures | |
| { | |
| /// <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
| public static class DrawingUtils | |
| { | |
| // Extension method to convert an image into a byte array | |
| public static byte[] ToBytes(this Bitmap image, ImageFormat imageFormat = null) | |
| { | |
| if (imageFormat != null) | |
| { | |
| using (MemoryStream stream = new MemoryStream()) |
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 static int GetJenkinsHash(this int[] values) | |
| { | |
| unchecked | |
| { | |
| uint hash, i; | |
| for (hash = i = 0; i < values.Length; ++i) | |
| { | |
| hash += (uint)(values[(int)i]); | |
| hash += (hash << 10); | |
| hash ^= (hash >> 6); |
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 static string GetPlural(this string name) | |
| { | |
| if (string.IsNullOrEmpty(name)) | |
| { | |
| return string.Empty; | |
| } | |
| name = name.Trim(); | |
| char lastChar = name[name.Length - 1]; | |
| switch (char.ToLower(lastChar)) | |
| { |
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; | |
| public static class LinqUtil | |
| { | |
| public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> items) | |
| { | |
| foreach (T item in items) |
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.Runtime.InteropServices; | |
| namespace Service | |
| { | |
| #region Service Installer | |
| /// <summary> | |
| /// Windows service installer helper class. | |
| /// </summary> | |
| /// <remarks> |
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> | |
| /// Main entry point of the service. | |
| /// </summary> | |
| /// <param name="args">Arguments specified for the service.</param> | |
| static void Main(string[] args) | |
| { | |
| if (args.Length > 0) | |
| { | |
| if (args[0].ToLower() == "/install") | |
| { |
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.Net; | |
| using System.Text; | |
| namespace ResponseFramework | |
| { | |
| public interface IResponse<T> | |
| { |
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 enum TimeFormat | |
| { | |
| Auto, | |
| IfPresent, | |
| Always, | |
| Today, | |
| Never | |
| } | |
| public static class DateExtensions |
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
| var qsParm = new Array(); | |
| qsParm["viewMode"] = "Default"; | |
| qsParm["forMobile"] = "false"; | |
| function parseQueryString() { | |
| var query = window.location.search.substring(1); | |
| var parms = query.split('&'); | |
| for (var i = 0; i < parms.length; i++) { | |
| var pos = parms[i].indexOf('='); | |
| if (pos > 0) { |
OlderNewer