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 T[] AsSingletonArray<T>(this T single) | |
| { | |
| return new[] {single}; | |
| } | |
| public static List<T> AsSingletonList<T>(this T single) | |
| { | |
| return new List<T> {single}; | |
| } |
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.Text; | |
| using System.Runtime.Remoting.Metadata.W3cXsd2001; | |
| public static string ToHexBytes(this string plainText, Encoding encoding = null) | |
| { | |
| encoding = encoding ?? Encoding.UTF8; | |
| var bytes = encoding.GetBytes(plainText); | |
| return new SoapHexBinary(bytes).ToString(); | |
| } | |
| public static string FromHexBytes(this string hexText, Encoding encoding = null) |
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
| // Create new object to cache iframe offsets | |
| $.ui.ddmanager.frameOffsets = {}; | |
| // Override the native `prepareOffsets` method. This is almost | |
| // identical to the un-edited method, except for the last part! | |
| $.ui.ddmanager.prepareOffsets = function (t, event) { | |
| var i, j, | |
| m = $.ui.ddmanager.droppables[t.options.scope] || [], | |
| type = event ? event.type : null, // workaround for #2317 | |
| list = (t.currentItem || t.element).find(":data(ui-droppable)").addBack(), |
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 T As<T>(this object objectToCast) | |
| { | |
| return objectToCast is T typedObject ? typedObject : default; | |
| } |
NewerOlder