View Common.targets
<!-- | |
*********************************************************************************************** | |
Embed in csproj with import and the build events are hooked up automatically | |
<Import Project="..\..\..\Common.targets" Condition="Exists('..\..\..\Common.targets')" /> | |
PreBuild - Handling revision on build so the source control revision number of the project folder is embeded in the last numeric of the projects AssemblyInfoVersion and AssemblyInfoFileVersion | |
PostBuild - Sets revision to 0 and reverts the file with a copy upon finishing for not introducing change on version control for the assemblyInfo.cs | |
In debug mode the revision detection is disabled, and notification is shown instead. | |
View BatchCommands.cs
/// <summary> | |
/// Handle Database operations | |
/// </summary> | |
/// <remarks>The default network packet size is 4,096 bytes. More information at http://technet.microsoft.com/en-us/library/ms177437.aspx </remarks> | |
public class BatchCommands | |
{ | |
private StringBuilder _query = new StringBuilder(); | |
private int _bufferLength = 0; | |
public static string ConnectionString | |
{ |
View UnitTestIHttpActionResult.cs
[TestMethod] | |
public void Study_DatetimeOffsets_in_DayViewModel() | |
{ | |
// http://www.asp.net/web-api/overview/testing-and-debugging/unit-testing-controllers-in-web-api | |
// The controller is returning IHttpActionResult, so look at the sample in the bottom of the ms article. | |
// Using OkNegotiatedContentResult safecast resulted in a null in my case. | |
var controller = new DayController(); | |
controller.Request = new HttpRequestMessage(); | |
controller.Configuration = new HttpConfiguration(); |
View DefaultDocumentsHttpModule.cs
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Web; | |
/// <summary> | |
/// Respect the DefaultDocuments even when Umbraco takes over the HttpModule pipeline | |
/// Add file to App_Code (or compile with your project) and | |
/// Add to web.config on system.web > httpModules add name="MyDefaultDocumentsHttpModule" type="DefaultDocumentsHttpModule" |
View SitecoreNantWebService.asmx.cs
namespace FemtenNulOtte.NAnt.WebService | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
using System.Web; | |
using System.Web.Services; | |
using System.Xml.Serialization; |
View MailEncryption.cs
namespace FemtenNulOtte.Client.Logic.Utilities | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net.Mail; | |
using System.Net.Mime; | |
using System.Security.Cryptography.Pkcs; | |
using System.Security.Cryptography.X509Certificates; |
View SteamGroupRelationsProgram.cs
using System.IO; | |
namespace ConsoleApplication4_steamapi | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Security.Policy; | |
using System.Text; |
View FTPLocalSync.cmd
"C:\Program Files (x86)\WinSCP\winscp" /console /script="FTPLocalSync.winscp" |
View AutoGenerated Sitecore Entity Classes (sample).cs
namespace Client.Logic.Entities.Client.Pages.Blog | |
{ | |
using global::System; | |
using global::System.Collections.Generic; | |
using global::System.Linq; | |
using global::System.Text; | |
using FemtenNulOtte.Core.Entities; | |
using FemtenNulOtte.Core.Entities.Context; |
View DatabaseStorageUsageQuery.sql
SET NOCOUNT ON | |
SELECT '$(ServerName)' AS ServerName | |
,CAST( DB_NAME(mf.database_id) AS varchar) AS databaseName | |
,CAST(size_on_disk_bytes AS varchar(15)) as size_on_disk | |
,CAST(dbs.state_desc AS varchar(10)) as [state] | |
,CAST(dbs.recovery_model_desc AS varchar(10)) as rec_model | |
,CAST(dbusers.name AS varchar(10)) as [Owner] | |
,CAST(num_of_reads AS varchar(15)) as num_of_reads | |
,CAST(num_of_bytes_read AS varchar(15)) as num_of_bytes_read | |
,CAST(io_stall_read_ms AS varchar(15)) as io_stall_read_ms |
NewerOlder