arcengine之版本管理
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 }
多看一行书,就少写一行代码,记录点滴,用心生活。