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); }
public override bool Equals(object obj) { RelativePosition position = obj as RelativePosition; if (position != (RelativePosition)null) { return(this.Equals(position)); } return(false); }
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()); }
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); }
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); }
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); }
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; }
public RelativeValue(RelativePosition reference, double value) { this._reference = reference; this._value = value; }
public abstract bool CanSetPosition(PlacementIntent intent, RelativePosition position);
public RelativePoint(RelativePosition position, Point point) { this._position = position; this._x = point.X; this._y = point.Y; }
public RelativePoint(RelativePosition position, double x, double y) { this._position = position; this._x = x; this._y = y; }