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;
        }
Ejemplo n.º 2
0
        public SmartSource Copy()
        {
            SmartSource se = new SmartSource(Id)
            {
                ReadableHint = ReadableHint, DescriptionRules = DescriptionRules
            };

            for (int i = 0; i < ParametersCount; ++i)
            {
                se.SetParameterObject(i, GetParameter(i).Clone());
            }
            return(se);
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
 public SmartGenericJsonData?TryGetSourceData(SmartSource s) =>
 smartDataManager.Contains(SmartType.SmartSource, s.Id) ? smartDataManager.GetRawData(SmartType.SmartSource, s.Id) : null;