Generated by DocFX

Class HistoryItem

Representation of an item of shell history

Inheritance
System.Object
HistoryItem
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Dotnet.Shell.API
Assembly: dotnet-shell-lib.dll
Syntax
public class HistoryItem

Constructors

| Improve this Doc View Source

HistoryItem(String, DateTime)

Initializes a new instance of the HistoryItem class.

Declaration
public HistoryItem(string command, DateTime time)
Parameters
Type Name Description
System.String command

The command.

System.DateTime time

The time.

| Improve this Doc View Source

HistoryItem(String, DateTime, Int32)

Initializes a new instance of the HistoryItem class.

Declaration
[JsonConstructor]
public HistoryItem(string cmdLine, DateTime timeRun, int legacyOffset)
Parameters
Type Name Description
System.String cmdLine

The command line.

System.DateTime timeRun

The time run.

System.Int32 legacyOffset

The legacy offset.

| Improve this Doc View Source

HistoryItem(String, Int32)

Initializes a new instance of the HistoryItem class.

Declaration
public HistoryItem(string command, int offset)
Parameters
Type Name Description
System.String command

The command.

System.Int32 offset

The offset.

Properties

| Improve this Doc View Source

CmdLine

Gets or sets the command line.

Declaration
public string CmdLine { get; set; }
Property Value
Type Description
System.String

The command line.

| Improve this Doc View Source

LegacyOffset

Gets or sets the legacy offset. In a file like .bash_history this is the line number

Declaration
public int LegacyOffset { get; set; }
Property Value
Type Description
System.Int32

The legacy offset.

| Improve this Doc View Source

TimeRun

Gets or sets the time run.

Declaration
public DateTime TimeRun { get; set; }
Property Value
Type Description
System.DateTime

The time run.

Methods

| Improve this Doc View Source

Serialize()

Serializes this instance to JSON

Declaration
public string Serialize()
Returns
Type Description
System.String
| Improve this Doc View Source

ToString()

Converts the history item into a command line

Declaration
public override string ToString()
Returns
Type Description
System.String

A System.String that represents this instance.

Overrides
System.Object.ToString()