Esempio n. 1
0
 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
     {
     }
 }