public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Visibility vis = (Visibility)value; string content = LocalizableStrings.GetString("More"); if (vis == Visibility.Visible) { content = LocalizableStrings.GetString("Less"); } return(content); }
void Instance_BehaviorClassLoadException(object sender, ExceptionEventArgs e) { string message = string.Empty; if (e != null && e.Exception != null) { message = e.Exception.Message; } AddNotification(LocalizableStrings.GetString("BehaviorClassLoadFailed"), message, e.Exception != null ? e.Exception.ToString() : null, MessageType.Warning); }
public void Configure() { ConstrainExtentBehaviorConfigControl config = new ConstrainExtentBehaviorConfigControl(); config.ConstrainedExtent = _constrainedExtent; if (config != null) { MapApplication.Current.ShowWindow(LocalizableStrings.GetString("ConstrainExtentBehaviorTitle"), config, false, null, delegate(object obj, EventArgs args1) { if (config != null && config.ConstrainedExtent != null) { ConstrainedExtent = _constrainedExtent = config.ConstrainedExtent; } }); } }
public override void Execute(object parameter) { if (_mapBehaviorsList == null) { _mapBehaviorsList = new MapBehaviorsList() { Margin = new Thickness(10, 15, 10, 5) }; } _mapBehaviorsList.IsEdit = IsEdit; WindowType windowType = MapApplication.Current.IsEditMode ? WindowType.DesignTimeFloating : WindowType.Floating; MapApplication.Current.ShowWindow(LocalizableStrings.GetString("MapBehaviors"), _mapBehaviorsList, false, null, (sender, e) => { _mapBehaviorsList = null; }, windowType); }
public override void Execute(object parameter) { ExtensionBehavior behavior = parameter as ExtensionBehavior; if (behavior == null) { return; } MessageBoxDialog.Show(LocalizableStrings.GetString("DeleteBehaviorCaption"), LocalizableStrings.GetString("DeleteBehaviorPrompt"), MessageBoxButton.OKCancel, new MessageBoxClosedEventHandler(delegate(object obj, MessageBoxClosedArgs args1) { if (args1.Result == MessageBoxResult.OK) { // remove from map removeMapBehavior(behavior); } })); }
void MapBehaviorsDataGrid_LoadingRow(object sender, DataGridRowEventArgs e) { if (MapBehaviorsDataGrid != null && MapBehaviorsDataGrid.Columns != null) { DataGridRow row = e.Row; if (row != null) { Behavior <Map> behavior = (row.DataContext as ExtensionBehavior).MapBehavior; if (behavior != null) { foreach (DataGridColumn column in MapBehaviorsDataGrid.Columns) { TextBlock element = column.GetCellContent(row) as TextBlock; if (element != null) { element.SetValue(ToolTipService.ToolTipProperty, LocalizableStrings.GetString("TypeLabel") + " " + behavior.GetType().ToString()); } } } } } }
void Instance_BehaviorClassLoadConfigurationException(object sender, ExceptionEventArgs e) { AddNotification(LocalizableStrings.GetString("BehaviorToolClassLoadConfigurationFailed"), LocalizableStrings.GetString("BehaviorToolClassLoadConfigurationFailedDescription"), e.Exception != null ? e.Exception.ToString() : null, MessageType.Warning); }
public override void Execute(object parameter) { ExtensionBehavior extensionBehavior = parameter as ExtensionBehavior; if (extensionBehavior == null) { return; } ISupportsConfiguration supportConfiguration = extensionBehavior.MapBehavior as ISupportsConfiguration; if (supportConfiguration != null) { try { supportConfiguration.Configure(); } catch (Exception ex) { if (ViewerApplicationControl.Instance == null) { MessageBoxDialog.Show(LocalizableStrings.GetString("BehaviorConfigurationFailedDescription"), LocalizableStrings.GetString("BehaviorConfigurationFailed"), MessageBoxButton.OK); } else { NotificationPanel.Instance.AddNotification(LocalizableStrings.GetString("BehaviorConfigurationFailed"), LocalizableStrings.GetString("BehaviorConfigurationFailedDescription"), ex.ToString(), MessageType.Warning); } } } }