public void SetRuntimeValue(Activity activity, object value) { if (activity == null) { throw new ArgumentNullException("activity"); } Activity dataSourceObject = Helpers.ParseActivityForBind(activity, this.Name); if (dataSourceObject != null) { MemberInfo memberInfo = GetMemberInfo(dataSourceObject.GetType(), this.Path, null); if (memberInfo != null) { ActivityBind bind = GetMemberValue(dataSourceObject, memberInfo, this.Path, null) as ActivityBind; if (bind != null) { bind.SetRuntimeValue(dataSourceObject, value); } else { MemberBind.SetValue(dataSourceObject, this.Path, value); } } } }
protected virtual void SetBoundValue(ActivityBind bind, object value) { if (bind == null) { throw new ArgumentNullException("bind"); } Activity activity = this.ResolveOwnerActivity(); if (activity != null) { bind.SetRuntimeValue(activity, value); } }
public void SetGetRuntimeValue () { object obj; string st = string.Empty; ClassProvider cp = new ClassProvider (); ActivityBind ab = new ActivityBind ("ClassProvider", "Name"); obj = ab.GetRuntimeValue (cp, st.GetType ()); Assert.AreEqual ("Hello", obj.ToString (), "C1#1"); ab.SetRuntimeValue (cp, "Bye"); obj = ab.GetRuntimeValue (cp, st.GetType ()); Assert.AreEqual ("Bye", obj.ToString (), "C1#2"); }
public void SetRuntimeValueNull () { string st = string.Empty; ActivityBind ab = new ActivityBind ("ClassProvider", "Name"); ab.SetRuntimeValue (null, null); }