Ejemplo n.º 1
0
 protected Operator(IElementCreationContext context, IVplType type)
     : base(context)
 {
     if (type == null)
     {
         throw new ArgumentNullException(nameof(type));
     }
     _type = type;
 }
Ejemplo n.º 2
0
        public ArgumentVariable(IElementOwner owner, IVplType type, IArgument argument)
            : base(owner, type, argument.Id)
        {
            if (argument == null) throw new ArgumentNullException(nameof(argument));

            _argument = argument;

            argument.PropertyChanged += Argument_PropertyChanged;
        }
Ejemplo n.º 3
0
        public Parameter(IElementCreationContext context, string id, IVplType type) 
            : base(context)
        {
            if (type == null) throw new ArgumentNullException(nameof(type));
            _id = id;
            _type = type;

            Value = type.DefaultValue;

            _editor = new Lazy<Visual>(type.CreateVisual);
        }
Ejemplo n.º 4
0
        public ArgumentVariable(IElementOwner owner, IVplType type, IArgument argument)
            : base(owner, type, argument.Id)
        {
            if (argument == null)
            {
                throw new ArgumentNullException(nameof(argument));
            }

            _argument = argument;

            argument.PropertyChanged += Argument_PropertyChanged;
        }
Ejemplo n.º 5
0
        public Parameter(IElementCreationContext context, string id, IVplType type)
            : base(context)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }
            _id   = id;
            _type = type;

            Value = type.DefaultValue;

            _editor = new Lazy <Visual>(type.CreateVisual);
        }
Ejemplo n.º 6
0
        public Variable(IElementOwner owner, IVplType type, Guid id)
        {
            if (owner == null) throw new ArgumentNullException(nameof(owner));
            if (type == null) throw new ArgumentNullException(nameof(type));

            _owner = owner;
            _type = type;
            _id = id;

            RenameCommand = new RelayCommand(Rename, CanRename);
            DeleteCommand = new RelayCommand(() => Delete(), CanDelete);

            _editor = new Lazy<Visual>(type.CreateVisual);
            _value = type.DefaultValue;
        }
Ejemplo n.º 7
0
        private void TypeSelected(Guid?typeId)
        {
            if (typeId == null)
            {
                _vplType = Owner.GetAnyType();
            }
            else
            {
                _vplType = Owner.GetVplTypeOrAny(typeId.Value);
            }

            Parameters.Clear();

            SourceParameter        = Owner.CreateParameter("Source", _vplType);
            SourceParameter.Prefix = $"[{_vplType.Name}]";

            Parameters.Add(SourceParameter);
        }
Ejemplo n.º 8
0
        public Variable(IElementOwner owner, IVplType type, Guid id)
        {
            if (owner == null)
            {
                throw new ArgumentNullException(nameof(owner));
            }
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            _owner = owner;
            _type  = type;
            _id    = id;

            RenameCommand = new RelayCommand(Rename, CanRename);
            DeleteCommand = new RelayCommand(() => Delete(), CanDelete);

            _editor = new Lazy <Visual>(type.CreateVisual);
            _value  = type.DefaultValue;
        }
Ejemplo n.º 9
0
 protected Operator(IElementCreationContext context, IVplType type)
     : base(context)
 {
     if (type == null) throw new ArgumentNullException(nameof(type));
     _type = type;
 }
Ejemplo n.º 10
0
 public ReturnValueVariable(IElementOwner owner, IVplType type)
     : base(owner, type, ReturnVariableId)
 {
 }
 public ReturnValueVariable(IElementOwner owner, IVplType type)
     : base(owner, type, ReturnVariableId)
 {
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Creates a parameter.
        /// </summary>
        /// <param name="owner">Owner.</param>
        /// <param name="id">The id of the parameter.</param>
        /// <param name="type">The type of parameter.</param>
        /// <param name="prefix">Optional prefix</param>
        /// <param name="postfix">Optionl postfix</param>
        /// <returns></returns>
        public static IParameter CreateParameter(this IElementOwner owner, string id, IVplType type, string prefix = null, string postfix = null)
        {
            var context = CreateElementCreationContext(owner, SystemElementIds.Parameter);

            var parameter = new Parameter(context, id, type)
            {
                Prefix  = prefix,
                Postfix = postfix
            };

            return(parameter);
        }
Ejemplo n.º 13
0
        private void TypeSelected(Guid? typeId)
        {
            if (typeId == null)
            {
                _vplType = Owner.GetAnyType();
            }
            else
            {
                _vplType = Owner.GetVplTypeOrAny(typeId.Value);
            }

            Parameters.Clear();

            SourceParameter = Owner.CreateParameter("Source", _vplType);
            SourceParameter.Prefix = $"[{_vplType.Name}]";

            Parameters.Add(SourceParameter);
        }