using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using ESRI.ArcGISExplorer; using ESRI.ArcGISExplorer.Application; using ESRI.ArcGISExplorer.Mapping; using ESRI.ArcGISExplorer.Geometry; using ESRI.ArcGISExplorer.Data; using ESRI.ArcGISExplorer.Threading; using WRMS.AVLDataSetTableAdapters; namespace WRMS { public class AvlGallery : ESRI.ArcGISExplorer.Application.Gallery { #region Fetch Data private AVLCurrentResourcesTableAdapter AvlTableAdapter = new AVLCurrentResourcesTableAdapter(); private AVLDataSet AvlDataSet = new AVLDataSet(); private int fetchCount; #endregion #region Icons Image t6resource = WRMS.Properties.Resources.T6Resource; #endregion public AvlGallery() { this.AvlTableAdapter.Fill(AvlDataSet.AVLCurrentResources); fetchCount = AvlDataSet.AVLCurrentResources.Count; avlGalleryFill(); } public override void OnClick(GalleryItem item) { AvlInfoWindow avlInfo = new AvlInfoWindow(item.Caption.ToString()); avlInfo.Location = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.ConvertToScreenPoint(ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Center); avlInfo.StartPosition = FormStartPosition.Manual; avlInfo.Show(); } public override void OnUpdate() { base.OnUpdate(); if (AVL.isChecked) { this.Enabled = true; this.AvlTableAdapter.Fill(AvlDataSet.AVLCurrentResources); if (fetchCount != AvlDataSet.AVLCurrentResources.Count) { this.Items.Clear(); avlGalleryFill(); } } else { this.Enabled = false; } } public void avlGalleryFill() { foreach (DataRow resource in AvlDataSet.AVLCurrentResources) { this.Items.Add(new GalleryItem(resource["Callsign"].ToString(), t6resource)); } } } }Solved! Go to Solution.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using ESRI.ArcGISExplorer; using ESRI.ArcGISExplorer.Application; using ESRI.ArcGISExplorer.Mapping; using ESRI.ArcGISExplorer.Geometry; using ESRI.ArcGISExplorer.Data; using ESRI.ArcGISExplorer.Threading; using WRMS.AVLDataSetTableAdapters; namespace WRMS { public class AvlGallery : ESRI.ArcGISExplorer.Application.Gallery { #region Fetch Data private AVLCurrentResourcesTableAdapter AvlTableAdapter = new AVLCurrentResourcesTableAdapter(); private AVLDataSet AvlDataSet = new AVLDataSet(); private int fetchCount; #endregion #region Icons Image t6resource = WRMS.Properties.Resources.T6Resource; #endregion public AvlGallery() { AvlTableAdapter.Fill(AvlDataSet.AVLCurrentResources); fetchCount = AvlDataSet.AVLCurrentResources.Count; avlGalleryFill(); } public override void OnClick(GalleryItem item) { AvlInfoWindow avlInfo = new AvlInfoWindow(item.Caption.ToString()); avlInfo.Location = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.ConvertToScreenPoint(ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Center); avlInfo.StartPosition = FormStartPosition.Manual; avlInfo.Show(); } public override void OnUpdate() { base.OnUpdate(); if (AVL.isChecked) { Enabled = true; AvlTableAdapter.Fill(AvlDataSet.AVLCurrentResources); if (fetchCount != AvlDataSet.AVLCurrentResources.Count) { Items.Clear(); avlGalleryFill(); fetchCount = AvlDataSet.AVLCurrentResources.Count; } } else { Enabled = false; } } public void avlGalleryFill() { foreach (DataRow resource in AvlDataSet.AVLCurrentResources) { Items.Add(new GalleryItem(resource["Callsign"].ToString(), t6resource)); } } } }using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using ESRI.ArcGISExplorer; using ESRI.ArcGISExplorer.Application; using ESRI.ArcGISExplorer.Mapping; using ESRI.ArcGISExplorer.Geometry; using ESRI.ArcGISExplorer.Data; using ESRI.ArcGISExplorer.Threading; using WRMS.AVLDataSetTableAdapters; namespace WRMS { public class AvlGallery : ESRI.ArcGISExplorer.Application.Gallery { #region Fetch Data private AVLCurrentResourcesTableAdapter AvlTableAdapter = new AVLCurrentResourcesTableAdapter(); private AVLDataSet AvlDataSet = new AVLDataSet(); private int fetchCount; #endregion #region Icons Image t6resource = WRMS.Properties.Resources.T6Resource; #endregion public AvlGallery() { AvlTableAdapter.Fill(AvlDataSet.AVLCurrentResources); fetchCount = AvlDataSet.AVLCurrentResources.Count; avlGalleryFill(); } public override void OnClick(GalleryItem item) { AvlInfoWindow avlInfo = new AvlInfoWindow(item.Caption.ToString()); avlInfo.Location = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.ConvertToScreenPoint(ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Center); avlInfo.StartPosition = FormStartPosition.Manual; avlInfo.Show(); } public override void OnUpdate() { base.OnUpdate(); if (AVL.isChecked) { Enabled = true; AvlTableAdapter.Fill(AvlDataSet.AVLCurrentResources); if (fetchCount != AvlDataSet.AVLCurrentResources.Count) { Items.Clear(); avlGalleryFill(); fetchCount = AvlDataSet.AVLCurrentResources.Count; } } else { Enabled = false; } } public void avlGalleryFill() { foreach (DataRow resource in AvlDataSet.AVLCurrentResources) { Items.Add(new GalleryItem(resource["Callsign"].ToString(), t6resource)); } } } }