Provides access to members for managing a version.
Description
The IVersioninterface is used to manage the properties of a version, such as the name, description, access and the ability to create new versions.
Members
Name | Description | |
---|---|---|
Access | The version's access permission. | |
AlterVersion | ||
CreateChild | Creates a new child version of this version whose initial state is the current state of pInitialStateVersion. | |
CreateVersion | Creates a new version equivalent to this version. | |
CreateVersionEx | ||
Delete | Permanently deletes the version from the database. | |
DeleteWithChildren | Permanently deletes the version and all it's children from the database. | |
Description | The version's description. | |
GetCommonAncestor | Finds common ancestor version. | |
HasParent | True if this version have a parent version. | |
IsRedefined | Determines whether the state of the version corresponding to this version object has been redefined in the database. | |
Owner | ||
RefreshVersion | Refreshes the version with the corresponding database state. | |
VersionInfo | This version's information. | |
VersionLocks | This version's locks. | |
VersionName | The name of the version. |
IVersion.Access Property
The version's access permission.
Public Property Access As esriVersionAccess
public esriVersionAccess Access {get; set;}
Errors Returned
FDO_E_SE_NO_PERMISSIONS: Insufficient permissions.
Functional License Check
If your application/site is not appropriately licensed, Access can return an error of FDO_E_NO_OPERATION_LICENSE.
Remarks
The Accessproperty is used to retrieve or set a version's access property. Version access can be private, public or protected. Private versions are only accessible by the version's owner, public versions can be viewed and edited by any user, and protected versions can be viewed by any user but only edited by the owner. Only the owner of a version can change its properties, such as the access.
IVersion.AlterVersion Method
IVersion.CreateChild Method
Creates a new child version of this version whose initial state is the current state of pInitialStateVersion.
Public Function CreateChild ( _
ByVal Name As String, _
ByVal initialStateVersion As IVersion _
) As IVersion
public IVersion CreateChild (
string Name,
IVersion initialStateVersion
);
IVersion.CreateVersion Method
Creates a new version equivalent to this version.
Public Function CreateVersion ( _
ByVal newName As String _
) As IVersion
public IVersion CreateVersion (
string newName
);
Errors Returned
FDO_E_SE_VERSION_EXISTS: Version already exists.
FDO_E_SE_INVALID_PARAM_VALUE: Invalid parameter value passed to function.
Functional License Check
If your application/site is not appropriately licensed, CreateVersion can return an error of FDO_E_NO_OPERATION_LICENSE.
Remarks
The CreateVersion method allows you to create new version from the existing IVersion. The new version is a child of the current version and is owned by the connected user. The version name is limited to 64 characters and is private by default.
Creating a new version requires an existing version to be the parent of the new version. When the new version is created, the parent and child versions are identical.
IVersion.CreateVersionEx Method
IVersion.Delete Method
Permanently deletes the version from the database.
Public Sub Delete ( _
)
public void Delete (
);
Description
Deletes the transactional version. Must be the version owner to delete a version.
Errors Returned
FDO_E_SE_NO_PERMISSIONS: Insufficient permissions.
FDO_E_VERSION_HAS_CHILDREN: Unable to delete versions with dependant children.
FDO_E_VERSION_NOT_OWNER: Not owner of version.
FDO_E_NO_OPERATION_LICENSE: Not licensed to make this change.
FDO_E_OBJECT_IS_DELETED: Version does not exist.
FDO_E_NOT_ALLOWED_WHILE_EDITING: Version is locked.
FDO_E_VERSION_IN_USE: Version is locked.
FDO_E_VERSION_HAS_CHILDREN (unless cascading requested).
Functional License Check
If your application/site is not appropriately licensed, Delete can return an error of FDO_E_NO_OPERATION_LICENSE.
Remarks
The Deletemethod is used to permanently delete a version. Only the owner of the version or the ArcSDE administrator can delete the version.
IVersion.DeleteWithChildren Method
Permanently deletes the version and all it's children from the database.
Public Sub DeleteWithChildren ( _
)
public void DeleteWithChildren (
);
IVersion.Description Property
The version's description.
Public Property Description As String
public string Description {get; set;}
Errors Returned
FDO_E_SE_NO_PERMISSIONS: Insufficient permissions.
FDO_E_SE_INVALID_PARAM_VALUE: Invalid parameter value passed to function.
Remarks
The Descriptionmethod is used to retreive or set a version's description. Version descriptions are not required and are limited to 64 characters. Only the owner of a version can change its properties, such as the description.
IVersion.GetCommonAncestor Method
Finds common ancestor version.
Public Function GetCommonAncestor ( _
ByVal otherVersion As IVersion _
) As IVersion
public IVersion GetCommonAncestor (
IVersion otherVersion
);
IVersion.HasParent Method
True if this version have a parent version.
Public Function HasParent ( _
) As Boolean
public bool HasParent (
);
Remarks
All versions, except the default version have parent versions.
IVersion.IsRedefined Property
Determines whether the state of the version corresponding to this version object has been redefined in the database.
Public ReadOnly Property IsRedefined As Boolean
public bool IsRedefined {get;}
IVersion.Owner Property
.
Public Property Owner As String
public string Owner {get; set;}
IVersion.RefreshVersion Method
Refreshes the version with the corresponding database state.
Public Sub RefreshVersion ( _
)
public void RefreshVersion (
);
Remarks
The RefreshVersion method refreshes the version to correspond with the database state the version references. For example, if a second application is editing the verison and saves their changes, you need to call the RefreshVersionmethod to see the latest representation of the version.
IVersion.VersionInfo Property
This version's information.
Public ReadOnly Property VersionInfo As IVersionInfo
public IVersionInfo VersionInfo {get;}
Remarks
The VersionInfo method provides a reference to the IVersionInfointerface. The IVersionInfointerface contains methods which describe the properties of the version. The interface is beneficial for obtaining a version's ancestory, for example its parent version.
VersionInfowill only return versions in which the connected user has the appropriate privileges.
IVersion.VersionLocks Property
This version's locks.
Public ReadOnly Property VersionLocks As IEnumLockInfo
public IEnumLockInfo VersionLocks {get;}
Remarks
The VersionLocksmethod returns the enumeration IEnumLockInfo. Using the enumeration you can detect what users are currently editing the version or currently reconciling the version. This information can be used to determine if the version is available for editing, to be reconciled or to be reconciled against.
See ILockInfoand esriLockTypeconstants for additional information regarding locking descriptions.
IVersion.VersionName Property
The name of the version.
Public Property VersionName As String
public string VersionName {get; set;}
Errors Returned
FDO_E_SE_NO_PERMISSIONS: Insufficient permissions.
FDO_E_SE_INVALID_PARAM_VALUE: Invalid parameter value passed to function.
FDO_E_SE_VERSION_EXISTS: Version already exists.
Remarks
The VersionName method is used to retrieve or set a version's name. Version names are case sensitive and limited to 64 characters. Only the owner of a version can change its properties, such as the name.
The DEFAULT version cannot be renamed.
Classes that implement IVersion
Classes | Description |
---|
// Get dataset from the map service
IDataset defaultDataset = mapServerDataAccess.GetDataSource(mapService.DefaultMapName, 0 ) as IDataset;
IWorkspace workspace = defaultDataset.Workspace;
IVersionedWorkspace versionedWorkspace = (IVersionedWorkspace)workspace;
// Default Version
IVersion defaultVersion = versionedWorkspace.DefaultVersion;
string defaultVersionName = defaultVersion.VersionName;