1 public void VersionManagement(IVersionedWorkspace versionedWorkspace)
 2 {
 3 //creating the new version off of the Default Version
 4 
 5 IVersion version = versionedWorkspace.DefaultVersion;
 6 version.CreateVersion("Work Order 95082");
 7 
 8     //setting the versions access
 9     version.Access = esriVersionAccess.esriVersionAccessPublic; 
10 
11     //setting the versiones description
12     version.Description = "Smiley Heights sewer project extension.";
13 
14     //checking the versions ancestry
15     if(version.HasParent())
16     {
17         IVersionInfo versionInfo = version.VersionInfo;
18         IVersion parentVersion = (IVersion)versionInfo.Parent;
19         MessageBox.Show(parentVersion.VersionName);
20     }
21 
22     //checking the locks on the version
23     IEnumLockInfo enumLockInfo = version.VersionLocks;
24     ILockInfo lockinfo = enumLockInfo.Next();
25 
26     while(lockinfo != null)
27     {
28         MessageBox.Show(" User: " + lockinfo.UserName + " has lock on version");
29         lockinfo = enumLockInfo.Next();
30     }
31 
32     //Renaming a version
33     version.VersionName = "North Redlands Tract";
34 
35     //deleting the version       
36     version.Delete();
37 }

 

相关文章:

  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
猜你喜欢
  • 2021-11-04
  • 2021-07-01
  • 2021-09-24
  • 2022-01-07
  • 2022-12-23
  • 2021-11-24
  • 2021-05-15
相关资源
相似解决方案