一、获取工程中的所有地图
- Dim projectMaps As IEnumerable(Of MapProjectItem) = Project.Current.GetItems(Of MapProjectItem)()
复制代码 二、从项目中删除地图
- Dim mapProjItem = Project.Current.GetItems(Of MapProjectItem)().FirstOrDefault(Function(mpi) mpi.Name = "需删除的地图名称")
- Await QueuedTask.Run(Sub()
- Project.Current.RemoveItem(mapProjItem)
- End Sub)
复制代码 三、遍历项目的所有 MapProjectItems
- dim newMapItemsContainer as IEnumerable(of MapProjectItem) = project.Current.GetItems(of MapProjectItem)()
- Await QueuedTask.Run(Sub()
- for each mp in newMapItemsContainer
- dim myMap as Map = mp.GetMap()
- next
- End Sub)
复制代码 四 获取特定的 MapProjectItem
- Dim mapProjItem = Project.Current.GetItems(Of MapProjectItem)().FirstOrDefault(Function(mpi) mpi.Name = "指定的地图名称")
- '或等价于
- Dim mapProjItem = Project.Current.GetItems(Of MapProjectItem)().FirstOrDefault(Function(mpi) mpi.Name.Equals("指定的地图名称"))
复制代码 五、在工程中查找地图并将其打开
- Dim pmap as map
- Dim mpi As MapProjectItem = Project.Current.GetItems(Of MapProjectItem)().FirstOrDefault(Function(m) m.Name.Equals("需删除的地图名称", StringComparison.CurrentCultureIgnoreCase))
- If mpi Is Nothing = False Then
- pmap = mpi.GetMap()
- End If
- Await ProApp.Panes.CreateMapPaneAsync(pmap)
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |