15 public struct Address : IEquatable<Address>, IComparable<Address>
17 private readonly
int column;
18 private readonly
int row;
28 public int Row {
get => row; }
40 public Address(
int column,
int row) : this(column, row,
Cell.AddressType.Default)
153 return address1.
Equals(address2);
166 return !address1.
Equals(address2);
178 return thisCoordinate.CompareTo(otherCoordinate);
231 return new Address(this.Column, this.Row, this.Type);
Class representing a cell of a worksheet.
static Address ResolveCellCoordinate(string address)
Gets the column and row number (zero based) of a cell by the address.
static void ValidateRowNumber(int row)
Validates the passed (zero-based) row number. An exception will be thrown if the row is invalid.
static string ResolveCellAddress(int column, int row, AddressType type=AddressType.Default)
Gets the address of a cell by the column and row number (zero based).
AddressType
Enum for the referencing style of the address.
static void ValidateColumnNumber(int column)
Validates the passed (zero-based) column number. An exception will be thrown if the column is invalid...
static string ResolveColumnAddress(int columnNumber)
Gets the column address (A - XFD).
static readonly int MaxRowNumber
Maximum row number (zero-based) as constant.
Struct representing the cell address as column and row (zero based).
int CompareTo(Address other)
Compares two addresses using the column and row numbers.
static bool operator<(Address left, Address right)
Determines whether one specified Address is less/smaller than another specified Address.
Address(string address, Cell.AddressType type)
Constructor with address as string. All referencing modifiers ($) are ignored and only the defined re...
Address(string address)
Constructor with address as string. If no referencing modifiers ($) are defined, the address is of re...
static bool operator!=(Address address1, Address address2)
Determines whether two Address instances are not equal.
override bool Equals(object obj)
Compares two objects whether they are addresses and equal.
int Row
Row number (zero based).
static bool operator==(Address address1, Address address2)
Determines whether two Address instances are equal.
override int GetHashCode()
Gets the hash code based on the string representation of the address.
override string ToString()
Overwritten ToString method.
static bool operator>=(Address left, Address right)
Determines whether one specified Address is greater/larger or equal than another specified Address.
Address(int column, int row)
Constructor with row and column as arguments. The referencing type of the address is default (e....
Address(int column, int row, Cell.AddressType type)
Constructor with row and column as arguments. All referencing modifiers ($) are ignored and only the ...
static bool operator<=(Address left, Address right)
Determines whether one specified Address is less/smaller or equal than another specified Address.
string GetColumn()
Gets the column address (A - XFD).
Cell.AddressType Type
Referencing type of the address.
string GetAddress()
Returns the combined Address.
bool Equals(Address other)
Compares two addresses whether they are equal.
static bool operator>(Address left, Address right)
Determines whether one specified Address is greater/larger than another specified Address.
int Column
Column number (zero based).