123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- #pragma warning disable
- namespace Svg.Transforms
- {
- public abstract class SvgTransform : ICloneable
- {
- public abstract Matrix Matrix { get; }
- public abstract string WriteToString();
- public abstract object Clone();
- #region Equals implementation
- public override bool Equals(object obj)
- {
- SvgTransform other = obj as SvgTransform;
- if (other == null)
- return false;
- var thisMatrix = this.Matrix.Elements;
- var otherMatrix = other.Matrix.Elements;
- for (int i = 0; i < 6; i++)
- {
- if (thisMatrix[i] != otherMatrix[i])
- return false;
- }
- return true;
- }
- public override int GetHashCode()
- {
- int hashCode = this.Matrix.GetHashCode();
- return hashCode;
- }
- public static bool operator ==(SvgTransform lhs, SvgTransform rhs)
- {
- if (ReferenceEquals(lhs, rhs))
- return true;
- if (ReferenceEquals(lhs, null) || ReferenceEquals(rhs, null))
- return false;
- return lhs.Equals(rhs);
- }
- public static bool operator !=(SvgTransform lhs, SvgTransform rhs)
- {
- return !(lhs == rhs);
- }
- #endregion
- public override string ToString()
- {
- return WriteToString();
- }
- }
- }
- #pragma warning restore
|