Esempio n. 1
0
 private void buttonVoir_Click(object sender, RoutedEventArgs e)
 {
     Classes.Element p = (Classes.Element)dataGrid.SelectedItem as Classes.Element;
     if (p != null)
     {
         new Element(p.CleElement).Show();
         Close();
     }
 }
Esempio n. 2
0
        public Element(int cleElement) : this()
        {
            //GESTION DES ELEMENTS
            listes = new ElementBase().GetElementLangue(cleElement);
            List <Reference> langues = new ElementBase().GetLangue();

            listesAjoute = new List <Classes.Element>();
            ////////////////////////////////////////
            for (int i = 0; i < langues.Count; ++i)
            {
                int  cle    = langues[i].Cle;
                bool absent = true;
                for (int j = 0; j < listes.Count; ++j)
                {
                    if (listes[j].CleLangue == cle)
                    {
                        absent = false;
                    }
                }
                if (absent)
                {
                    Classes.Element elt = new Classes.Element();
                    elt.CleElement = cleElement;
                    elt.CleLangue  = cle;
                    elt.Label      = string.Empty;
                    listesAjoute.Add(elt);
                }
            }
            ////////////////////////////////////
            if (listesAjoute.Count > 0)
            {
                foreach (Classes.Element e in listesAjoute)
                {
                    listes.Add(e);
                }
            }
            ////////////////////////////////////////////
            var r = from e in listes
                    orderby e.CleLangue
                    select e;

            listes = r.ToList();
            ///////////////////////////////////////////////
            listesConnecte = new List <Classes.Element>();
            new GestionElement().Copier(listes, listesConnecte);
            new GestionGrille().SetBindingGridCentre(listesConnecte, gridCentre);
            //GESTION DES DIMENSIONS
            List <ReferenceCheck> listOrigine  = new ElementBase().GetElementCheck(cleElement);
            List <ReferenceCheck> listConnecte = new GestionReferenceCheck().CheckListReferenceCheck(listOrigine, listesDimensions);

            listesDimensions.Clear();
            new GestionReferenceCheck().Copier(listConnecte, listesDimensions);
            new GestionWrapPanel().SetBinding(wrapPanelDimensionFrench, listConnecte);
            new GestionWrapPanel().SetBinding(wrapPanelDimensionEnglish, listConnecte, new ElementBase().GetDimensionEng());
            new GestionWrapPanel().SetBinding(wrapPanelDimensionTagalog, listConnecte, new ElementBase().GetDimensionTag());
            //GESTION DES TYPES US
        }
Esempio n. 3
0
 private void SetAttributesToTextBoxes(Classes.Element e)
 {
     textBox1.Text  = e.Type.ToString();
     textBox2.Text  = e.Curvature.ToString();
     textBox3.Text  = e.EndPoint.X.ToString();
     textBox9.Text  = e.EndPoint.Y.ToString();
     textBox5.Text  = e.BeginPoint.X.ToString();
     textBox10.Text = e.BeginPoint.Y.ToString();
     textBox4.Text  = e.Length.ToString();
     textBox6.Text  = Classes.Element.struct_size.ToString();
 }
Esempio n. 4
0
        private List <Classes.Element> GetBinding()
        {
            List <Classes.Element> elements = new List <Classes.Element>();
            List <Grid>            grids    = new GestionGrille().GetGrid(gridCentre);

            for (int i = 1; i < grids.Count; ++i)
            {
                Classes.Element e = (Classes.Element)grids[i].DataContext;
                elements.Add(e);
            }
            return(elements);
        }
Esempio n. 5
0
        public Element()
        {
            InitializeComponent();
            new GestionWrapPanel().AjoutCheckBox(wrapPanelDimensionFrench, new ElementBase().GetDimensionFr());
            new GestionWrapPanel().AjoutCheckBox(wrapPanelDimensionEnglish, new ElementBase().GetDimensionEng());
            new GestionWrapPanel().AjoutCheckBox(wrapPanelDimensionTagalog, new ElementBase().GetDimensionTag());

            new GestionComboBox().SetComboxReference(new ElementBase().GetLangue(), comboBoxLangue, 0);

            List <Reference>      l        = new ElementBase().GetDimensionFr();
            List <ReferenceCheck> listeDFr = new List <ReferenceCheck>();

            new GestionReferenceCheck().Copier(l, listeDFr);
            listesDimensions = new List <ReferenceCheck>();
            new GestionReferenceCheck().Copier(l, listesDimensions);

            new GestionWrapPanel().SetBinding(wrapPanelDimensionFrench, listeDFr);
            new GestionWrapPanel().SetBinding(wrapPanelDimensionEnglish, listeDFr, new ElementBase().GetDimensionEng());
            new GestionWrapPanel().SetBinding(wrapPanelDimensionTagalog, listeDFr, new ElementBase().GetDimensionTag());

            buttonValidate.Command = DatabaseCommand.SendDatabase;

            CommandBinding binding = new CommandBinding();

            binding.Command     = DatabaseCommand.SendDatabase;
            binding.Executed   += SendDatabase_Executed;
            binding.CanExecute += SendDatabase_CanExecute;
            CommandBindings.Add(binding);

            /////////
            listes         = new List <Classes.Element>();
            listesConnecte = new List <Classes.Element>();
            listesAjoute   = new List <Classes.Element>();
            List <Reference> langues = new ElementBase().GetLangue();

            for (int j = 0; j < langues.Count; ++j)
            {
                Classes.Element elt  = new Classes.Element();
                Classes.Element elt1 = new Classes.Element();
                Classes.Element elt2 = new Classes.Element();
                elt2.CleLangue   = elt1.CleLangue = elt.CleLangue = langues[j].Cle;
                elt2.Langue      = elt1.Langue = elt.Langue = langues[j].Label;
                elt2.Label       = elt1.Label = elt.Label = string.Empty;
                elt2.Description = elt1.Description = elt.Description = string.Empty;
                listes.Add(elt);
                listesConnecte.Add(elt1);
                listesAjoute.Add(elt2);
            }
            new GestionGrille().SetBindingGridCentre(listesConnecte, gridCentre);
        }