| | Title | Abstract | Author |
| 1135 | csharp | SqlDataReader | Creates a using block for a given SqlCommand and opens a while loop on SqlDataReader.Read() for that Command. | Stefan Baumgartner |
| 1134 | CSharp | throw new NotImplementedException | thrni -> throw new NotImplementedException(""); | |
| 1133 | CSharp | throw new ApplicationException | thra -> throw new ApplicationException(""); | |
| 1132 | CSharp | throw new | thr -> throw new | |
| 1131 | XML | Silverlight clientaccespolicy.xml | Template for creating a clientaccesspolicy.xml for use in Silverlight cross domain enabling web services. | Tim Heuer |
| 1130 | CSharp |
Constrain a variable to a range.
| Rather that using the potentially slow Math.Max(Math.Min()) rather use a ternary if operator. | |
| 1129 | VB | Save Window Size Settings | Saves a windows size to settings if the window is a normal state. | Andrew Jackson |
| 1128 | VB | Save Window Location Settings | Saves a windows location to settings if the window is a normal state. | Andrew Jackson |
| 1127 | VB | Load Window Size Settings | Loads a windows previous size from settings, checking for first use and using design default if not specified. | Andrew Jackson |
| 1126 | VB | Load Window Location Settings | Loads a windows previous location from settings, checking for first use and using design default if not specified. | Andrew Jackson |
| 1125 | VB | Auto Upgrade Settings | Auto Upgrade the settings from a previous version if it exists. | Andrew Jackson |
| 1124 | VB | Insert Wait Cursor Block Default | Inserts a block of code setting the cursor to wait, then default. | Andrew Jackson |
| 1123 | VB | Insert Wait Cursor Block remembering the previous cursor | Inserts a block of code setting the cursor to wait, then revert to the previous cursor. | Andrew Jackson |
| 1122 | csharp | Ternary Operator | Insert a template Ternary operator in the format (Condition ? true : false);
Shortcut is Ternary | Andrew Jackson |
| 1121 | VB | BugsTrace.call | This snippet inserts the BugsTrace.call statement. Locate it wherever you want to trace program flow or critical variable values, in place of comments. See BugsTrace.doc.snippet for instructions. | Paul Noeldner |
| 1120 | VB | BugsTrace.function | This is part of a 3 snippet set:
bugstrace.doc.snippet, bugstrace.call.snippet, and bugstrace.function.snippet | Paul Noeldner |
| 1119 | VB | BugsTrace.function | This is part of a 3 snippet set:
bugstrace.doc.snippet, bugstrace.call.snippet, and bugstrace.function.snippet | Paul Noeldner |
| 1118 | VB | BugsTrace.doc | BugsTrace provides a very lightweight, easily deployed developer message trace capability
that is not dependent on the application, language, framework, or runtime tools for use.
Instant BugsTraces can contribute greatly to rapid development, testing, and debugging.
The BugsTrace output only has trace statements and information the developer wanted to include, making it much more easily readable for rapid testing and debugging. I wrote the BASIC version in the 1980's and have reused it in many different languages and environments including VB, C, C#, PHP, Ruby and COBOL. All work the same using a simple text file as the trace toggle and trace content. System security controls read and write access. The code can be customized but that is not required. It can stay in the application throughout it's life cycle and deployment contexts with very negligible performance impact. For VB 2005, there are 3 snippet files: bugstrace.call, bugstrace.method, and bugstrace.doc. Enjoy! | Paul Noeldner |
| 1117 | CSharp | Declare Event | Define an event with generic eventhandler. Only provide public add and remove methods | |
| 1116 | CSharp |
Property_declaration
| Property declare template | |
| 1115 | CSharp |
Custom_event_args_class
| Custom Event Args template | |
| 1114 | CSharp | QueryString Property | A QueryString (as in GET parameter) Property with replaceables for type, property name, and GET parameter. More info: http://www2.john.rummellcc.com/2007/05/querystring-property-c-code-snippet.html | John Rummell |
| 1113 | csharp | Resize an Image | ReSize an Image | |
| 1112 | csharp | operator == | operator == snippet | Dmitry Garaev |
| 1111 | csharp | Assertion2 | Assertion with exception that allows you to include a variable's value in the error message | James Blasius |
| 1110 | csharp | Assertion1 | Assertion/Exception combination inspired by Debugging .Net 2.0 Applications | James Blasius |
| 1109 | csharp | ternay | Insert ternary (single line compact conditional) operator | Brad Wood |
| 1108 | csharp | propStringLazy | Lazy load of a string from the app.config file with a backing field and a default value (string.Empty if not specified). | Anton Delsink |
| 1107 | csharp | propTypedLazy | Lazy load of a value type property from the app.config file; has backing field and default value and initializes with the value type's default value if none is specified. | Anton Delsink |
| 1106 | VB | Count the Words in a Text String | Count the words in a text string where a word is assumed to be delimited by spaces. | Dan Mabbutt |
| 1105 | csharp | propAmdLazy | Lazy load property from AppSettings in .config with a default value and backing fields. | Anton Delsink |
| 1104 | VB | Property With Region | This is the VB.NET version of Mike Palermo's Property with Region code snippet. Original from the Great Jennifer C with a slight modification! | Samson Loo |
| 1103 | csharp | ViewState Property | Generates property that is stored in the ViewState bag of an ASP.NET control or page.
More info here:
http://blogs.vizibility.net/sdobrev/archive/2006/09/30/Code-Snippets-Returned.aspx | Stefan Dobrev |
| 1102 | csharp | If Item or AlternatingItem | Checks whether the item type is item or alternating item.
More info here:
http://blogs.vizibility.net/sdobrev/archive/2006/09/30/Code-Snippets-Returned.aspx
| Stefan Dobrev |
| 1101 | csharp | Web Control Event | Generates event that can be used in ASP.NET control or page.
More info here:
http://blogs.vizibility.net/sdobrev/archive/2006/09/30/Code-Snippets-Returned.aspx | Stefan Dobrev |
| 1100 | csharp | Event Log Helper | Event Log helper. Code to write to the event log | Doron Grinstein |
| 1099 | csharp | hacetodo | This snippet creates all you need to start to program your class. It creates a namespace, a class, four private fields and a public property for each field, a void constructor and a constructor that receives a parameter to initialize each field. The names, types and visibility are custom. | Roberto Linares |
| 1098 | csharp | Singleton | This snippets creates a Singleton Class, as a result of the discussion happened on this post of mine:
http://blogs.ugidotnet.org/piyo/archive/2005/09/14/Singleton_C_NET.aspx | Simone Chiaretta |
| 1097 | csharp | SnippetFile1 | calc | |
| 1096 | csharp | for | Nested for loop. with row and column structure. Simple.
| Prithvi Tomer |
| 1095 | csharp | valnull | Updated 'valnull'
This snippet validates an argument in a method and checks for null. It throws a ArgumentNullException.
| |
| 1094 | csharp |
valnull
| ValNull
This snippet checks if an argument is null. It allows you to enter the argument name and the method name. | |
| 1092 | csharp | mbox | test | |
| 1091 | VB | SQLHelper | Ejemplo Integración SQL Server y CLR
Funciones LPAD y RPAD en SQL Server | Rolando Escobar |
| 1090 | csharp |
Method with Region
| Create a C# method wrapped in a named region. | Steve Rock |
| 1089 | VB | Property With Region | This is the VB.NET version of Mike Palermo's Property with Region code snippet. | Jennifer Campion |
| 1088 | csharp | AsyncEventBasedPattern | Implementing the Event-based Asynchronous Pattern without supports multiple concurrent invocations | Konstantin Savelev |
| 1086 | VB | SeesionReader | This Snippet read a field in table from dataset session | Duong Hong Minh |
| 1085 | VB | SessionWriter | This Snippet use to save a value to specific field in table of session | Duong Hong Minh |
| 1084 | VB | | Read filed from table from dataset Session | Duong Hong Minh |
| 1083 | VB | Round the Corners of a Form | Round the corners of a windows form | |
| 1082 | CSharp | nUnit TestFixture | Create an empty nUnit testfixture, namespace plus class including attributed empty methods for startup/teardown and testfixture -startup/-teardown. Finally a first empty test. | Magnus Martensson |
| 1081 | csharp | Create Comparer By a Property | Create a class that inherits from IComparer<> and which uses a property to compare the objects. | Rick Love |
| 1080 | csharp | Immutable Class or Struct | Create a class or struct with private readonly fields and readonly Properties and a constructor to initialize the values. | |
| 1079 | csharp | Immutable Class or Struct | Create an immutable class or struct with readonly fields, readonly properties, and a constructor to initialize the values. | |
| 1078 | VB | Create Virual Directory Class | Create IIS Virtual Directory Usage: Dim vir As New CreateVirualDirectory vir.CreateWebFolder(vir.GetCurrentPath() & "\SampleVDir", "SampleVDir", True) vir.CreateWebFolder("c:\temp\SampleVDirI", "SampleVDirI", False) vir.CreateWebFolder("c:\temp\SampleVDirII", "SampleVDirII", True) | .net noobie |
| 1077 | csharp | (EntitySpaces) - bind collection to dropdownlist | bind an EntitySpaces collection to a dropdownlist. Also uses the [table].Metadata.ColumnNames object to get the column names. | Sean Rock |
| 1076 | csharp | GridView Binding with Select (EntitySpaces) | a simple binding example using an EntitySpaces collection. esCollection is the type name, e.g. EmployeesCollection, collectionname is your instance name and contol is the control to bind the collection to. | |
| 1075 | CSharp | Simple LoadByPrimaryKey | dOOdads (www.mygenerationsoftware.com) snippet for simple load by primary key. | Mateusz Kierepka |
| 1074 | CSharp | Simple Load (using query) | dOOdads (www.mygenerationsoftware.com) snippet for simple query. | Mateusz Kierepka |
| 1073 | CSharp | Simple Load | dOOdads (www.mygenerationsoftware.com) snippet for loadAll (using stored procedure). | Mateusz Kierepka |
| 1072 | CSharp | More Complex Load (using query) | dOOdads (www.mygenerationsoftware.com) snippet for more Complex Load (using query). | Mateusz Kierepka |
| 1071 | VB | New Custom Collection | Creates a custom Collection Class in Visual Basic .NET | Joshua Camara |
| 1070 | csharp | Write Text to a File (just 3 lines of code) | Writes text to a text file. If the file already exists, all of its text will be replaced. Remember, you can use the string "\r\n" to insert newline breaks in the text. This code is adapted from the MSDN article "Writing to a Text File (Visual C#)." | Daniel W. Allen |
| 1069 | csharp | ASyncComponentPattern | This snippet creates an Async class contruct and includes commented-out code that can be cut-pasted for use in the caller code. | Tony Yates |
| 1068 | csharp | Test string for null or empty | Inserts a string.IsNullOrEmpty test block, either with Insert Snippet... or Surround With... | Andrej Tozon |
| 1067 | csharp | trycf | Wraps selected code in a try block. Adds catch AND finally blocks as well. | Eric Burcham |
| 1066 | csharp | btrydonutn | Try & catch but do nothing. Typically I will initialize a variable to null, attempt to get it in a try/catch and then if it was gotten - and not null - then I do something more. Used in situations where the code is not critical, but we still must catch possible exceptions. | Maud Dib |
| 1065 | csharp | aprop bool | Snippet for encapsulating a private bool field with a property enforsing PascalStyle for property name and _PascalStyle for field name. The _ allows the name to be grouped in intellisence away from letter a-z. | Maud Dib |
| 1064 | csharp | aprop str | Snippet for encapsulating a private string field with a property enforsing PascalStyle for property name and _PascalStyle for field name. The _ allows the name to be grouped in intellisence away from letter a-z. | Maud Dib |
| 1063 | csharp | aprop int | Snippet for encapsulating a private int field with a property enforsing PascalStyle for property name and _PascalStyle for field name. The _ allows the name to be grouped in intellisence away from letter a-z. | Maud Dib |
| 1062 | csharp | testunit | Create a unit test method with the test attribute. | Mike Weerasinghe |
| 1061 | csharp | wcur | Sets the current cursor to WaitCursor, creates a try/finally block, and restores the cursor in the "finally" section. | Matt Hamilton |
| 1060 | csharp | Public Property | An improved property snippet. | |
| 1058 | VB | Singleton Pattern Implementation | Singleton Pattern Implementation | Adrian Godong |
| 1057 | csharp | WCF Service | The snippet automates generating a simple WCF (Indigo) contract and the matching implementing service. The service uses the best practices for transaction context, transaction voting, and instance management. | Juval Lowy, IDesign Inc. |
| 1056 | csharp | Create Text File and Write Text | This C# code snippet creates a new text file in the file system and adds text into it. The File Name and two (2) text items can be changed by the user. | Manoj Matchado, MVP |
| 1055 | csharp | Singleton | we all aware of Singleton class and very frequently we are using in our projects.This custom snippet helps to define a Singletone class. | Anand Kumar |
| 1054 | csharp | OpenFileDialog block | This snippet inserts a code block for bringing up an OpenFileDialog, allowing you to change the dialog variable name and the filter string, ending up inside the OK (user clicked Open) block. | Brian Noyes |
| 1053 | csharp | propm | A faster code snippet for property definition complying with the IDesign coding standard - specifically that wrapped member variables have the same name as their corresponding property, prefixed by m_. Also has the get/set blocks expanded for easier code insertion. Based on the built-in prop code snippet. | Brian Noyes |
| 1052 | csharp | event | creates a 2.0 event, including the EventArgs subclass (since usually EventArgs isn't enough, you want to add more information) and declaration of the event using EventHandler<SubclassOfEventArgs> as per the 2.0 design guidelines to use EventHandler<T> | Microsoft Corporation |
| 1051 | csharp | tw | Expand Trace.WriteLine(); | Axel Rietschin |
| 1050 | csharp | dw | Expand Debug.WriteLine(); | Axel Rietschin |
| 1049 | csharp | da | Expand Debug.Assert(); | Axel Rietschin |
| 1048 | csharp | ane | Test for null parameter | Axel Rietschin |
| 1047 | VB | Replace Last Occurence of a String | Replace last string
Please see Francesco's article: http://www.devx.com/dotnet/Article/28997 | Francesco Balena, Michael Sanchez |
| 1046 | XML | WSDL Definitions | Please see Jeffrey's blog for more information:
http://pluralsight.com/blogs/jeffsch/archive/2005/06/23/11754.aspx | Jeffrey Schlimmer |
| 1045 | csharp | EventHandlerList.DataEvent | EventHandlerList.DataEvent is basically the same as EventHandlerList.Event, the difference is that it allows you to specify an EventsArgs that suits your needs. | Pieter Jansen van Vuuren |
| 1044 | csharp | EventHandlerList.Event | EventHandlerList.Event uses EventHandlerList to implement events in an object. | Pieter Jansen van Vuuren |
| 1043 | csharp | EventHandlerList | Implement the EventHandlerList for an object.
See the EventHandlerList.Event and EventHandlerList.DataEvent snippets of how to use EventHandlerList | Pieter Jansen van Vuuren |
| 1042 | csharp | Singleton | Implementing the Singleton Pattern in C# - fully lazy instantiation as per http://www.yoda.arachsys.com/csharp/singleton.html | Pieter Jansen van Vuuren |
| 1041 | csharp | IDisposable | Code snippet for IDisposable pattern declaration | Konstantin Savelev |
| 1040 | csharp | Connection string using DbProviderFactory | Code snippet to take connection string form configuration and create provider factory. | Mike Chaliy |
| 1039 | csharp | XPath select first node. | Code snippet to select value from the first node returned by specified XPath query | Mike Chaliy |
| 1038 | csharp | Caption | Header comment caption for code blocks | Mike Chaliy |
| 1037 | VB | Async Amazon Item Search Request | How to create and process an async web method call using the 'ItemSearch' method of the Amazon e-commerce service | Lorenzo Minore |
| 1029 | csharp | Groovy Property Snippet | Creates a property in C# with wrapping around a private field enforcing the _ prefix. It also provides commenting and encloses the property in a region | J. Michael Palermo IV |
| 1027 | csharp | Property with Value | Extension of default prop snippet, but this one allows for a default value.
Shortcut name: propv
Language: C# | Ben Scheirman |
| 1026 | csharp | Property of Generic List | Property exposing a list of objects using generics. | J. Michael Palermo IV |
| 1025 | XML | Code Snippet Deployment Manifest | There are options for deploying code snippets, one of which is to use the Visual Studio 2005 VSI model. This code snippet is an XML snippet to help you create the required .vscontent file associated with the VSI file. | Tim Heuer |
| 1024 | CSharp | Email using System.Net | A simple snippet to create a mail message and SMTP client using the System.Net.Mail class libraries. This is a simple starter shell to emit the most basic properties. | Tim Heuer |
| 1023 | csharp | event | Code snippet for an event and the associated On<EventName> method. | Wesley Brown |
| 1022 | csharp | fun | This snippet creates a function in a class. | Daniel Skibinski |
| 1021 | csharp | met | This snippet creates a method in a class. | Daniel Skibinski |
| 1020 | csharp | npropg | Late-binding getter only property store. Constructs a type using an empty constructore if the backing property is null. | Joe Modjeski |
| 1019 | csharp | cprop | Component property that builds out an On[PropName]Changed event along with the property and backing store. | Joe Modjeski |
| 1018 | csharp | Connection | Snippet for database connections. | Gaidar Magdanurov |
| 1017 | CSharp | Web Control Property | Creates a property (with get and set) which stores a value in viewstate. Useful in custom web controls. | Luke Foust |