void ITopicOwned.SetOwner(Topic owner) { if (_owner != owner) { if (_owner != null) { _owner.Unsubscribe("+", _owner_changed); Change_A(null); Change_B(null); _parent = null; } _owner = owner as DVar<PiWire>; if (_owner != null) { _owner.saved = true; var dc = _owner.Get<string>("_declarer"); dc.saved = true; dc.value = "Wire"; if (_owner.parent != null && _owner.parent.valueType == typeof(PiLogram)) { _parent = (_owner.parent as DVar<PiLogram>).value; } _owner.Subscribe("+", _owner_changed); if (exec) { Change_A(_a); Change_B(_b); } } } }
public void SetOwner(Topic owner) { if(owner!=_owner) { if(_owner!=null) { _owner.Unsubscribe("+", _owner_changed); } _parent=null; RefreshExec(); _owner=owner as DVar<PiStatement>; if(_owner!=null) { if(_owner.parent!=null && _owner.parent.valueType==typeof(PiLogram)) { _parent=(_owner.parent as DVar<PiLogram>).value; } RefreshExec(); } } }