public class ecfTool : ICommand { private string ecfUrl = "http://mywebsite/ExternalLink.do?auto=1&linkName=ByNumber&Number="; private Graphic inputFeat; #region ICommand members public void Execute(object parameter) { // Get input feature and layer OnClickPopupInfo popupInfo = parameter as OnClickPopupInfo; inputFeat = popupInfo.PopupItem.Graphic; System.Windows.Browser.HtmlPage.Window.Navigate( new Uri(ecfUrl + inputFeat.Attributes["FILE_NO"].ToString()), "_blank", "top=0,left=0,location=1,menubar=1,toolbar=1, resizable=1"); } public event EventHandler CanExecuteChanged; public bool CanExecute(object parameter) { // Return true so that the command can always be executed //return true; // Check that the parameter contains pop-up information and // that the current feature shown in the pop-up is a point OnClickPopupInfo puInfo = parameter as OnClickPopupInfo; return puInfo != null && puInfo.PopupItem != null && puInfo.PopupItem.Graphic != null && puInfo.PopupItem.Graphic.Geometry is MapPoint && puInfo.PopupItem.Graphic.Attributes.ContainsKey("FILE_NO"); } #endregion }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.