Reprinted-> Use of arcengine versions

Source: Internet
Author: User
In arcengine, [add this page to favorites] [print]

[It168 Knowledge Base]
 

The procedure of using a version is as follows:
1. Register a workspace or dataset as a workspace or dataset of the available version.
Iversionedobject verobj = ds as iversionedobject; // assume that DS is a dataset.
If (verobj! = NULL &&(! Verobj. pverdobj. isregisteredasversioned ))
{
// The dataset can be registered and has not been registered as a version dataset.
// If the following method uses the false parameter, it indicates that the data is registered as non-version data.
// That is, anti-registration
Verobj. registerasversioned (true );
}
2. Get version data
The process of obtaining version data is relatively simple. You must provide a version string when connecting to the database.
By default, SDE. Default is used. If a string of another version is used, data of another version is obtained.
3. Create a new version
// Assume that space is a workspace and an enterprise database workspace. My database and file workspace is
// Version is not available.
Iversionedworkspace pverws = (iversionedworkspace) space;
Iversion Pv = pverws. defaultversion; // the previous version uses the default version as the previous version.
Iversion PVC = pv. createversion (vername); // create a version
PVC. Description = verdesc; // version description
PVC. Access = esriversionaccess. esriversionaccessprivate; // the access policy of the version is private.
Pnewverws = (iversionedworkspace) PVC; // obtain a shortcut for using the new version of Workspace
4. Merge version data
Use the iversionedit interface to merge data
This interface is implemented by versionedworkspace.
This interface is described below
Can canpost versions being edited be submitted to the target version.
The common ancestor of the current and target versions of commonancestorversion.
Conflictclasses has conflicting classes.
Modifiedclasses is a class in two versions.
Post submit version data
The status of the target prereconcileversion before the conflict detection (?).
Reconcile test data conflict. If true is returned, a conflict exists.
The status of the target version of reconcileversion at the beginning of conflict detection (?)
Status when the target version of starteditingversion is edited (?)
You must call reconcile before submitting data. Otherwise, an error may be returned.

5. Browse the metadata of the working version
View version Metadata refers to the versions in the workspace. Who is the father or ancestor of a specified version?
What other derived versions does it have?
The iversioninfo interface provides this information.
The following is the details of the iversioninfo interface:
Access interface Access Policy
All the ancestors of the Ancestors version are arranged in the ascending order.
The directly derived version of children.
Creation Time of created
Description
Does the current isowner user have this version?
Last modified modification time
Parent versions are directly connected by the parent
Versionname

Note that versioninfo implements the preceding interface, but versioninfo is not a class that can be used to create objects. We can only
Other methods
Iversionedworkspace. findversion ("target version name ");
Or
Iversionedworkapce. Versions obtains the versions available to all current users. Including creating public and protected versions created by others
However, if someone else builds a version that is protected, you can only see the data. Cannot be edited.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.