CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of SHA
C#
SPListItem item = properties.ListItem;
 
SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Customer");
SPFieldUserValue fieldValue = (SPFieldUserValue)userField.GetFieldValue(item[userField.ID].ToString());
string customerEmail = fieldValue.User.Email;
by jaredmroberts   December 15, 2011 @ 1:35pm
54 Views
no comments
 
C#
Sol Reqs:
.NET 3.5
x64
Add Ref: Microsoft.SharePoint assembly 
 
// Applying a template to a new site
Site Actions –> New Site. You'll find your Site Template in the list of Installed Items, in the All Categories or Blank & Custom filters.
 
//  how to upgrade the content database - after applying SP1
C:\Program Files\Common Files\Microsoft Shared\Web ServerExtensions\14\bin\psconfig.exe –cmd upgrade
by Jose David Parra   August 11, 2011 @ 7:48pm
193 Views
no comments
 
Get-Process | Where-Object {$_.ProcessName -like "w*"}
 
Table 1-4. Commonly Used Windows PowerShell Comparison Operators
 
Operator    Purpose
-lt    Less than
-le    Less than or equal to
-gt    Greater than
-ge    Greater than or equal to
-eq    Equal to
by Jose David Parra   August 10, 2011 @ 3:42pm
79 Views
no comments
 
<!--In the html add this some where -->
<script type="text/javascript"> 
  var addthis_share = { templates: { twitter: 'check out {{url}} (from @example_dot_com)'}, url:'http://www.mywebsite.com' }
  var addthis_config = { ui_email_note: 'you custom message here', ui_email_to: 'you@yahoo.com', ui_email_from: 'me@yahoo.com' }
</script>
 
<!-- AddThis Button BEGIN (Some where in the html)-->
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" >
    <a class="addthis_button_facebook"></a>
    <a class="addthis_button_twitter"></a>
by Egli   August 09, 2011 @ 10:50pm
89 Views
no comments
 
JetBrains.ReSharper.Psi.Parsing.UnexpectedToken occurred
  Message=Unexpected token
  Source=JetBrains.ReSharper.Psi.CSharp
  StackTrace:
       at JetBrains.ReSharper.Psi.CSharp.Gen.CSharpParserGenerated.match(NodeType tokenType)
  InnerException: 
 
  
  JetBrains.Application.Progress.ProcessCancelledException occurred
  Message=Exception of type 'JetBrains.Application.Progress.ProcessCancelledException' was thrown.
by Geoff   June 16, 2011 @ 8:34am
Tags: ReSharper
124 Views
no comments
 
