/// <summary> /// Overriden Equals /// </summary> /// <param name="obj">Compared obje</param> /// <returns>True if equal</returns> public override bool Equals(object obj) { if (!(obj is ArrayReturnType)) { return(false); } ArrayReturnType at = obj as ArrayReturnType; if (!at.elementType.Equals(elementType)) { return(false); } if (at.dimension.Length != dimension.Length) { return(false); } for (int i = 0; i < dimension.Length; i++) { if (dimension[i] != at.dimension[i]) { return(false); } } return(true); }
/// <summary> /// Gets base type /// </summary> /// <param name="o">The object</param> /// <returns>Object's base type</returns> static public object GetBaseType(object o) { if (o is ArrayReturnType) { ArrayReturnType rt = o as ArrayReturnType; return(rt.elementType); } return(o); }
/// <summary> /// Checks equality of imension /// </summary> /// <param name="type">Type</param> /// <returns>True in case of equal dimesion and false otherwise</returns> public bool HasEqualDimension(ArrayReturnType type) { if (type.dimension.Length != dimension.Length) { return(false); } for (int i = 0; i < dimension.Length; i++) { if (dimension[i] != type.dimension[i]) { return(false); } } return(true); }