Skip to content

Instantly share code, notes, and snippets.

View kellypleahy's full-sized avatar

Kelly Leahy kellypleahy

View GitHub Profile
// field _LookAhead
Node Operand()
{
Node ret;
if(matches(TokenId.Identifier))
{
ret = new Node()
{
Value = _LookAhead.TokenText,
private class RefVisitor: BaseReflectionVisitor
{
public override void VisitModuleDefinition(ModuleDefinition module)
{
module.Types.Accept(this);
VisitCollection(module.Types);
}
public override void VisitTypeDefinition(TypeDefinition type)
{
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).
public class Base
{
private bool _Initialized;
private void _EnsureInitialized() { if(!_Initialized) _Initialize(); }
private void _Initialize() { Initialize(); _Initialized = true; }
public virtual void Initialize()
{