

Public NotInheritable Class KnowledgeGraphInvestigationProjectItem Inherits KnowledgeGraphBaseProjectItem Implements ArcGIS.Desktop.Core.IMetadata, ArcGIS.Desktop.Core.IProjectItem, ArcGIS.Desktop.Mapping.IMappableItem, System.ComponentModel.INotifyPropertyChanged
public sealed class KnowledgeGraphInvestigationProjectItem : KnowledgeGraphBaseProjectItem, ArcGIS.Desktop.Core.IMetadata, ArcGIS.Desktop.Core.IProjectItem, ArcGIS.Desktop.Mapping.IMappableItem, System.ComponentModel.INotifyPropertyChanged
{
// open an existing investigation
var investigationProjectItems = Project.Current.GetItems<KnowledgeGraphInvestigationProjectItem>();
var investigationProjectItem = investigationProjectItems.FirstOrDefault(ipi => ipi.Name.Equals("myInvestigation"));
await QueuedTask.Run(() =>
{
KnowledgeGraphInvestigation investigation = investigationProjectItem.GetInvestigation();
ProApp.Panes.CreateInvestigationPaneAsync(investigation);
// or
investigation.OpenViewAsync();
});
// or
investigationProjectItem.OpenInvestigationPaneAsync();
}
{
var containerPath = "KnowledgeGraph";
// find the first container with the correct path (key)
var invContainer =
Project.Current.ProjectItemContainers.FirstOrDefault(c => c.Path == containerPath);
}
{
var investigationContainer = Project.Current.GetProjectItemContainer("KnowledgeGraph");
var item = Project.Current.GetItems<KnowledgeGraphInvestigationProjectItem>().FirstOrDefault();
//Select the fc
if (item != null)
{
var projectWindow = Project.GetCatalogPane();
await projectWindow.SelectItemAsync(item, true, true, investigationContainer);
}
}
{
// open an existing investigation
var investigationProjectItems = Project.Current.GetItems<KnowledgeGraphInvestigationProjectItem>();
var investigationProjectItem = investigationProjectItems.FirstOrDefault(ipi => ipi.Name.Equals("myInvestigation"));
await QueuedTask.Run(() =>
{
KnowledgeGraphInvestigation investigation = investigationProjectItem.GetInvestigation();
var panes = investigation.GetInvestigationPanes();
foreach (var pane in panes)
{
KnowledgeGraphInvestigationView kgView = pane.InvestigationView;
// if it's the active investigation view
if (kgView == KnowledgeGraphInvestigationView.Active)
{
// do something
}
}
});
}
{
// get an existing investigation
var investigationProjectItems = Project.Current.GetItems<KnowledgeGraphInvestigationProjectItem>();
var investigationProjectItem = investigationProjectItems.FirstOrDefault(ipi => ipi.Name.Equals("myInvestigation"));
await QueuedTask.Run(() =>
{
// get the datasore
using (var kg = investigationProjectItem.GetDatastore())
{
// do something
}
});
}
{
//Confirm if investigation exists as a project item
KnowledgeGraphInvestigationProjectItem investigationItem =
Project.Current.GetItems<KnowledgeGraphInvestigationProjectItem>().FirstOrDefault(
item => item.Name.Equals("myInvestigation"));
if (investigationItem != null)
{
KnowledgeGraphInvestigation investigation =
await QueuedTask.Run(() => investigationItem.GetInvestigation());
// see if a view is already open that references the same investigation
foreach (var investigationPane in ProApp.Panes.OfType<IKnowledgeGraphInvestigationPane>())
{
//if there is a match, activate the view
if (investigationPane.InvestigationView.Investigation == investigation)
{
(investigationPane as Pane).Activate();
return;
}
}
}
}
System.Object
ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
ArcGIS.Desktop.Core.Item
ArcGIS.Desktop.KnowledgeGraph.KnowledgeGraphBaseProjectItem
ArcGIS.Desktop.KnowledgeGraph.KnowledgeGraphInvestigationProjectItem
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)