public void Execute(object parameter) { if (!string.IsNullOrWhiteSpace(StyleName) && AttachmentEditorStyle == null) { return; } FeatureLayer layer = GetFeatureLayer(parameter); if (layer == null) { return; } Graphic graphic = layer.SelectedGraphics != null?layer.SelectedGraphics.ElementAt(0) : null; if (graphic == null) { return; } if (_configuration == null) { _configuration = new AttachmentEditorConfiguration(); } if (_attachmentEditor == null) { _attachmentEditor = new AttachmentEditor(); _attachmentEditor.Width = _configuration.Width; _attachmentEditor.Height = _configuration.Height; _attachmentEditor.FilterIndex = _configuration.FilterIndex; _attachmentEditor.Filter = _configuration.Filter; _attachmentEditor.Multiselect = _configuration.MultiSelect; if (AttachmentEditorStyle != null) { _attachmentEditor.Style = AttachmentEditorStyle; } _window = new FloatingWindow(); _window.Content = _attachmentEditor; _window.Title = Resources.Strings.AttachmentEditorHeader; } _attachmentEditor.DataContext = _configuration; _attachmentEditor.GraphicSource = null; _attachmentEditor.FeatureLayer = null; if (graphic != null) { _attachmentEditor.FeatureLayer = layer; _attachmentEditor.GraphicSource = graphic; _window.Show(true); } }
public void Configure() { if (_configControl == null) { _configControl = new AttachmentEditorConfigControl(); _configControl.ConfigCompleted += _configControl_ConfigCompleted; } if (_configuration == null) { _configuration = new AttachmentEditorConfiguration(); } _configControl.Configuration = _configuration; MapApplication.Current.ShowWindow(Resources.Strings.AttachmentEditorConfigHeader, _configControl, true, null, null, WindowType.DesignTimeFloating); }
public void Execute(object parameter) { if (!string.IsNullOrWhiteSpace(StyleName) && AttachmentEditorStyle == null) return; FeatureLayer layer = GetFeatureLayer(parameter); if (layer == null) return; Graphic graphic = layer.SelectedGraphics != null ? layer.SelectedGraphics.ElementAt(0) : null; if (graphic == null) return; if (_configuration == null) _configuration = new AttachmentEditorConfiguration(); if (_attachmentEditor == null) { _attachmentEditor = new AttachmentEditor(); _attachmentEditor.Width = _configuration.Width; _attachmentEditor.Height = _configuration.Height; _attachmentEditor.FilterIndex = _configuration.FilterIndex; _attachmentEditor.Filter = _configuration.Filter; _attachmentEditor.Multiselect = _configuration.MultiSelect; if(AttachmentEditorStyle != null) _attachmentEditor.Style = AttachmentEditorStyle; _window = new FloatingWindow(); _window.Content = _attachmentEditor; _window.Title = Resources.Strings.AttachmentEditorHeader; } _attachmentEditor.DataContext = _configuration; _attachmentEditor.GraphicSource = null; _attachmentEditor.FeatureLayer = null; if (graphic != null) { _attachmentEditor.FeatureLayer = layer; _attachmentEditor.GraphicSource = graphic; _window.Show(true); } }
public void LoadConfiguration(string configData) { _configuration = AttachmentEditorConfiguration.FromString(configData); }
public void Configure() { if (_configControl == null) { _configControl = new AttachmentEditorConfigControl(); _configControl.ConfigCompleted += _configControl_ConfigCompleted; } if (_configuration == null) _configuration = new AttachmentEditorConfiguration(); _configControl.Configuration = _configuration; MapApplication.Current.ShowWindow(Resources.Strings.AttachmentEditorConfigHeader, _configControl, true, null, null, WindowType.DesignTimeFloating); }
public void LoadConfiguration(string configData) { _configuration = AttachmentEditorConfiguration.FromString(configData); }