Skip To Content

BranchVersion.ChangeAsync (.NET)

The BranchVersion.ChangeAsync method changes the branch version for the specified web feature layer. Branch versions may be displayed as locked in the Esri Contents user interface if the published service is set to read-only or if the branch version could not be edited at the time it was added. If it's not designated specifically as a read-only layer, the branch version layer can be switched to the unlocked editing state in the context menu of the Esri Contents user interface but requires a user with the appropriate credentials to be signed-in to synchronize changes.

Declaration

public async Task<bool> Esri.ArcGISForAutoCAD.BranchVersion.ChangeAsync(Document doc, string flName, string branchName)

Parameters

TypeNameDescriptionRequired

Document

doc

The AutoCAD document to act on.

required

string

flName

An existing web feature layer name in the drawing that supports branch versioning.

required

string

branchName

An existing branch name that will be used for the current branch version.

required

Returns

TypeDescription

bool

true if the branch version was changed successfully

Remarks on error conditions

This method may throw an exception or return false or null if a parameter is invalid or the web feature layer does not support branch versioning.

Example

Print the success of changing the branch version of the Distribution web feature layer to the editor01.phase1 branch version.

// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;

// Change the branch version
var success = await Esri.ArcGISForAutoCAD.BranchVersion.ChangeAsync(doc, "Distribution", "editor01.phase1"); 

// Print the success
doc.Editor.WriteMessage(success.ToString());

/* Example output 
True
*/

See also

WebFeatureLayer.Get—A .NET method that gets the web feature layer properties for the specified web feature layer as a dictionary.

esri_webfeaturelayer_changeBranch—An AutoLISP function that changes the branch version for the specified web feature layer.