This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Castle.Facilities.TypedFactory; | |
using Castle.MicroKernel.Registration; | |
using Castle.Windsor; | |
namespace castlething | |
{ | |
public class Program | |
{ | |
public interface IMathService |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var defaultFormatters = GlobalConfiguration.Configuration.Formatters | |
.Where(f => f.SupportedMediaTypes | |
.Any(m => m.MediaType.ToString(CultureInfo.InvariantCulture) == "application/xml" | |
|| m.MediaType.ToString(CultureInfo.InvariantCulture) == "text/xml")) | |
.ToList(); | |
foreach (var match in defaultFormatters) | |
{ | |
GlobalConfiguration.Configuration.Formatters.Remove(match); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dataSource = new SqlServerDataSource | |
{ | |
ConnectionString = "connection-string" | |
}; | |
var procedure = new StoredProcedure("SomeStoredProcedureName"); | |
procedure.AddInput("parameter", "value"); | |
dataSource.Execute(procedure, t => | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type d -maxdepth 1 -exec sh -c '(cd {} && git branch -l | grep $1 && pwd)' ';' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task PrepareClickOnce { | |
write-host 'Add mage to our path' | |
$env:path += ";C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools" | |
write-host "Preparing install directory" | |
$installersRoot = '..\installers\app' | |
if (test-path $installersRoot) { | |
Write-Host "Cleaning installers root" | |
rm -r -force $installersRoot > $null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source.MyEvent += | |
delegate(object s, EventArgs e) | |
{ | |
DoSomething(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source.MyEvent += | |
delegate(object s, EventArgs e) | |
{ | |
DoSomething(); | |
}; |
NewerOlder