예제 #1
0
        public bool Equals(RelativePosition position)
        {
            if (object.ReferenceEquals((object)position, (object)null))
            {
                return(false);
            }
            if (object.ReferenceEquals((object)position, (object)this))
            {
                return(true);
            }
            if (this._values.Length == 0 || position._values.Length != this._values.Length)
            {
                return(false);
            }
            int num = 0;

            for (int index1 = 0; index1 < this._values.Length; ++index1)
            {
                for (int index2 = 0; index2 < position._values.Length; ++index2)
                {
                    if (object.ReferenceEquals((object)this._values[index1], (object)position._values[index2]))
                    {
                        ++num;
                        break;
                    }
                }
            }
            return(num == this._values.Length);
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            RelativePosition position = obj as RelativePosition;

            if (position != (RelativePosition)null)
            {
                return(this.Equals(position));
            }
            return(false);
        }
예제 #3
0
 public RelativeValue Find(RelativePosition position)
 {
     if (position == (RelativePosition)null)
     {
         throw new ArgumentNullException("position");
     }
     foreach (RelativeValue relativeValue in (Collection <RelativeValue>) this)
     {
         if (relativeValue.Position == position)
         {
             return(relativeValue);
         }
     }
     return(new RelativeValue());
 }
예제 #4
0
 private static int FillValues(RelativePosition[] array, RelativePosition[] values, int startingIndex)
 {
     foreach (RelativePosition relativePosition in values)
     {
         if (relativePosition._values.Length > 0)
         {
             startingIndex = RelativePosition.FillValues(array, relativePosition._values, startingIndex);
         }
         else
         {
             array[startingIndex++] = relativePosition;
         }
     }
     return(startingIndex);
 }
예제 #5
0
        private static int CountValues(RelativePosition[] values)
        {
            int num = 0;

            foreach (RelativePosition relativePosition in values)
            {
                if (relativePosition._values.Length > 0)
                {
                    num += RelativePosition.CountValues(relativePosition._values);
                }
                else
                {
                    ++num;
                }
            }
            return(num);
        }
예제 #6
0
 public bool Contains(RelativePosition value)
 {
     if (value == (RelativePosition)null)
     {
         throw new ArgumentNullException("value");
     }
     if (object.ReferenceEquals((object)value, (object)this))
     {
         return(true);
     }
     foreach (RelativePosition relativePosition in this._values)
     {
         if (object.ReferenceEquals((object)value, (object)relativePosition))
         {
             return(true);
         }
     }
     return(false);
 }
예제 #7
0
 public RelativePosition(string name, params RelativePosition[] values)
 {
     if (values == null)
     {
         throw new ArgumentNullException("values");
     }
     if (values.Length > 0)
     {
         this._values = new RelativePosition[RelativePosition.CountValues(values)];
         RelativePosition.FillValues(this._values, values, 0);
     }
     else
     {
         this._values = values;
     }
     if (name == null || name.Length == 0)
     {
         name = this._values.Length <= 0 ? string.Empty : string.Concat((object[])this._values);
     }
     this._name = name;
 }
예제 #8
0
 public RelativeValue(RelativePosition reference, double value)
 {
     this._reference = reference;
     this._value     = value;
 }
예제 #9
0
 public abstract bool CanSetPosition(PlacementIntent intent, RelativePosition position);
예제 #10
0
 public RelativePoint(RelativePosition position, Point point)
 {
     this._position = position;
     this._x        = point.X;
     this._y        = point.Y;
 }
예제 #11
0
 public RelativePoint(RelativePosition position, double x, double y)
 {
     this._position = position;
     this._x        = x;
     this._y        = y;
 }