WX5.ObjectManager Class Reference
Provides links between objects.
More...
List of all members.
Public Member Functions |
| ObjectManager () |
| Initializes the constructed ObjectManager object.
|
ObjectManager | Bind (object target, string targetMember, object source, string sourceMember, bool isSourceUpdatable) |
| Binds the source member with the target member
objManager.Bind(myListBox, "SelectedIndex", myState, "_currentId", true);
|
ObjectManager | Bind (object target, string targetMember, object source, string sourceMember) |
| Binds the source member with the target member The source is not updateable.
|
ObjectManager | Bind (object target, BlockX< object > source) |
| Binds the target member with the block of code.
|
ObjectManager | UpdateTargets () |
| Updates all targets.
|
ObjectManager | UpdateSources () |
| Updates all updateable sources.
|
Static Public Member Functions |
static ObjectManager | NewObjectManager () |
| Returns new instance of ObjectManager.
|
Detailed Description
Provides links between objects.
class A {
private int _id;
public int getId(){return _id;}
public void setId(int x){ _id = x; }
}
class B {public int ID;}
class C {
public static void Main() {
WX5.ObjectManager m = new WX5.ObjectManager();
A a = new A(); B b = new B();
m.Bind(a, "_id", b, "ID", true);
b.ID = 5;
m.UpdateTargets();
bool result = a.getId() == b.ID;
a.setId(-1);
m.UpdateSources();
bool result2 = a.getId() == b.ID;
}
}
Constructor & Destructor Documentation
WX5.ObjectManager.ObjectManager |
( |
|
) |
|
Member Function Documentation
ObjectManager WX5.ObjectManager.Bind |
( |
object |
target, |
|
|
BlockX< object > |
source | |
|
) |
| | |
Binds the target member with the block of code.
- Parameters:
-
| target | target object |
| source | a code to update |
- Returns:
- current ObjectManager instance
ObjectManager WX5.ObjectManager.Bind |
( |
object |
target, |
|
|
string |
targetMember, |
|
|
object |
source, |
|
|
string |
sourceMember | |
|
) |
| | |
Binds the source member with the target member The source is not updateable.
- Parameters:
-
| target | target object |
| targetMember | target member: field or property |
| source | source object |
| sourceMember | source member: field or property |
- Returns:
- current ObjectManager instance
ObjectManager WX5.ObjectManager.Bind |
( |
object |
target, |
|
|
string |
targetMember, |
|
|
object |
source, |
|
|
string |
sourceMember, |
|
|
bool |
isSourceUpdatable | |
|
) |
| | |
Binds the source member with the target member
objManager.Bind(myListBox, "SelectedIndex", myState, "_currentId", true);
- Parameters:
-
| target | target object |
| targetMember | target member: field or property |
| source | source object |
| sourceMember | source member: field or property |
| isSourceUpdatable | True if source object can be updated using target object |
- Returns:
- current ObjectManager instance
static ObjectManager WX5.ObjectManager.NewObjectManager |
( |
|
) |
[static] |
Updates all updateable sources.
- Returns:
Updates all targets.
- Returns: