online source control
back to content
sign up free version control plan

ISAWHAppObject::GetFileHistory

Description

Retrieves the history information of a file.

Syntax

long GetFileHistory(
        BSTR FileName,
        ISAWHFileHistoryParam* FileHistoryParam,
        VARIANT_BOOL* IsPinned,
        ISAWHHistorySet* HistorySet,
        VARIANT_BOOL* Cancelled,
        BSTR* ResultDescription
);

Parameters

FileName
[in] Specifies the full name of the file.

FileHistoryparam
[in] Specifies the parameters to restrict the file history report.

IsPinned
[out] Returns whether the file is pinned.

HistorySet
[out] Returns the history information set of the file.

Cancelled
[out] If the method fails, returns whether the operation is cancelled.

ResultDescription
[out] Returns the description of the result. If the operation succeeds, returns 'Completed'. If the operation fails, returns the error information.

Return Value

If the method succeeds, returns 0. If the method fails, returns other error codes.

See Also

Sample

VB Sample:

Dim WithEvents sdkObject As SAWHSDKLib.SAWHAppObject

Set sdkObject = New SAWHSDKLib.SAWHAppObject

Private Sub GetFileHistory_Click()

	Dim Cancelled As Boolean
	Dim ResultDescription As String

	Dim FileName As String
	Dim FileHistoryParam As New SAWHFileHistoryParam
	Dim IsPinned As Boolean
	Dim HistorySet As New SAWHHistorySet

	FileName = "$/FileName.txt"

	Dim ResultValue As Long
	ResultValue = sdkObject.GetFileHistory(FileName, FileHistoryParam, IsPinned, HistorySet, Cancelled, ResultDescription)

	If ResultValue <> 0 Then
		MsgBox "Failed to get the file history."
	End If

	Dim Count As Long
	Count = HistorySet.GetCount
	Dim Index As Long
	For Index = 0 To Count - 1
		Dim History As New SAWHHistory
		HistorySet.Get Index, History

		Dim ActionDateTime As Date
		ActionDataTime = History.ActionDateTime

		Dim ActionDescription As String
		ActionDescription = History.ActionDescription

		Dim ActionType As Enum_ActionType
		ActionType = History.ActionType

		Dim CheckinDateTime As Date
		CheckinDateTime = History.CheckinDateTime

		Dim Comment As String
		Comment = History.Comment

		Dim ChangeSetIdLow As Long
		ChangeSetIdLow = History.ChangeSetIdHigh

		Dim ChangeSetIdHigh As Long
		ChangeSetIdHigh = History.ChangeSetIdHigh

		Dim FileSizeLow As Long
		FileSizeLow = History.FileSizeLow

		Dim FileSizeHigh As Long
		FileSizeHigh = History.FileSizeHigh

		Dim HistoryIdLow As Long
		HistoryIdLow = History.HistoryIdLow

		Dim HistoryIdHigh As Long
		HistoryIdHigh = History.HistoryIdHigh

		Dim IsMergeable As Boolean
		IsMergeable = History.IsMergable

		IsPinned = History.IsPinned

		Dim IsProject As Boolean
		IsProject = History.IsProject

		Dim ItemIdLow As Long
		ItemIdLow = History.ItemIdLow

		Dim ItemIdHigh As Long
		ItemIdHigh = History.ItemIdHigh

		Dim ItemName As String
		ItemName = History.ItemName

		Dim LabelName As String
		LabelName = History.LabelName

		Dim ModificationDateTime As Date
		ModificationDateTime = History.ModificationDateTime

		Dim UserName As String
		UserName = History.UserName

		Dim VersionNumberLow As Long
		VersionNumberLow = History.VersionNumberLow

		Dim VersionNumberHigh As Long
		VersionNumberHigh = History.VersionNumberHigh

	Next

End Sub