예제 #1
0
        private void btn_Select_Click(object sender, EventArgs e)
        {
            List <Level> levelsToDelete = (from level in clb_Levels.CheckedItems.Cast <String>().ToList()
                                           select this.LevelNameDic[level]).ToList();

            // deleting levels
            LevelFunctions.DeleteLevels(this.FormDoc, levelsToDelete);


            // reloading form
            this.DeleteLevelsForm_Load(sender, e);
        }
예제 #2
0
 private void btn_cmd_CreateLevel_Click(object sender, EventArgs e)
 {
     try
     {
         String levelName      = this.tbx_LevelName.Text;
         double levelElevation = Constants._Meters2Feets * double.Parse(this.tbx_LevelElevation.Text) * 1e-3;
         LevelFunctions.CreateLevel(this.FormDoc, levelName, levelElevation);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Erro");
     }
 }
예제 #3
0
        private void btn_Align_Click(object sender, EventArgs e)
        {
            if (!lb_LinkLevels.Items.Count.Equals(lb_DocLevels.Items.Count))
            {
                MessageBox.Show("As listas devem possuir a mesma quantidade de níveis, " +
                                "afim de alinha-los em pares.", "Erro");
            }
            else if (lb_LinkLevels.Items.Count.Equals(0))
            {
                MessageBox.Show("Nenhum nível a alinhar. Adicione níveis nas listas.", "Aviso");
            }
            else
            {
                int          n = lb_LinkLevels.Items.Count;
                List <Level> levelsToBeAligned = (from levelName in lb_DocLevels.Items.Cast <String>()
                                                  select this.DocLevelNamesDic[levelName])
                                                 .ToList();
                List <Level> levelsBase = (from levelName in lb_LinkLevels.Items.Cast <String>()
                                           select this.LinkLevelNamesDic[levelName])
                                          .ToList();

                LevelFunctions.AlignLevels(levelsToBeAligned, levelsBase);
            }
        }
예제 #4
0
 private void btn_Copy_Click(object sender, EventArgs e)
 {
     LevelFunctions.CopyLevels(this.FormDoc,
                               (from levelName in lb_Levels.Items.Cast <String>().ToList()
                                select this.LevelNameDic[levelName]).ToList());
 }