StrangeIoC  0.6.0
The IoC/Binding Framework for Unity3D and C#
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Properties | List of all members
strange.extensions.context.impl.Context Class Reference

A Context is the entry point to the binding framework. More...

Inheritance diagram for strange.extensions.context.impl.Context:
strange.framework.impl.Binder strange.extensions.context.api.IContext strange.framework.api.IBinder strange.framework.api.IBinder strange.extensions.context.impl.CrossContext strange.extensions.context.impl.MVCSContext

Public Member Functions

 Context (object view, ContextStartupFlags flags)
 
 Context (object view)
 
 Context (object view, bool autoMapping)
 
virtual IContext SetContextView (object view)
 Set the object that represents the top of the Context hierarchy. More...
 
virtual object GetContextView ()
 Get the ContextView.
 
virtual IContext Start ()
 Call this from your Root to set everything in action.
 
virtual void Launch ()
 The final method to fire after mappings. More...
 
virtual IContext AddContext (IContext context)
 Add another Context to this one.
 
virtual IContext RemoveContext (IContext context)
 Remove a context from this one.
 
virtual object GetComponent< T > ()
 Retrieve a component from this Context by generic type.
 
virtual object GetComponent< T > (object name)
 Retrieve a component from this Context by generic type and name.
 
virtual void AddView (object view)
 Register a View with this Context.
 
virtual void RemoveView (object view)
 Remove a View from this Context.
 
- Public Member Functions inherited from strange.framework.impl.Binder
delegate void BindingResolver (IBinding binding)
 A handler for resolving the nature of a binding during chained commands.
 
virtual IBinding Bind< T > ()
 Bind a Binding Key to a class or interface generic.
 
virtual IBinding Bind (object key)
 Bind a Binding Key to a value.
 
virtual IBinding GetBinding< T > ()
 Retrieve a binding based on the provided Type.
 
virtual IBinding GetBinding (object key)
 Retrieve a binding based on the provided object.
 
virtual IBinding GetBinding< T > (object name)
 Retrieve a binding based on the provided Key (generic)/Name combo.
 
virtual IBinding GetBinding (object key, object name)
 Retrieve a binding based on the provided Key/Name combo.
 
virtual void Unbind< T > ()
 Remove a binding based on the provided Key (generic)
 
virtual void Unbind (object key)
 Remove a binding based on the provided Key.
 
virtual void Unbind< T > (object name)
 Remove a binding based on the provided Key (generic) / Name combo.
 
virtual void Unbind (object key, object name)
 Remove a binding based on the provided Key / Name combo.
 
virtual void Unbind (IBinding binding)
 Remove the provided binding from the Binder.
 
virtual void RemoveValue (IBinding binding, object value)
 Remove a select value from the given binding.
 
virtual void RemoveKey (IBinding binding, object key)
 Remove a select key from the given binding.
 
virtual void RemoveName (IBinding binding, object name)
 Remove a select name from the given binding.
 
virtual IBinding GetRawBinding ()
 Generate an unpopulated IBinding in whatever concrete form the Binder dictates.
 
virtual void ResolveBinding (IBinding binding, object key)
 This method places individual Bindings into the bindings Dictionary as part of the resolving process. More...
 
virtual void OnRemove ()
 The Binder is being removed Override this method to clean up remaining bindings.
 

Public Attributes

bool autoStartup
 If false, the Launch() method won't fire.
 

Static Public Attributes

static IContext firstContext
 In a multi-Context app, this represents the first Context to instantiate.
 

Protected Member Functions

virtual void addCoreComponents ()
 Override to add componentry. Or just extend MVCSContext.
 
virtual void instantiateCoreComponents ()
 Override to instantiate componentry. Or just extend MVCSContext.
 
virtual void mapBindings ()
 Override to map project-specific bindings.
 
virtual void postBindings ()
 Override to do things after binding but before app launch.
 
- Protected Member Functions inherited from strange.framework.impl.Binder
virtual void resolver (IBinding binding)
 The default handler for resolving bindings during chained commands.
 
void registerNameConflict (object key, IBinding newBinding, IBinding existingBinding)
 Take note of bindings that are in conflict. More...
 
bool isConflictCleared (Dictionary< IBinding, object > dict, IBinding binding)
 Returns true if the provided binding and the binding in the dict are no longer conflicting.
 
void clearConflict (object key, object name, Dictionary< IBinding, object > dict)
 
T[] spliceValueAt< T > (int splicePos, object[] objectValue)
 
object[] spliceValueAt (int splicePos, object[] objectValue)
 Remove the item at splicePos from the list objectValue.
 

Properties

object contextView [get, set]
 The top of the View hierarchy. More...
 

Additional Inherited Members

- Protected Attributes inherited from strange.framework.impl.Binder
Dictionary< object, Dictionary
< object, IBinding > > 
bindings
 Dictionary of all bindings Two-layer keys. More...
 
Dictionary< object, Dictionary
< IBinding, object > > 
conflicts
 

Detailed Description

A Context is the entry point to the binding framework.

Extend this class to create the binding context suitable for your application.

In a typical Unity3D setup, extend MVCSContext and instantiate your extension from the ContextView.

Member Function Documentation

virtual void strange.extensions.context.impl.Context.Launch ( )
inlinevirtual

The final method to fire after mappings.

If autoStartup is false, you need to call this manually.

Implements strange.extensions.context.api.IContext.

Reimplemented in strange.extensions.context.impl.MVCSContext.

virtual IContext strange.extensions.context.impl.Context.SetContextView ( object  view)
inlinevirtual

Set the object that represents the top of the Context hierarchy.

In MVCSContext, this would be a GameObject.

Reimplemented in strange.extensions.context.impl.MVCSContext.

Property Documentation

object strange.extensions.context.impl.Context.contextView
getset

The top of the View hierarchy.

In MVCSContext, this is your top-level GameObject


The documentation for this class was generated from the following file: