public void SetObject( object itemObject )
Public Sub SetObject( _ ByVal itemObject As Object _ )
Parameters
- itemObject
- The object from which style item's properties are populated
public void SetObject( object itemObject )
Public Sub SetObject( _ ByVal itemObject As Object _ )
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method must be called within the lambda passed to QueuedTask.Run |
//Creates a new style item and sets its properties from an existing style item public Task<StyleItem> CreateNewStyleItemAsync(StyleItem existingItem) { if (existingItem == null) throw new System.ArgumentNullException(); return QueuedTask.Run(() => { StyleItem item = new StyleItem(); //Get object from existing style item object obj = existingItem.GetObject(); //New style item's properties are set from the existing item item.SetObject(obj); //Key, Name, Tags and Category for the new style item have to be set //These values are NOT populated from the object passed in to SetObject item.Key = "KeyOfTheNewItem"; item.Name = "NameOfTheNewItem"; item.Tags = "TagsForTheNewItem"; item.Category = "CategoryOfTheNewItem"; return item; }); }
//Creates a new style item and sets its properties from an existing style item public Task<StyleItem> CreateNewStyleItemAsync(StyleItem existingItem) { if (existingItem == null) throw new System.ArgumentNullException(); return QueuedTask.Run(() => { StyleItem item = new StyleItem(); //Get object from existing style item object obj = existingItem.GetObject(); //New style item's properties are set from the existing item item.SetObject(obj); //Key, Name, Tags and Category for the new style item have to be set //These values are NOT populated from the object passed in to SetObject item.Key = "KeyOfTheNewItem"; item.Name = "NameOfTheNewItem"; item.Tags = "TagsForTheNewItem"; item.Category = "CategoryOfTheNewItem"; return item; }); }
Target Platforms: Windows 11, Windows 10