<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - bryanlyman</title>
<link>http://snipplr.com/users/bryanlyman/tags/bryan</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Thu, 23 May 2013 06:44:28 GMT</pubDate>
<item>
<title>(VB.NET) Global System Object extensions for easier conditionals (VB.net example)</title>
<link>http://snipplr.com/view/59759/global-system-object-extensions-for-easier-conditionals-vbnet-example/</link>
<description><![CDATA[ <p>Because there is no way to use object extenders in vb.net here is an example of how you can get similar functionality. See the C# example for further info.</p> ]]></description>
<pubDate>Fri, 14 Oct 2011 16:45:34 GMT</pubDate>
<guid>http://snipplr.com/view/59759/global-system-object-extensions-for-easier-conditionals-vbnet-example/</guid>
</item>
<item>
<title>(C#) System Object extensions for easier conditionals (Extending Base Object Types)</title>
<link>http://snipplr.com/view/53894/system-object-extensions-for-easier-conditionals-extending-base-object-types/</link>
<description><![CDATA[ <p>.net 3.0+, To create stability in your code, you must check all inputs into a method to make sure they are valid . Often people overlook this step because of laziness, or because they aren't convinced that exceptions and assertions are actually in place to help you instead of cause you a headache. Here are some extensions which can be used to enhance the System.Object class so that their methods are global to all classes; this makes input checking effortless. This is also somewhat generic in nature because the extensions take no class type in to account before they are called, but we can use type checking to perform different boxing (casting) operations.  Sadly this cannot be done in VB.net because late binding restrictions do not allow the Object class to be extended (See my VB.Net example for further information).</p> ]]></description>
<pubDate>Sat, 21 May 2011 02:48:17 GMT</pubDate>
<guid>http://snipplr.com/view/53894/system-object-extensions-for-easier-conditionals-extending-base-object-types/</guid>
</item>
<item>
<title>(C#) Constructing Generics Through Reflection (List of Mixed Types Example)</title>
<link>http://snipplr.com/view/33857/constructing-generics-through-reflection-list-of-mixed-types-example/</link>
<description><![CDATA[ <p>.net 2.0+ Generic classes make code size much smaller and casting objects (boxing) a cinch. However, currently there are some unsupported IDE options when trying to cast objects to and from generic objects that use mixed object types (inherited from a generic type specifier). Fear not, using reflection we can bypass the IDE and supply the users with strongly typed objects.</p> ]]></description>
<pubDate>Tue, 04 May 2010 16:58:15 GMT</pubDate>
<guid>http://snipplr.com/view/33857/constructing-generics-through-reflection-list-of-mixed-types-example/</guid>
</item>
<item>
<title>(C#) Asynchronous ASP.Net Pages, AJAX Helper, WebRequest Passthrough</title>
<link>http://snipplr.com/view/28142/asynchronous-aspnet-pages-ajax-helper-webrequest-passthrough/</link>
<description><![CDATA[ <p>.net 3.0+, Ajax calls allow for true asynchronous communication through a browser. You may not notice it until you have a server call that takes awhile, but just because AJAX is allowing it, that doesn't mean the server is acting in a truly asynchronous manner. By default aspx pages will asynchronously allow multiple calls to the same session, however, a thread-lock is placed on each subsequent call so that each incoming request must wait for the previous to finish before the response stream can be accessed. This is a nice protection measure to keep a page programmer from ripping their hair out because of multi-threading data access issues and dead-lock scenarios; but it is inversely annoying to one trying to allow asynchronicity. The solution to allow true multi-threaded asynchronous behavior isn't an easy one, but the following code is a step in the right direction. The first thing you should know is that to make a page act asynchronously is to set the "Async" attribute in the page directive of the aspx page being called </p> ]]></description>
<pubDate>Wed, 10 Feb 2010 16:21:15 GMT</pubDate>
<guid>http://snipplr.com/view/28142/asynchronous-aspnet-pages-ajax-helper-webrequest-passthrough/</guid>
</item>
<item>
<title>(C#) Presentation Framework Imaging Classes Gray-Scale Example (loading, drawing, encoding)</title>
<link>http://snipplr.com/view/27700/presentation-framework-imaging-classes-grayscale-example-loading-drawing-encoding/</link>
<description><![CDATA[ <p>You must include these DLL references in your vsweb or vscode project:\r\nPresentationCore,\r\nPresentationFramework,\r\nWindowsBase. \r\nNotice how I am manipulating the RGB values of each pixel, this is the power of these classes. The Drawing classes have the pixel drawing capabilities to draw lines and such already written for you, but handling a grayscale byte for byte is faster than relying on their other classes. I also chose to load and encode as PNG, but they have loaders and encoders for other file types as well that work the same way.</p> ]]></description>
<pubDate>Thu, 04 Feb 2010 12:51:39 GMT</pubDate>
<guid>http://snipplr.com/view/27700/presentation-framework-imaging-classes-grayscale-example-loading-drawing-encoding/</guid>
</item>
<item>
<title>(C#) Generic list wrapper returns a smaller strongly typed sub-list  which modifies the parent-list when changed (without events)</title>
<link>http://snipplr.com/view/26884/generic-list-wrapper-returns-a-smaller-strongly-typed-sublist--which-modifies-the-parentlist-when-changed-without-events/</link>
<description><![CDATA[ <p>A class which wraps a parent list containing mixed object types, to provide smaller strongly typed sub-lists of objects. These sub-lists can be modified, which then modifies the parent list concurrently (without events being triggered). Supports the merging of other lists of the same type. Supports serialization. Supports parent list auto-instantiation.</p> ]]></description>
<pubDate>Fri, 22 Jan 2010 19:24:16 GMT</pubDate>
<guid>http://snipplr.com/view/26884/generic-list-wrapper-returns-a-smaller-strongly-typed-sublist--which-modifies-the-parentlist-when-changed-without-events/</guid>
</item>
<item>
<title>(JavaScript) Cross-Browser event triggering</title>
<link>http://snipplr.com/view/25592/crossbrowser-event-triggering/</link>
<description><![CDATA[ <p>A browser friendly way to trigger an event on an element. This is just a simple snippet which doesn\'t really explain the detailed contents of an event object, but it gives an idea of the differences between specific browsers. This function will fire the onChange event for an element passed to it (say...a checkbox).</p> ]]></description>
<pubDate>Mon, 28 Dec 2009 12:43:29 GMT</pubDate>
<guid>http://snipplr.com/view/25592/crossbrowser-event-triggering/</guid>
</item>
<item>
<title>(C#) Enum Limitation Fix Using a Generic Class and Implicit Casting</title>
<link>http://snipplr.com/view/24778/enum-limitation-fix-using-a-generic-class-and-implicit-casting/</link>
<description><![CDATA[ <p>For .net 2.0+   The one limitation to enumerations is revealed when you try to reverse lookup an enumeration value using Enum.Parse(). The parse function will return an inconsistent enum object if ever there are two or more enumerations with the same numeric value. This class fixes that problem. Written as a system extension and using implicit casting, the process has been made extremely easy and made the syntax for the parse function even simpler. The process even allows enumeration names starting with a number or the name of a C# keyword as long as the name is preceded by an underscore. The implicit cast from an Enum object to a Enum.Cast object has been deliberately left out to account for single directional assignment, which forces the class to be used properly. An Enum to Cast object lookup would defeat the whole purpose of the class if the implicit operator is used during runtime; for this purpose a user assignment operator of type String is supplied. This simply forces the user to use Cast = Enum.ToString() to parse to a correct object. The ToString() overload for a Cast object returns a Friendly name which replaces all underscores with spaces and even allows double underscores for commas and triple underscores for periods; for this reason, the implicit \"from string\" caster also converts from a friendly name to the proper Enum object. This makes it very handy for enumerating through a list of items for a combo or list box and converting back to the proper object by simply supplying the name of the list item.</p> ]]></description>
<pubDate>Mon, 14 Dec 2009 18:03:38 GMT</pubDate>
<guid>http://snipplr.com/view/24778/enum-limitation-fix-using-a-generic-class-and-implicit-casting/</guid>
</item>
<item>
<title>(CSS) Cross-Browser Auto Vertical/Horizontal Centering (Chrome &amp;amp; Forms Compatible)</title>
<link>http://snipplr.com/view/24618/crossbrowser-auto-verticalhorizontal-centering-chrome--forms-compatible/</link>
<description><![CDATA[ <p>A way to do 100% DIVs that adjust to content and center themselves both vertically and horizontally automatically. Tested for all browsers at 1920X1080 resolution. The 96% body height fixes Firefox and IE scrollbars that appear without reason and might need to be adjusted for smaller or larger windows.</p> ]]></description>
<pubDate>Fri, 11 Dec 2009 12:24:58 GMT</pubDate>
<guid>http://snipplr.com/view/24618/crossbrowser-auto-verticalhorizontal-centering-chrome--forms-compatible/</guid>
</item>
</channel>
</rss>