コード例 #1
0
 public CreateZonesByLevelForm(SortedList <double, Level> levels, SortedList <double, Grid> gridsNorthSouth, SortedList <double, Grid> gridsEastWest, Units docUnits)
 {
     InitializeComponent();
     m_Levels          = levels;
     m_GridsNorthSouth = gridsNorthSouth;
     m_GridsEastWest   = gridsEastWest;
     checkedListBoxLevels.Items.Add("Bottom of Model", true);
     foreach (Level value in levels.Values)
     {
         checkedListBoxLevels.Items.Add(value.get_Name(), true);
     }
     checkedListBoxLevels.Items.Add("Top of Model", true);
     checkedListBoxGridsEastWest.Items.Add("Origin", true);
     foreach (Grid value2 in gridsEastWest.Values)
     {
         checkedListBoxGridsEastWest.Items.Add(value2.get_Name(), false);
     }
     checkedListBoxGridsEastWest.Items.Add("North Model Edge", true);
     checkedListBoxGridsNorthSouth.Items.Add("Origin", true);
     foreach (Grid value3 in gridsNorthSouth.Values)
     {
         checkedListBoxGridsNorthSouth.Items.Add(value3.get_Name(), false);
     }
     checkedListBoxGridsNorthSouth.Items.Add("East Model Edge", true);
     inputBoxLevelOffset = new FormattedInputBox(textBoxLevelOffset, docUnits, 0);
 }
コード例 #2
0
 public AffectedViewRangeForm(string[] levelsInView, Units docUnits)
 {
     InitializeComponent();
     comboBoxTopLevel.Items.AddRange(levelsInView);
     comboBoxBottomLevel.Items.AddRange(levelsInView);
     comboBoxTopLevel.Items.Add("Unlimited");
     comboBoxBottomLevel.Items.Add("Unlimited");
     comboBoxTopLevel.SelectedItem    = "Unlimited";
     comboBoxBottomLevel.SelectedItem = "Unlimited";
     inputBoxTopOffset    = new FormattedInputBox(textBoxTopOffset, docUnits, 0);
     inputBoxBottomOffset = new FormattedInputBox(textBoxBottomOffset, docUnits, 0);
 }
コード例 #3
0
        public EditZoneBoundsForm(ZoneData zone, SortedList <double, Level> levels, SortedList <double, Grid> gridsNorthSouth, SortedList <double, Grid> gridsEastWest, Units docUnits)
        {
            InitializeComponent();
            if (!string.IsNullOrWhiteSpace(zone.Name))
            {
                textBoxName.Text = zone.Name;
            }
            else
            {
                textBoxName.Text = "Zone";
            }
            m_Levels          = levels;
            m_GridsNorthSouth = gridsNorthSouth;
            m_GridsEastWest   = gridsEastWest;
            string[] array = (from l in m_Levels.Values
                              select l.get_Name()).ToArray();
            ComboBox[] array2 = new ComboBox[2]
            {
                comboBoxTopLevel,
                comboBoxBottomLevel
            };
            ComboBox[] array3 = array2;
            object[]   items2;
            foreach (ComboBox comboBox in array3)
            {
                ComboBox.ObjectCollection items = comboBox.Items;
                items2 = array;
                items.AddRange(items2);
            }
            ComboBox comboBox2 = comboBoxTopLevel;
            object   topLevel  = (object)zone.TopLevel;

            comboBox2.SelectedItem = (((topLevel != null) ? topLevel.get_Name() : null) ?? array.Last());
            ComboBox comboBox3 = comboBoxBottomLevel;
            object   baseLevel = (object)zone.BaseLevel;

            comboBox3.SelectedItem = (((baseLevel != null) ? baseLevel.get_Name() : null) ?? array.First());
            string[] array4 = (from g in m_GridsNorthSouth.Values
                               select g.get_Name()).ToArray();
            string[] array5 = (from g in m_GridsEastWest.Values
                               select g.get_Name()).ToArray();
            ComboBox.ObjectCollection items3 = comboBoxNorthGrid.Items;
            items2 = array5;
            items3.AddRange(items2);
            ComboBox.ObjectCollection items4 = comboBoxSouthGrid.Items;
            items2 = array5;
            items4.AddRange(items2);
            ComboBox.ObjectCollection items5 = comboBoxEastGrid.Items;
            items2 = array4;
            items5.AddRange(items2);
            ComboBox.ObjectCollection items6 = comboBoxWestGrid.Items;
            items2 = array4;
            items6.AddRange(items2);
            comboBoxNorthGrid.Items.Add("Origin");
            comboBoxSouthGrid.Items.Add("Origin");
            comboBoxEastGrid.Items.Add("Origin");
            comboBoxWestGrid.Items.Add("Origin");
            ComboBox comboBox4 = comboBoxNorthGrid;
            object   northGrid = (object)zone.NorthGrid;

            comboBox4.SelectedItem = (((northGrid != null) ? northGrid.get_Name() : null) ?? "Origin");
            ComboBox comboBox5 = comboBoxSouthGrid;
            object   southGrid = (object)zone.SouthGrid;

            comboBox5.SelectedItem = (((southGrid != null) ? southGrid.get_Name() : null) ?? "Origin");
            ComboBox comboBox6 = comboBoxEastGrid;
            object   eastGrid  = (object)zone.EastGrid;

            comboBox6.SelectedItem = (((eastGrid != null) ? eastGrid.get_Name() : null) ?? "Origin");
            ComboBox comboBox7 = comboBoxWestGrid;
            object   westGrid  = (object)zone.WestGrid;

            comboBox7.SelectedItem     = (((westGrid != null) ? westGrid.get_Name() : null) ?? "Origin");
            inputBoxTopOffset          = new FormattedInputBox(textBoxTopOffset, docUnits, 0);
            inputBoxBottomOffset       = new FormattedInputBox(textBoxBottomOffset, docUnits, 0);
            inputBoxNorthOffset        = new FormattedInputBox(textBoxNorthOffset, docUnits, 0);
            inputBoxSouthOffset        = new FormattedInputBox(textBoxSouthOffset, docUnits, 0);
            inputBoxEastOffset         = new FormattedInputBox(textBoxEastOffset, docUnits, 0);
            inputBoxWestOffset         = new FormattedInputBox(textBoxWestOffset, docUnits, 0);
            inputBoxTopOffset.Value    = zone.TopOffset;
            inputBoxBottomOffset.Value = zone.BaseOffset;
            inputBoxNorthOffset.Value  = zone.NorthOffset;
            inputBoxSouthOffset.Value  = zone.SouthOffset;
            inputBoxEastOffset.Value   = zone.EastOffset;
            inputBoxWestOffset.Value   = zone.WestOffset;
            textBoxName.SelectAll();
        }