Format:
Recent snippets matching tags of .Net
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WebBrowser1.Navigate(Application.StartupPath) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim MyYoutube As New YTEngine MyYoutube.YT_StartProcessing(TextBox1.Text) PictureBox1.ImageLocation = MyYoutube.YT_Return_Video_Thumbnail PictureBox1.Tag = MyYoutube.YT_Return_Titled_Download_URL PictureBox1.Name = MyYoutube.YT_Return_Video_Title + ".flv"
29 Views
no comments
/// <summary> /// Returns the content of the POST buffer as string /// </summary> /// <returns></returns> public static string FormBufferToString() { HttpRequest Request = HttpContext.Current.Request; if (Request.TotalBytes > 0) return Encoding.Default.GetString(Request.BinaryRead(Request.TotalBytes));
15 Views
no comments
// la la la if (foo is ISomeInterface) { ((ISomeInterface)foo).SomeMethod(); } else if (foo is ISomeOtherInterface) { ((ISomeOtherInterface)foo).SomeMethod(); } else { throw new SomeException();
121 Views
2 comments
' I watched Karl's video about validation with custom rules, and wondered ' why Silverlight, ASP.NET and ASP.NET MVC had DataAnnotations, and ' WPF only had IDataErrorInfo. So I thought of using EF4 as the model, ' and generating a metadata class like in RIA, MVC, etc for WPF and a ' inheritable generic class to convert the validations between IDataErrorInfo ' and the DataAnnotation attributes. ' ' This way validation can happen the same way for each type of client! ' ' Let me know what you think please?
88 Views
no comments
Dim fc As New System.Drawing.Text.InstalledFontCollection Fonts = (From x In Enumerable.Range(0, fc.Families.Count) _ Select New With {.Id = x + 1, _ .Name = fc.Families(x).Name, _ .SortOrder = (x + 1) * 100}).ToList fc = Nothing
31 Views
no comments
Imports System.Net Imports System.Net.NetworkInformation Imports System.Threading Imports System.Text Public Class Form1 Private Sub SimpleButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton1.Click MemoEdit1.Text = ""
34 Views
no comments
' Import ... Public Module EnvironmentEvents ' Autogenerated code ... Private Sub BuildEvents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildDone If (DTE.ToolWindows.ErrorList.ErrorItems.Count = 0) Then SelectRootNode() DTE.ExecuteCommand("TestDriven.NET.RunTests")
59 Views
no comments
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated from a template. ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Compare Binary
64 Views
no comments
Try Habanero.Base.GlobalRegistry.ApplicationName = "IGD" Habanero.Base.GlobalRegistry.ApplicationVersion = "v1.0" HabaneroApplication = New Habanero.UI.Win.HabaneroAppWin(Habanero.Base.GlobalRegistry.ApplicationName, Habanero.Base.GlobalRegistry.ApplicationVersion) HabaneroApplication.ClassDefsXml = IGD.BO.BOBroker.GetClassDefsXml() If Not HabaneroApplication.Startup() Then Throw New Exception("Unable to start Habanero Application") End If
43 Views
no comments
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { Response.Write(DropDownList1.SelectedValue); } protected void ButtonSave_Click(object sender, EventArgs e) { int n = SqlDataSource1.Insert(); if (n == 1) Response.Redirect("ViewGuestBook.aspx");
37 Views
no comments
public interface ICriteriaQuery<TEntity> { DetachedCriteria Criteria { get; } } public interface ILinqQuery<TEntity> { Expression<Func<TEntity, bool>> Expression { get; } }
77 Views
no comments
public static IEnumerable<TSource> Distinct<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> selector) { return source.Distinct(new SelectorEqualityComparer<TSource, TKey>(selector)); }
85 Views
no comments
public static IEnumerable<TSource> Distinct<TSource>(this IEnumerable<TSource> source, Func<TSource, TSource, bool> predicate) { return source.Distinct(new PredicateEqualityComparer<TSource>(predicate)); }
89 Views
no comments
[Serializable] public class SelectorEqualityComparer<TSource, Tkey> : EqualityComparer<TSource> { private Func<TSource, Tkey> selector; public SelectorEqualityComparer(Func<TSource, Tkey> selector) : base() { this.selector = selector; }
94 Views
no comments
[Serializable] public class PredicateEqualityComparer<T> : EqualityComparer<T> { private Func<T, T, bool> predicate; public PredicateEqualityComparer(Func<T, T, bool> predicate) : base() { this.predicate = predicate; }
61 Views
no comments
using System; using System.Linq; using System.Text; using System.Web.Mvc; using System.Web.Mvc.Html; using System.Web.Routing; namespace MvcSamples.Html { public static class UrlExtensions
281 Views
1 comments
/* Author: Mohammad Azam http://www.highoncoding.com This is a much better version than I demonstrated in the screencast! */
221 Views
no comments
{
"Fields":[
{
"FieldName":"Name",
"ReplaceValidationMessageContents":true,
"ValidationMessageId":"Name_validationMessage",
"ValidationRules":[
{
"ErrorMessage":"Meno musí mať 5 až 40 znakov.",
"ValidationParameters":{
147 Views
no comments
//Classe I want to resolve from ILogger but want to register public class AdvancedLogger : ILogger, IRequired { } public class OtherClass : IOtherInterface, IRequired { }
55 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Configuration; using System.Data.OleDb; using System.Data.SqlClient; using System.Data;
79 Views
no comments
public class URLRewriterModule : IHttpModule { /// <summary> /// You will need to configure this module in the web.config file of your /// web and register it with IIS before being able to use it. For more information /// see the following link: http://go.microsoft.com/?linkid=8101007 /// </summary> #region IHttpModule Members public void Dispose()
83 Views
no comments
<Target Name="AfterMerge"> <ItemGroup> <JsFiles Include="$(TempBuildDir)\Scripts\infinitecarousel.js;$(TempBuildDir)\Scripts\jquery.autocomplete.js;$(TempBuildDir)\Scripts\core.js"/> <CssFiles Include="$(TempBuildDir)\Content\reset.css;$(TempBuildDir)\Content\infinitecarousel.css;$(TempBuildDir)\Content\Site.css" /> </ItemGroup> <ReadLinesFromFile File="%(JsFiles.Identity)"> <Output TaskParameter="Lines" ItemName="jsLines"/> </ReadLinesFromFile>
567 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Text.RegularExpressions; using System.Reflection; using Activity_Search.Code; namespace Activity_Search.Controllers
99 Views
no comments
/// <summary>
/// Extension methods on HtmlHelper and UrlHelper that provide strongly-typed access to URLs and ActionLinks for AccountController actions
/// </summary>
public static class HelperExtensionsForAccountController
{
/// <summary>
/// Html Helpers for Controller = Account
/// </summary>
public static AccountControllerActionLinks Account(this HtmlHelper htmlHelper)
{
410 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
