示例#1
0
 private void M_color_Enter(object sender, EventArgs e)
 {
     try
     {
         player_modif = true;
         M_color.Items.Clear();
         string piece = wardrobe.Visual_part.Pointer.Split('_').Last();
         Part   mypart;
         if (piece.Contains("Etage"))
         {
             string part = ((Box)wardrobe.Components[piece.Split('*').First()][piece.Split('*').Last()]).Visual_part.Pointer.Split('_').Last();
             mypart = ((Box)wardrobe.Components[piece.Split('*').First()][piece.Split('*').Last()]).Pieces[part.Split('*').First()][part.Split('*').Last()];
         }
         else
         {
             mypart = ((Part)wardrobe.Components[piece.Split('*').First()][piece.Split('*').Last()]);
         }
         Dictionary <string, string> selected_characteristics = new Dictionary <string, string>()
         {
             { "Ref", mypart.Reference },
             { "largeur", Convert.ToString(mypart.Dimensions.X) },
             { "hauteur", Convert.ToString(mypart.Dimensions.Y) },
             { "profondeur", Convert.ToString(mypart.Dimensions.Z) }
         };
         List <string> options = DbCatalog.DbGetColors(selected_characteristics);
         foreach (string option in options)
         {
             M_color.Items.Add(option);
         }
     }
     catch { }
 }
示例#2
0
 private void M_addbox_Click(object sender, EventArgs e)
 {
     if (DbCatalog.DbGetHeightOpt(0, wardrobe.Dimensions.Y).Count == 0 || wardrobe.Components["Etage"].Count == 7)
     {
         return;
     }
     wardrobe.AddBox(36);
     Preset();
 }
示例#3
0
        private void M_depth_Enter(object sender, EventArgs e)
        {
            M_depth.Items.Clear();
            List <string> options = DbCatalog.DbGetLateralDimOpt("GD");

            foreach (string option in options)
            {
                M_depth.Items.Add(option);
            }
        }
示例#4
0
 private void M_height_Enter(object sender, EventArgs e)
 {
     try
     {
         player_modif = true;
         M_height.Items.Clear();
         List <string> options = DbCatalog.DbGetHeightOpt(Convert.ToDouble(M_height.Text), wardrobe.Dimensions.Y);
         foreach (string option in options)
         {
             M_height.Items.Add(option);
         }
     }
     catch { }
 }
示例#5
0
        private void OnFocus(object sender, EventArgs e)
        {
            M_pointer.Text = part.Pointer;
            string piece = wardrobe.Visual_part.Pointer.Split('_').Last();

            player_modif = false;
            if (typeof(Part).IsInstanceOfType(wardrobe.Components[piece.Split('*').First()][piece.Split('*').Last()]))
            {
                M_height.Text = Convert.ToString(((Part)wardrobe.Components[piece.Split('*').First()][piece.Split('*').Last()]).Dimensions.Y);
                M_color.Text  = DbCatalog.TraduireCouleur(((Part)wardrobe.Components[piece.Split('*').First()][piece.Split('*').Last()]).Color.Name);
            }
            else
            {
                M_height.Text = Convert.ToString(((Box)wardrobe.Components[piece.Split('*').First()][piece.Split('*').Last()]).Dimensions.Y);
                string part = ((Box)wardrobe.Components[piece.Split('*').First()][piece.Split('*').Last()]).Visual_part.Pointer.Split('_').Last();
                try    //si la selection est une box mais qu'aucune piece n'est selectionnee, il ne faut pas changer le texte
                {
                    M_color.Text = DbCatalog.TraduireCouleur(((Box)wardrobe.Components[piece.Split('*').First()][piece.Split('*').Last()]).Pieces[part.Split('*').First()][part.Split('*').Last()].Color.Name);
                }
                catch { }
            }
        }