Class VersioningVersion
Implementation of file versions for a VersioningFile instance.
Inherited Members
Namespace: EPiServer.Web.Hosting
Assembly: EPiServer.dll
Version: 8.11.0Syntax
public class VersioningVersion : UnifiedVersion
Constructors
VersioningVersion(VersioningFile, String, VersioningFileVersionHandler, Boolean)
Initializes a new instance of the VersioningVersion class.
Declaration
public VersioningVersion(VersioningFile versionedFile, string virtualPath, VersioningFileVersionHandler versioningFileVersionHandler, bool bypassAccessCheck)
Parameters
Type | Name | Description |
---|---|---|
VersioningFile | versionedFile | The versioned file. |
System.String | virtualPath | The virtual path for the file. |
VersioningFileVersionHandler | versioningFileVersionHandler | An instance of a version handler. |
System.Boolean | bypassAccessCheck | if set to |
Properties
Changed
Gets the changed date.
Declaration
public override DateTime Changed { get; }
Property Value
Type | Description |
---|---|
System.DateTime | The changed. |
Overrides
Remarks
Will be same as created since changing a versioned is acieved by creating a new version
Comments
Gets the comment for this version.
Declaration
public override string Comments { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Created
Gets the date and time when this file version was created.
Declaration
public override DateTime Created { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
Overrides
CreatedBy
Gets the name of the creator
Declaration
public override string CreatedBy { get; }
Property Value
Type | Description |
---|---|
System.String | The user name of the creator of this file version. |
Overrides
Extension
Gets the UnifiedFiles extension, for example '.doc'.
Declaration
public override string Extension { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Id
Gets the unique id for this file version.
Declaration
public override object Id { get; }
Property Value
Type | Description |
---|---|
System.Object |
Overrides
IsDirectory
Gets a value indicating if this instance is a directory. Returns false.
Declaration
public override bool IsDirectory { get; }
Property Value
Type | Description |
---|---|
System.Boolean | Always false. |
Length
Gets the size in bytes of this file version.
Declaration
public override long Length { get; }
Property Value
Type | Description |
---|---|
System.Int64 | The length of the file in bytes. |
Overrides
Name
Gets the display name of the file version. May be auto-generated by the provider.
Declaration
public override string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Parent
Parent UnifiedDirectory of the current version.
Declaration
public override UnifiedDirectory Parent { get; }
Property Value
Type | Description |
---|---|
UnifiedDirectory |
Overrides
Remarks
When Parent property is overriden: if PageForAclCheck is set, SetPageForAccessControl on parent should be called with PageForAclCheck as parameter before parent is returned.
PermanentLinkVirtualPath
Gets the permanent virtual path. This path is kept during imports and exports of the file version.
Declaration
public override string PermanentLinkVirtualPath { get; }
Property Value
Type | Description |
---|---|
System.String | The permanent virtual path. |
Overrides
Methods
Delete()
Deletes this file version from the underlying store.
Declaration
public override void Delete()
Overrides
Open()
Opens a stream the the version.
Declaration
public override Stream Open()
Returns
Type | Description |
---|---|
System.IO.Stream | The opened read-only stream. |
Overrides
Open(FileMode, FileAccess, FileShare)
Opens the file for writing given an mode with an specific share option to open the file in .
Declaration
public override Stream Open(FileMode mode, FileAccess access, FileShare share)
Parameters
Type | Name | Description |
---|---|---|
System.IO.FileMode | mode | The file mode to use when open the file. |
System.IO.FileAccess | access | A FileAccess constant specifying whether to open the file with Read, Write, or ReadWrite file access. |
System.IO.FileShare | share | A FileShare value specifying the type of access other threads have to the file. |
Returns
Type | Description |
---|---|
System.IO.Stream | A open stream to the file. |
Overrides
Exceptions
Type | Condition |
---|---|
EPiServerException | If a file is open for writing (versions is read-only) |
Restore()
Restores this file version as the currently active version.
Declaration
public override void Restore()