Hi,
I've created ArcPro Add-in in C# and added folder under home folder and copying project related content into it.
After adding folder I'm activating Catlog pane. If my project home folder is already in open state then i can't see newly added folder. I need to manually click on folder/homefolder location and hit refresh command.
Is there any way I can programmatically refresh homefolder/folder to see updated contents?
Any help would be appreciated.
Regards,
Prashant
Solved! Go to Solution.
I guess Esri might change internal interfaces in future releases, but typically once an interface is defined it's not supposed to change (?)
This works for me:
foreach (var itm in Project.Current.Items.OfType<FolderConnectionProjectItem>())
{
((ArcGIS.Desktop.Internal.Core.IItemInternal)itm).RefreshChildren();
}
Hi
You may be able to invoke esri_itemInfoRefreshButton manually, but you would have to specify which folder. There could also be an "invalidate" command, which would force your Catalog to refresh/reload the newly added folders.
https://github.com/Esri/arcgis-pro-sdk-community-samples/blob/master/Map-Exploration/IdentifyWindow/...
Hi,
I tried to execute below code but CanExecute returning false so unable to execute command. Also not sure how to specify folder to execute command? Could you please provide any sample?
var commandId = @"esri_itemInfoRefreshButton";
var iCommand = FrameworkApplication.GetPlugInWrapper(commandId) as ICommand;
if (iCommand != null)
{
if (iCommand.CanExecute(null))
{
iCommand.Execute(null);
}
}
-Prashant
The following sample has similar FrameworkApplication.GetPlugInWrapper() commands:
https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/HookProCommands
but I agree, you would need to specify which sub-folder you are targeting (for the refresh)
Hi,
I tried to execute refresh command in same project but still CanExecute returning false value. Exit application/Bookmark are working fine.
Could you please help me out to set target for refresh command?
protected override void OnClick()
{
var commandId = FrameworkApplication.GetPlugInWrapper(@"esri_core_exitApplicationButton") as ICommand;
if (commandId != null)
{
if (commandId.CanExecute(null))
commandId.Execute(null);
}
var commandId1 = FrameworkApplication.GetPlugInWrapper(@"esri_itemInfoRefreshButton") as ICommand;
if (commandId1 != null)
{
if (commandId1.CanExecute(null))
commandId1.Execute(null); /******** Not Executing ***********/
}
}
-Prashant
I guess Esri might change internal interfaces in future releases, but typically once an interface is defined it's not supposed to change (?)
This works for me:
foreach (var itm in Project.Current.Items.OfType<FolderConnectionProjectItem>())
{
((ArcGIS.Desktop.Internal.Core.IItemInternal)itm).RefreshChildren();
}
Thank you @KirkKuykendall1 , Perfectly working 👍