/// <summary> /// Updates the extents of the map element taking into account its size of screen and scale. /// </summary> private void UpdateMapElement(LayoutControl layoutControl, IEnvelope extents) { var map = layoutControl.GetMainMap(); if (map != null) { map.Envelope = extents; map.Initialized = true; layoutControl.ClearSelection(); layoutControl.AddToSelection(map); } }
private void OnListBoxSelectedIndexChanged(object sender, EventArgs e) { if (_suppressSelectionChange) { return; } _suppressSelectionChange = true; _layoutControl.SuspendLayout(); _layoutControl.ClearSelection(); _layoutControl.AddToSelection(new List <LayoutElement>(_listbox.SelectedItems.OfType <LayoutElement>())); _layoutControl.ResumeLayout(); _suppressSelectionChange = false; }