Bonjour,

J'ai créer 2 méthodes qui modifient 2 valeurs grâce à ref

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
partial class TitleAndDescription
    {
        private string titleFR;
        private string titleEN;
        private string descriptionFR;
        private string descriptionEN;
 
        public TitleAndDescription(string _titleFR, string _titleEN, string _descriptionFR, string _descriptionEN)
        {
            titleFR = _titleFR;
            titleEN = _titleEN;
            descriptionEN = _descriptionEN;
            descriptionFR = _descriptionFR;
        }
        public void GetTitleAndDescriptionEN(ref string _title, ref string _description)
        {
            _title = titleEN;
            _description = descriptionEN;
        }
 
        public void GetTitleAndDescriptionFR(ref string _title, ref string _description)
        {
            _title = titleFR;
            _description = descriptionFR;
        }
 
    }
Pour choisir laquelle des 2 méthodes à utiliser, j'ai créé un délégué
Code : Sélectionner tout - Visualiser dans une fenêtre à part
delegate void DelChoose(ref string title, ref string description);
Cependant, je no comprends pas pourquoi mon appel n'est pas correct
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
DelChoose delChoose;
                if (isFrench)
                {
                    delChoose = new DelChoose(TitleAndDescription.GetTitleAndDescriptionFR);
                }
                else delChoose = new DelChoose(TitleAndDescription.GetTitleAndDescriptionEN);
delChoose(ref (string)rawData[indLine, 9], ref (string)rawData[indLine, 6]);
Merci de votre aide.