My favorites | Sign in
Project Home Downloads Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;

namespace Konstruktor
{
public interface IScope : IDisposable
{

// Resolve in this scope or parent scopes, create a new instance in this scope if not available yet.
object resolve(Type t);

// Resolve in this scope: create a new instance that does not exist in this scope (ignoring the ancestor scopes).
object resolveLocal(Type t);

void store<TypeT>(TypeT instance);
void own(object instance_);

IScope beginNestedScope();

// internal
bool tryResolveExisting(Type t, out object o);
}

public static class ScopeExtensions
{
public static T resolve<T>(this IScope scope)
{
return (T) scope.resolve(typeof (T));
}

public static T resolveLocal<T>(this IScope scope)
{
return (T) scope.resolveLocal(typeof (T));
}
}
}

Change log

r45 by paramatrix on Sep 8, 2011   Diff
removed event wiring, see here why:
http://www.replicator.org/content
/convention-based-event-wiring
Go to: 
Project members, sign in to write a code review

Older revisions

r32 by paramatrix on Oct 1, 2010   Diff
support for Owned<T>, synchronized
2008,SL4 projects
r24 by paramatrix on Aug 5, 2010   Diff
split up builder and first
implementation of convention based
event wiring
r8 by paramatrix on Mar 26, 2010   Diff
renamed scope() to beginScope() and
createNestedScope() to
beginNestedScope()
All revisions of this file

File info

Size: 815 bytes, 35 lines
Powered by Google Project Hosting