Table of Contents

Class FileLineIndex

Namespace
Hi.Common.FileLines
Assembly
HiGeom.dll

Represents a location in a file by its file index and line number.

public class FileLineIndex : IFileLineIndex, IGetFileLineIndex, IComparable<IFileLineIndex>, IMakeXmlSource
Inheritance
FileLineIndex
Implements
Inherited Members
Extension Methods

Constructors

FileLineIndex()

Initializes a new instance of the FileLineIndex class.

public FileLineIndex()

FileLineIndex(IFileLineIndex)

Initializes a new instance of the FileLineIndex class by copying another instance.

public FileLineIndex(IFileLineIndex src)

Parameters

src IFileLineIndex

The source FileLineIndex to copy from

FileLineIndex(int, int)

Initializes a new instance of the FileLineIndex class with specified indices.

public FileLineIndex(int fileIndex, int lineIndex)

Parameters

fileIndex int

The zero-based file index

lineIndex int

The zero-based line index

FileLineIndex(XElement)

Initializes a new instance of the FileLineIndex class from an XML element.

public FileLineIndex(XElement src)

Parameters

src XElement

The XML element containing the file and line indices

Properties

FileIndex

File Index. Start on 0.

public int FileIndex { get; set; }

Property Value

int

FileNo

Gets or sets the one-based file number (FileIndex + 1)

public int FileNo { get; set; }

Property Value

int

LineIndex

Line Index. Start on 0.

public int LineIndex { get; set; }

Property Value

int

LineNo

Gets or sets the one-based line number (LineIndex + 1)

public int LineNo { get; set; }

Property Value

int

XName

Gets the XML element name used for serialization.

public static string XName { get; }

Property Value

string

Methods

CompareTo(IFileLineIndex)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(IFileLineIndex other)

Parameters

other IFileLineIndex

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetFileLineIndex()

public FileLineIndex GetFileLineIndex()

Returns

FileLineIndex

FileLineIndex

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

MakeXmlSource(string, string)

Creates an XML representation of the object. This method may also generate additional resources such as related files.

public XElement MakeXmlSource(string baseDirectory, string relFile)

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

Returns

XElement

An XML element representing the object's state

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

ToUserString()

Returns a user-friendly string representation of the file and line numbers.

public string ToUserString()

Returns

string

A string in the format “(FileNo:X,LineNo:Y)”