Ejemplo n.º 1
0
 protected PropertyAssertion(
     IOntology ontology,
     IPropertyExpression propertyExpression,
     INamedIndividual sourceIndividual
     ) : base(ontology)
 {
     _propertyExpression = propertyExpression;
     _sourceIndividual   = sourceIndividual;
 }
Ejemplo n.º 2
0
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }
            IPropertyExpression p = (IPropertyExpression)obj;

            return(GetHashCode().CompareTo(obj.GetHashCode()));
        }
Ejemplo n.º 3
0
        public void Add(params object[] propertys)
        {
            if (propertys == null)
            {
                return;
            }
            foreach (object obj in propertys)
            {
                if (obj == null)
                {
                    continue;
                }

                if (obj is string)
                {
                    Add(new OutputExpression(obj as string));
                }
                else if (obj is IPropertyExpression)
                {
                    IPropertyExpression propertyExpression = (IPropertyExpression)obj;
                    Add(new OutputExpression(propertyExpression.PropertyName, propertyExpression.GroupFunction));
                }
                else if (obj is IOutputExpression)
                {
                    IOutputExpression outputExpression = (IOutputExpression)obj;
                    Add(outputExpression);
                }
                else if (obj is IEnumerable <string> )
                {
                    foreach (string s in obj as IEnumerable <string> )
                    {
                        Add(new OutputExpression(s));
                    }
                }
                else if (obj is IEnumerable <IOutputExpression> )
                {
                    foreach (IOutputExpression s in obj as IEnumerable <IOutputExpression> )
                    {
                        Add(s);
                    }
                }
                else if (obj is IEnumerable <IPropertyExpression> )
                {
                    foreach (IPropertyExpression s in obj as IEnumerable <IPropertyExpression> )
                    {
                        Add(new OutputExpression(s.PropertyName, s.GroupFunction));
                    }
                }
                else
                {
                    throw new Exception("不支持的类型");
                }
            }
        }
Ejemplo n.º 4
0
 public override void LoadDataChangedEvent(IPropertyExpression expression)
 {
     if (expression.Index.ClassType == (int)DrawType.Vector)
     {
         DrawVectorDataChanged(expression);
     }
     else
     {
         base.LoadDataChangedEvent(expression);
     }
 }
Ejemplo n.º 5
0
 public virtual void LoadDataChangedEvent(IPropertyExpression expression)
 {
     if (expression.Index.ClassType == (int)DrawType.Obj)
     {
         DrawObjDataChanged(expression);
     }
     else
     {
         OnDataChanged(expression);
     }
 }
Ejemplo n.º 6
0
        private void DrawVectorDataChanged(IPropertyExpression expression)
        {
            switch (expression.Index.Index)
            {
            case 0:                         //angle
                RotateAngle = (float)expression.DecimalValue;
                break;

            default:
                break;
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Specifies that the collection is to be checked for duplicates using the specified item property.
        /// </summary>
        /// <typeparam name="TItemProperty">The item property <see cref="Type"/>.</typeparam>
        /// <param name="propertyExpression">The <see cref="Expression"/> to reference the item property that is being duplicate checked.</param>
        /// <param name="duplicateText">The duplicate text <see cref="LText"/> to be passed for the error message (default is to derive the text from the property itself where possible).</param>
        /// <returns>The <see cref="CollectionRuleItem{TItemEntity}"/> instance to support chaining/fluent.</returns>
        public CollectionRuleItem <TItemEntity> DuplicateCheck <TItemProperty>(Expression <Func <TItemEntity, TItemProperty> > propertyExpression, LText duplicateText = null)
        {
            if (_duplicateCheck)
            {
                throw new InvalidOperationException("A DuplicateCheck or UniqueKeyDuplicateCheck can only be specified once.");
            }

            _propertyExpression = PropertyExpression.Create(Check.NotNull(propertyExpression, nameof(propertyExpression)), true);
            _duplicateText      = duplicateText ?? _propertyExpression.Text;
            _duplicateCheck     = true;

            return(this);
        }
Ejemplo n.º 8
0
        protected override void OnDataChanged(IPropertyExpression expression)
        {
            if (expression.Index.ClassType == (int)Type)
            {
                switch (expression.Index.Index)
                {
                case 0:         //text
                    Text = expression.DecimalValue.ToString();
                    break;

                default:
                    break;
                }
            }
        }
Ejemplo n.º 9
0
        private void DrawObjDataChanged(IPropertyExpression expression)
        {
            switch (expression.Index.Index)
            {
            case 0:             //x
            {
                RectangleF r = Rect;
                r.X  = (float)expression.DecimalValue;
                Rect = r;
            }
            break;

            case 1:             //y
            {
                RectangleF r = Rect;
                r.Y  = (float)expression.DecimalValue;
                Rect = r;
            }
            break;

            case 2:             //width
            {
                RectangleF r = Rect;
                r.Width = (float)expression.DecimalValue;
                Rect    = r;
            }
            break;

            case 3:             //height
            {
                RectangleF r = Rect;
                r.Height = (float)expression.DecimalValue;
                Rect     = r;
            }
            break;

            default:
                break;
            }
        }
 protected PropertyRestriction(
     IPropertyExpression propertyExpression
     )
 {
     _propertyExpression = propertyExpression;
 }
Ejemplo n.º 11
0
 public PropertyAccessor(IBindingPathExpression source, IPropertyExpression property)
 {
     this.Source   = source;
     this.Property = property;
 }
Ejemplo n.º 12
0
 protected virtual void OnDataChanged(IPropertyExpression expression)
 {
 }