private void HandleInstanceMemberSetByUi(object sender, EventArgs e) { if (PropertyChange != null) { PropertyChangedArgs args = new PropertyChangedArgs(); args.Owner = this.Instance; args.NewValue = LateBinder.GetValueStatic(this.Instance, ((InstanceMember)sender).Name); args.PropertyName = ((InstanceMember)sender).Name; PropertyChange(((InstanceMember)sender).Name, args); } foreach (var item in InternalControl.Items) { MemberCategory memberCategory = item as MemberCategory; foreach (var instanceMember in memberCategory.Members) { if (instanceMember.Name != ((InstanceMember)sender).Name) { instanceMember.SimulateValueChanged(); } } } RefreshDelegateBasedElementVisibility(); }
public Tweener Tween(string member, float value, float time, InterpolationType interpolation, Easing easing) { MemberToSet = member; object currentValueAsObject = LateBinder.GetValueStatic(Caller, member); if (currentValueAsObject is float) { float currentValue = (float)currentValueAsObject; Tweener tweener = new Tweener(currentValue, value, time, interpolation, easing); tweener.PositionChanged = HandlePositionSet; tweener.Owner = Caller; TweenerManager.Self.Add(tweener); tweener.Start(); return(tweener); } else { throw new NotImplementedException(); } }
public void MakeNewObjectUnique(DataTypes.ArrowElementSave container, object newObject) { string name = LateBinder.GetValueStatic(newObject, "Name") as string; List <string> allNames = new List <string>(); foreach (var item in container.AllInstances) { if (item != newObject) { allNames.Add(LateBinder.GetValueStatic(item, "Name") as string); } } name = StringFunctions.MakeStringUnique(name, allNames); LateBinder.SetValueStatic(newObject, "Name", name); }
public bool IsInstanceNameValid(string name, out string whyIsntValid, object instanceSave, ArrowElementSave container) { whyIsntValid = null; foreach (var instanceObject in container.AllInstances) { if (instanceObject != instanceSave && LateBinder.GetValueStatic(instanceObject, "Name") as string == name) { whyIsntValid = "The name " + name + " is already being used by another object"; break; } } if (string.IsNullOrEmpty(whyIsntValid)) { IsInstanceNameValid(name, out whyIsntValid); } return(string.IsNullOrEmpty(whyIsntValid)); }
public Tweener Using(InterpolationType interpolation, Easing easing) { object currentValueAsObject = LateBinder.GetValueStatic(Caller, MemberToSet); if (currentValueAsObject is float) { float currentValue = (float)currentValueAsObject; Tweener tweener = new Tweener(currentValue, ValueToSet, (float)TimeToTake, interpolation, easing); tweener.PositionChanged = HandlePositionSet; TweenerManager.Self.Add(tweener); tweener.Start(); return(tweener); } else { throw new NotImplementedException(); } }