C#
namespace SharePointUpload {
    class Program {
        static void Main(string[] args) {
            ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback((a, b, c, d) => { return true; });
            WEB_REFERENCE_NAME.Imaging img = new WEB_REFERENCE_NAME.Imaging();
            img.UseDefaultCredentials = true;
            img.Url = "SHAREPOINT_SITE/_vti_bin/imaging.asmx";
            try {
                foreach (string filename in Directory.GetFiles("LOCAL_FOLDER")) {
                    img.Upload("PICTURE_LIBRARY_NAME", "PICTURE_FOLDER_IF_ANY", File.ReadAllBytes(filename), Path.GetFileName(filename), true);
by Veshiy0leg   May 31, 2011 @ 2:26pm
126 Views
no comments
 
C#
namespace SharePointUpload {
    class Program {
        static void Main(string[] args) {
            ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback((a, b, c, d) => { return true; });
            WEB_REFERENCE_NAME.Imaging img = new WEB_REFERENCE_NAME.Imaging();
            img.UseDefaultCredentials = true;
            img.Url = "SHAREPOINT_SITE/_vti_bin/imaging.asmx";
            //img.up
            try {
                //var x = img.GetListItems("Implementation Team Photos", "");
by Veshiy0leg   May 31, 2011 @ 2:25pm
81 Views
no comments
 
module HDF5_185
  open System
  open System.Text
  open System.Runtime.InteropServices
  
  
  type double1d = System.Double[]
  type double2d = System.Double[,]
  type double3d = System.Double[,,]
  #nowarn "51" // no warnings for native pointer use (they are used as stand ins for byref)
by Robert Nielsen   January 09, 2011 @ 3:44pm
Tags: F Sharp, F#, HDF, HDF5.
308 Views
1 comments
 
<a href="http://drury.blog.sector.sk/blogclanok/8720/sector_awards_2010.htm"><img title="2. Najlepšia ikonka za rok 2010" src="http://i.imgur.com/R2rdz.png" alt="2. Najlepšia ikonka za rok 2010" border="0"></a>
by Drury   December 26, 2010 @ 4:49am
105 Views
no comments
 
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <style type="text/css">
          .sys-template
          {
            display: none;
          }
    </style>
    
<script src="../Scripts/MicrosoftAjax/MicrosoftAjax.js" type="text/javascript"></script> 
<script src="../Scripts/MicrosoftAjax/MicrosoftAjaxDataContext.js" type="text/javascript"></script>
by Ross   August 11, 2010 @ 7:41am
572 Views
no comments
 
C#
 
/// <summary>
///This is a test class for MemberTest and is intended
///to contain all MemberTest Unit Tests
///</summary>
[TestClass()]
public class MemberTest
{
    public void CanGetArgHelper(string argument)
    {
by Jonathan Chayce Dickinson   April 13, 2010 @ 3:07am
190 Views
no comments
 
C#
 
/// <summary>
/// Represents static and extension methods to retrieve the name
/// of a member or argument from lamba expressions.
/// </summary>
public static class Name
{
    /// <summary>
    /// Gets the name of a member or argument from a lamba expression.
    /// </summary>
by Jonathan Chayce Dickinson   April 13, 2010 @ 3:05am
173 Views
no comments
 
XML
<CustomPatterns>
  <Pattern Severity="SUGGESTION">
    <Comment>Use method Any()</Comment>
    <ReplacePattern>$seq$.Any()</ReplacePattern>
    <SearchPattern><![CDATA[$seq$.Count() > 0]]></SearchPattern>
    <Params />
    <Placeholders>
      <ExpressionPlaceholder Name="seq" ExpressionType="System.Collections.IEnumerable" ExactType="False" />
    </Placeholders>
  </Pattern>
by Jon Erickson   April 07, 2010 @ 8:51am
570 Views
no comments
 
C#
public class ErrorModel : IEnumerable<string>
{
    public IEnumerator<string> GetEnumerator()
    {
        throw new NotImplementedException();
    }
 
    IEnumerator IEnumerable.GetEnumerator()
    {
        return GetEnumerator();
by Jeremy Brayton   March 17, 2010 @ 9:01am
139 Views
no comments
 
C#
using System;
using System.Collections;
using System.IO;
using System.Text;
 
namespace Handlers
{
    
    /// <summary>
    /// A data-reader style interface for reading Csv (and otherwise-char-separated) files.
by Utkarsh Puranik   February 23, 2010 @ 3:44am
799 Views
no comments
 
 /*database name here*/
 $database = '';
 /*host name for MySQL*/
 $hostname = 'localhost';
 /*user name for MySQL*/
 $username = '';
 /*password for MySQL*/
 $password = '';
 
 //Get the h3fileid
by CodeMonkey76   February 10, 2010 @ 10:58pm
214 Views
no comments
 
C#
[ContextAction(Group = "C#", Name = "ConvertSpacesToUnderscore", Description = "Adds context action to convert spaces in method names to underscore")]
public class ConvertSpacesToUnderscore : BulbItemImpl, IContextAction
{
    readonly ICSharpContextActionDataProvider _provider;
 
    public ConvertSpacesToUnderscore(ICSharpContextActionDataProvider provider)
    {
        _provider = provider;
    }
by Geir-Tore Lindsve   February 03, 2010 @ 1:05am
512 Views
no comments
 
syntax: glob
Obj
obj
Bin
bin
*.user
*.suo
*.Cache
*.cache
*.bak
by Andy Sherwood   January 26, 2010 @ 8:48pm
1054 Views
no comments
 
C#
foreach (var group in groups)
                {
                    if (group.AllowsPermission(permissionType))
                    {
                        cache.Put(cacheKey, new List<bool> {true});
                        return true;
                    }
                }
 
by Steven Burman   December 23, 2009 @ 4:48pm
296 Views
no comments
 
XML
<TemplatesExport family="Live Templates">
  <Template uid="9860a3ff-f597-476b-bb22-88e8c6d13244" shortcut="taf" description="Test with Assert.Fail" text="[Test]&#xD;&#xA;public void $Action$_$Scenario$_$Result$()&#xD;&#xA;{&#xD;&#xA;    Assert.Fail();&#xD;&#xA;}&#xD;&#xA;" reformat="True" shortenQualifiedReferences="True">
    <Context>
      <CSharpContext context="TypeMember" minimumLanguageVersion="2.0" />
    </Context>
    <Categories />
    <Variables>
      <Variable name="Action" expression="" initialRange="0" />
      <Variable name="Scenario" expression="" initialRange="0" />
      <Variable name="Result" expression="" initialRange="0" />
by Andy Sherwood   August 27, 2009 @ 9:54am
Tags: tdd, resharper
311 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate