private void cbBoundingBoxTypes_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { this.IgnoreTextBoxChange = true; if (e.AddedItems.Count > 0) { string arg_23_0 = this.cbBoundingBoxTypes.Text; string text = e.AddedItems[0].ToString(); if (text == AfaStrings.DrawingExtents) { Extent dwgExtent = DocUtil.GetDwgExtent(AfaDocData.ActiveDocData.Document); this.ExtentOptions[text] = dwgExtent; } if (text == AfaStrings.CurrentView) { Extent viewExtent = DocUtil.GetViewExtent(AfaDocData.ActiveDocData.Document); this.ExtentOptions[text] = viewExtent; } if (text == AfaStrings.SelectCorners) { this.cbBoundingBoxTypes.Refresh(); Window window = Window.GetWindow(this); window.Visibility = Visibility.Collapsed; Extent extentsFromCorners = DocUtil.GetExtentsFromCorners(AfaDocData.ActiveDocData.Document); window.Visibility = Visibility.Visible; if (!DocUtil.IsValidExtent(extentsFromCorners)) { ComboBox comboBox = (ComboBox)sender; comboBox.SelectedItem = e.RemovedItems[0]; this.IgnoreTextBoxChange = false; return; } this.ctrlBoundingBoxExtent.Content = extentsFromCorners; this.ExtentOptions[AfaStrings.Custom] = (this.CustomExtent = extentsFromCorners); text = (this.cbBoundingBoxTypes.Text = AfaStrings.Custom); } if (text != AfaStrings.Custom) { this.ctrlBoundingBoxExtent.Content = Utility.CloneObject(this.ExtentOptions[text]); } } this.IgnoreTextBoxChange = false; } catch { } }
private void BuildDocExtentOptions() { Document document = AfaDocData.ActiveDocData.Document; this.DocExtentOptions = new Dictionary <string, Extent>(); this.DefaultExtent = new Extent(0.0, 0.0, 100.0, 100.0); this.DefaultExtent.SetWKTFrom(AfaDocData.ActiveDocData.DocPRJ.WKT); if (DocUtil.HasLimits(AfaDocData.ActiveDocData.Document)) { this.DocExtentOptions.Add(AfaStrings.DrawingLimits, DocUtil.GetLimitExtent(document)); } Extent dwgExtent = DocUtil.GetDwgExtent(document); if (dwgExtent != null) { this.DocExtentOptions.Add(AfaStrings.DrawingExtents, DocUtil.GetDwgExtent(document)); } Extent viewExtent = DocUtil.GetViewExtent(document); this.DocExtentOptions.Add(AfaStrings.CurrentView, viewExtent); this.DocExtentOptions.Add(AfaStrings.SelectCorners, this.DefaultExtent); }