Indicates if metadata is editable for the item. This method must be called on the MCT. Use QueuedTask.Run.
Public Function CanEdit() As Boolean
Return Value
true if the metadata can be edited
Item: Set the metadata of an item: SetXML
await QueuedTask.Run(() =>
{
var xml = System.IO.File.ReadAllText(@"E:\Data\Metadata\MetadataForFeatClass.xml");
//Will throw InvalidOperationException if the metadata cannot be changed
//so check "CanEdit" first
if (featureClassMetadataItem.CanEdit())
featureClassMetadataItem.SetXml(xml);
});
Item: Check the metadata can be edited: CanEdit
bool canEdit1;
//Call CanEdit before calling SetXml
await QueuedTask.Run(() => canEdit1 = metadataItemToCheck.CanEdit());
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.