This file contains 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
(function ($) { | |
$.fn.switchery = function (option) { | |
$(this).each(function () { | |
if (typeof option === "string") { | |
var switchery = $(this).data("jquery.switchery"); | |
if (switchery) { | |
if (option.toLowerCase() == "check") { | |
if (!switchery.isChecked()) { | |
$(switchery.switcher).click() | |
} |
This file contains 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 HtmlExtension | |
{ | |
private static string[] htmlBooleanAttributes = (new[] { "selected", "checked", "disabled", "readonly", "multiple" }).SelectMany(x => new[] { x + "=\"\"", x + "=\"false\"" }).ToArray(); | |
public static IHtmlString HackIt(this IHtmlString htmlString) | |
{ | |
if (htmlString != null) | |
{ | |
string str = htmlString.ToString(); | |
foreach (var attribute in htmlBooleanAttributes) | |
{ |
This file contains 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 Program | |
{ | |
public static void GenerateImageFileThumb(string file, string outputFile, float width, float height, ThumbOption option) | |
{ | |
if (option == ThumbOption.Scale) | |
{ | |
using (Bitmap image = new Bitmap(file)) | |
{ | |
float scale = Math.Min(width / image.Width, height / image.Height); |