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
public class Base | |
{ | |
private bool _Initialized; | |
private void _EnsureInitialized() { if(!_Initialized) _Initialize(); } | |
private void _Initialize() { Initialize(); _Initialized = true; } | |
public virtual void Initialize() | |
{ |
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
public interface ICommandRepository<T> | |
{ | |
void SaveOrUpdate<U>(U item) where U: T; | |
void Delete<U>(U item) where U: T; | |
} | |
/* then, library code asks for ICommandRepository<Core.Customer> and so do clients. | |
However, when clients call SaveOrUpdate, they'll be passing a Extended.Customer, | |
but when library code calls it, they'll be passing what they think is a Core.Customer | |
(though it will still be a Extended.Customer, of course). |
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
private class RefVisitor: BaseReflectionVisitor | |
{ | |
public override void VisitModuleDefinition(ModuleDefinition module) | |
{ | |
module.Types.Accept(this); | |
VisitCollection(module.Types); | |
} | |
public override void VisitTypeDefinition(TypeDefinition type) | |
{ |
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
// field _LookAhead | |
Node Operand() | |
{ | |
Node ret; | |
if(matches(TokenId.Identifier)) | |
{ | |
ret = new Node() | |
{ | |
Value = _LookAhead.TokenText, |
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
void Main() | |
{ | |
var rootList = new List<Node>(new[]{ new Node() }); // only ever one root, I assume. | |
var childrenAtThisLevel = FillLevel(rootList); | |
while(childrenAtThisLevel.Count > 0) | |
childrenAtThisLevel = FillLevel(childrenAtThisLevel); | |
} | |
List<Node> FillLevel(List<Node> childrenAtThisLevel) | |
{ |
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
[merge] | |
keepBackup = false; | |
tool = p4merge | |
[mergetool "p4merge"] | |
cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED" | |
keepTemporaries = false | |
trustExitCode = false | |
keepBackup = false |
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
public interface IQueueWatcher | |
{ | |
void Start(); | |
} | |
public interface IQueueMessageProcessor | |
{ | |
void ProcessMessage(byte[] messageBytes); | |
} |
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
public class PostStatusCodeMessageHandler: DelegatingChannel | |
{ | |
public PostStatusCodeMessageHandler(HttpMessageChannel innerChannel) | |
: base(innerChannel) | |
{ | |
} | |
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) | |
{ | |
var task = base.SendAsync(request, cancellationToken); |
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 System.Collections.Generic; | |
using System.Linq; | |
using System.Threading; | |
namespace ThreadingApp | |
{ | |
public interface ITask | |
{ | |
void Execute(); |
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 System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using Milliman.MGAlfa.AplInterface; | |
using Mono.Cecil; | |
using Mono.Cecil.Cil; | |
using NUnit.Framework; |
OlderNewer