Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IPersoIntAttributeImpl"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="owner">The owner.</param>
        /// <param name="constraint">The constraint.</param>
        /// <param name="persoAttributeType">Type of the perso attribute.</param>
        /// <history>
        /// 09-02-2011  Michel Roovers          Added
        /// </history>
        public IPersoBoolAttributeImpl(string caption, string name, string owner,
                                       Constraint <bool> constraint,
                                       PersoAttributeTarget persoAttributeType             = PersoAttributeTarget.PersoCommand,
                                       PersoAttributeRequirement persoAttributeRequirement = PersoAttributeRequirement.User | PersoAttributeRequirement.Optional,
                                       bool defaultValue = false, string group = "")
            : base(caption, name, owner, persoAttributeType, persoAttributeRequirement)
        {
            _Domain.Constraint = constraint;

            if (constraint != null)
            {
                switch (constraint.ConstraintType)
                {
                case ConstraintTest.InRange:
                    _DomainType = PersoAttributeDomainType.Numerical | PersoAttributeDomainType.Enumeration;
                    break;

                case ConstraintTest.MinMax:
                    _DomainType = PersoAttributeDomainType.Numerical | PersoAttributeDomainType.Ordinal;
                    break;

                default:
                    _DomainType = PersoAttributeDomainType.Numerical;
                    break;
                } //switch(constraint.ConstraintType)
            }
            else
            {
                _DomainType = PersoAttributeDomainType.Numerical;
            }

            Value  = defaultValue.ToString();
            _Group = group;
        } //public IPersoIntAttributeImpl(
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IPersoStringAttributeImpl"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="owner">The owner.</param>
        /// <param name="constraint">The constraint.</param>
        /// <param name="persoAttributeType">Type of the perso attribute.</param>
        /// <history>
        /// 09-02-2011  Michel Roovers          Added
        /// </history>
        public IPersoUriFileOrPathAttributeImpl(string caption, string name, string owner,
                                                Constraint <string> constraint,
                                                PersoAttributeTarget persoAttributeType             = PersoAttributeTarget.PersoCommand,
                                                PersoAttributeRequirement persoAttributeRequirement = PersoAttributeRequirement.User | PersoAttributeRequirement.Optional,
                                                PersoAttributeDomainType persoAttributeDomainType   = PersoAttributeDomainType.URI,
                                                string defaultValue = "", string group = "")
            : base(caption, name, owner, constraint, persoAttributeType, persoAttributeRequirement)
        {
            _DomainType = persoAttributeDomainType;

            Value  = defaultValue;
            _Group = group;
        } //public IPersoStringAttributeImpl(
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IPersoStringAttributeImpl"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="owner">The owner.</param>
        /// <param name="constraint">The constraint.</param>
        /// <param name="persoAttributeType">Type of the perso attribute.</param>
        /// <history>
        /// 09-02-2011  Michel Roovers          Added
        /// </history>
        public IPersoStringAttributeImpl(string caption, string name, string owner,
                                         Constraint <string> constraint,
                                         PersoAttributeTarget persoAttributeType             = PersoAttributeTarget.PersoCommand,
                                         PersoAttributeRequirement persoAttributeRequirement = PersoAttributeRequirement.User | PersoAttributeRequirement.Optional,
                                         string defaultValue = "", string group = "")
            : base(caption, name, owner, persoAttributeType, persoAttributeRequirement)
        {
            _Domain.Constraint = constraint;

            if (constraint != null)
            {
                switch (constraint.ConstraintType)
                {
                case ConstraintTest.InRange:
                    _DomainType = PersoAttributeDomainType.AlfaNumerical | PersoAttributeDomainType.Enumeration;
                    break;

                case ConstraintTest.MinMax:
                    _DomainType = PersoAttributeDomainType.AlfaNumerical | PersoAttributeDomainType.Ordinal;
                    break;

                case ConstraintTest.ValidPath:
                case ConstraintTest.ValidPathFileName:
                    _DomainType = PersoAttributeDomainType.AlfaNumerical | PersoAttributeDomainType.URI;
                    break;

                default:
                    _DomainType = PersoAttributeDomainType.AlfaNumerical;
                    break;
                } //switch(constraint.ConstraintType)
            }
            else
            {
                _DomainType = PersoAttributeDomainType.AlfaNumerical;
            }

            Value  = defaultValue;
            _Group = group;
        } //public IPersoStringAttributeImpl(