public SmartAction(int id, SmartSource source, SmartTarget target) : base(SmartActionParametersCount, id) { if (source == null || target == null) { throw new ArgumentNullException("Source or target is null"); } Source = source; Target = target; }
public SmartTarget Copy() { SmartTarget se = new SmartTarget(Id) { ReadableHint = ReadableHint, DescriptionRules = DescriptionRules, X = X, Y = Y, Z = Z, O = O, IsPosition = IsPosition }; for (int i = 0; i < ParametersCount; ++i) { se.SetParameterObject(i, GetParameter(i).Clone()); } return(se); }
public SmartAction(int id, SmartSource source, SmartTarget target) : base(SmartActionParametersCount, id) { if (source == null || target == null) { throw new ArgumentNullException("Source or target is null"); } this.source = source; this.target = target; source.OnChanged += SourceOnOnChanged; target.OnChanged += SourceOnOnChanged; comment = new ParameterValueHolder <string>("Comment", new StringParameter()); comment.PropertyChanged += (_, _) => { CallOnChanged(); OnPropertyChanged(nameof(Comment)); }; Context.Add(new MetaSmartSourceTargetEdit(this, true)); Context.Add(new MetaSmartSourceTargetEdit(this, false)); }
public SmartGenericJsonData?TryGetTargetData(SmartTarget t) => smartDataManager.Contains(SmartType.SmartTarget, t.Id) ? smartDataManager.GetRawData(SmartType.SmartTarget, t.Id) : null;