IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C# Discussion :

Winforms / une ProgressBar facile à utiliser : votre avis


Sujet :

C#

  1. #1
    Expert éminent Avatar de Graffito
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    5 993
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 5 993
    Points : 7 903
    Points
    7 903
    Par défaut Winforms / une ProgressBar facile à utiliser : votre avis
    Bonjour,

    Un des problèmes .net est l'affichage de ProgressBar pendant un traitements long.

    Le passage par un thread annexe est malheureusement obligatoire.On peut évidement utiliser un BackGroundWorker, mais c'est parfois un peu lourd pour activer une simple ProgressBar.

    J'ai développé une petite classe plûtot facile à implémenter pour montrer dans une form "pop-up" l'avancement du traitement (non interruptible par l'utilisateur).
    Voici un exemple de code utilisant la classe :

    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
        SxProgress Progress = null ;
         private void ProgressTest_Click(object sender,EventArgs e)
        { 
          (Progress=new SxProgress()).Init ("XXXXX in progress...",1000,true,ProgressTest_ExecInThread);
        }
     
        private void ProgressTest_ExecInThread()
        {
         for (int i=0;i<1000;i++) 
         { 
           System.Threading.Thread.Sleep(5) ; // replace Sleep() by item i process code   
           Progress.Value=i  ;  
         }
         Progress.Value=-1; // mandatory at end of procedure
        }
    Qu'en pensez-vous ?

    Voici le code de la classe appelée:
    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
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
        using System.Runtime.InteropServices;
        …
           internal class SxProgress
        { // simple implementation of a progress pop-up form
          internal int                          Value        = 0 ; // indicates progress, must be set -1 at end of tread proc
          private  SxProgressForm               ProgressForm = new SxProgressForm() ;
          private  System.Threading.ThreadStart StartProc    = null ;
     
          internal void Init(string Title,int MaxCount,bool ShowCountLabel,System.Threading.ThreadStart vStartProc)
          { 
            StartProc = vStartProc ;
            ProgressForm.Init(this,Title,MaxCount,ShowCountLabel) ;
            ProgressForm.Dispose() ;
            ProgressForm=null ;
          }
     
          internal void ThreadStart()
          { 
              try { StartProc() ; }
              catch (Exception Ex) { ProgressForm.TheException=Ex ; Value=-1 ; }
          }
     
          private class SxProgressForm : Form 
          {
            private Label       TheLabel       = null ;
            private ProgressBar TheProgressBar = null ;
            private bool        Completed      = false;
            private SxProgress  Owner          = null ;
            internal Exception  TheException   = null ;
            private System.Windows.Forms.Timer TheTimer = new System.Windows.Forms.Timer() ;
            private delegate void DoUpdateD(int ProgressValue);
     
            protected override CreateParams CreateParams 
            { // remove SYSMENU 
              get { CreateParams cp = base.CreateParams; cp.ClassStyle = cp.ClassStyle | 0x200 ; return cp; }
            }
     
            internal void Init(SxProgress vOwner, string Title,int MaxCount,bool ShowLabel)
            {
              Owner                  = vOwner ;
              FormBorderStyle        = FormBorderStyle.FixedDialog ;
              MaximizeBox            = false ;
              ShowInTaskbar          = false ;
              StartPosition          = FormStartPosition.CenterParent ;
              ClientSize             = new Size(450,25) ; 
              Text                   = Title ;
              TheTimer.Interval      = 333 ;
              TheTimer.Tick          +=TheTimer_Tick ;
              if (ShowLabel) 
              {
                TheLabel          = new Label() ;
                TheLabel.Text     = "0/"+MaxCount ;
                TheLabel.Parent   = this   ;
                TheLabel.Location = new Point(Width-100,3) ;
              }
              TheProgressBar         = new ProgressBar() ;
              TheProgressBar.Size    = new Size (Width-(ShowLabel?115:25),10) ;
              TheProgressBar.Location= new Point(10,7) ;
              TheProgressBar.Parent  = this ;
              TheProgressBar.Maximum = MaxCount ;
              Completed = false;
              Show() ;
              Hide() ;
              System.Threading.Thread TheProgressThread = new System.Threading.Thread(Owner.ThreadStart);
              TheProgressThread.CurrentCulture = Application.CurrentCulture ;
              TheProgressThread.Start();
              TheTimer.Enabled=true ;
              ShowDialog() ;
            }
     
            private void TheTimer_Tick(object sender, EventArgs e)
            {
              TheTimer.Enabled=false ;
              if (Owner.Value<0)
              { 
                DialogResult = DialogResult.OK ; Completed=true ; 
                if (TheException!=null) throw new Exception(TheException.Message+Environment.NewLine+TheException.StackTrace) ;
              } 
              else 
              {
                if (Owner.Value<TheProgressBar.Maximum && TheProgressBar.Value!=Owner.Value+1) 
                {
                  if (TheLabel!=null) TheLabel.Text=(Owner.Value+1)+"/"+TheProgressBar.Maximum ;
                  TheProgressBar.Value=Owner.Value+1;
                }
                TheTimer.Enabled = Owner.Value>=0 ;
              }
            }
     
          }// SxProgressForm
     
        } // SxProgress
    " Le croquemitaine ! Aaaaaah ! Où ça ? " ©Homer Simpson

  2. #2
    Expert confirmé

    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Septembre 2006
    Messages
    3 580
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Chef de projet NTIC
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Septembre 2006
    Messages : 3 580
    Points : 5 195
    Points
    5 195
    Par défaut
    Merci pour ce partage Graffito...

    Perso, je pense qu'il serait "mieux" d'extraire le code qui fait le boulot pour permettre à l'utilisateur de créer via le designer son formulaire

    Mais le code est propre et ça fait le boulot...

    et puis, ça donne les bases pour modifier et configurer le biniou pour s'adapter à son contexte
    The Monz, Toulouse
    Expertise dans la logistique et le développement pour
    plateforme .Net (Windows, Windows CE, Android)

  3. #3
    Expert éminent sénior Avatar de Pol63
    Homme Profil pro
    .NET / SQL SERVER
    Inscrit en
    Avril 2007
    Messages
    14 154
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Puy de Dôme (Auvergne)

    Informations professionnelles :
    Activité : .NET / SQL SERVER

    Informations forums :
    Inscription : Avril 2007
    Messages : 14 154
    Points : 25 072
    Points
    25 072
    Par défaut
    Citation Envoyé par Graffito Voir le message
    Un des problèmes .net est l'affichage de ProgressBar pendant un traitements long.
    ce n'est un problème que pour les débutants
    le backgroundworker s'apprend vite, il y a 3 évènements utiles et on tape son code dedans ...


    sinon je ne lis pas du c# tous les jours, mais je ne comprends pas ton code

    après l'incrémentation d'un progressbar n'est pas forcément linéaire
    parfois on a une dizaine d'étape, chacune avec un temps qui peut être différent, auquel cas on peut passer de 10% à 35% d'un coup

    après la form bloquante, je ne suis pas pour non plus
    on peut très bien avoir un traitement en cours avec un progressbar et continuer de naviguer dans l'appli pour faire autre chose, sans que l'utilisateur perde du temps


    après si tu veux te passer du bgw et utiliser un thread, tu peux faire un progresbar qui accepte qu'on lui donne sa valeur actuelle depuis n'importe quel thread
    Cours complets, tutos et autres FAQ ici : C# - VB.NET

  4. #4
    Expert éminent Avatar de Graffito
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    5 993
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 5 993
    Points : 7 903
    Points
    7 903
    Par défaut
    Pol63: ce n'est un problème que pour les débutants.
    le backgroundworker s'apprend vite, il y a 3 évènements utiles et on tape son code dedans ...
    C'est assez vrai et mon idée n'était pas de remplacer le BackgroundWorker. Je l'utilise entre autres pour des procedures beaucoup plus sophistiquées répartissant la charge sur autant de thread que de "cores" disponibles sur le PC et affichant un bouton de stop ainsi que plusieurs ProgressBar (une d'avancement général, une barre de niveau 1 pour chaque "core" utilisé, chacune étant éventuellement complétée par une barre de niveau 2).

    Pour le code proposé, mon objectif était d'avoir l'interface la plus simple possible, facile pour les débutants et commode pour les autres utilisateurs.
    Cela leur évite de créer l'IHM de progression avec ses libellés ou , par exemple, de se soucier des paramètres de culture qui s'ils ont été modifiés pour le thread principal ne sont pas repris dans les threads fils.
    " Le croquemitaine ! Aaaaaah ! Où ça ? " ©Homer Simpson

  5. #5
    Expert éminent Avatar de Graffito
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    5 993
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 5 993
    Points : 7 903
    Points
    7 903
    Par défaut
    Oups, j'avais oublié de traiter les exceptions. qui, quand elles se produisent dans un thread, terminent le thread mais ne se montrent pas .

    J'ai donc modifié le code pour gérer les exceptions (plus une petite correction sur la "Culture" qui utilisait une procedure perso.
    " Le croquemitaine ! Aaaaaah ! Où ça ? " ©Homer Simpson

  6. #6
    Expert éminent Avatar de Graffito
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    5 993
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 5 993
    Points : 7 903
    Points
    7 903
    Par défaut
    Nouvelle version encore plus simple à utiliser avec possibilité de stopper le process

    L'exemple de code utilisant la classe :
    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
        private void ProgressTest_Click(object sender,EventArgs e)
        {
          // SxProgress.StopImage=MyStopImage ;
          object[] UserObjects = null ; 
          // To pass parameters to procedure, replace this instruction by: 
          // object[] UserObjects = new object[] { Param1, Param2 } ; 
          if (SxProgress.Execute("XXXXX in progress...",300,true,true,ProgressTest_ExecOneInThread,UserObjects))
               MessageBox.Show("Terminated") ;
          else MessageBox.Show("Cancelled by user") ;
        }
     
        private bool ProgressTest_ExecOneInThread(int ItemIndex,object[] UserObjects)
        { // ItemIndex varies from 0 to MaxCount-1 (calling loop is stopped if the function returns false)
          // Get parameters from UserObjects , for example: 
          // int ParamX= (int)serObjects[0] ;
          // string StringToProcess = ((String[])UserObjects[1]) [ItemIndex] ;
          System.Threading.Thread.Sleep(ItemIndex<50?100:1) ; 
          // replace the above instruction by the processing code
          return true ; // no reason to stop process in this example
        }
    */
    La classe utilisée :
    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
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
     
        using System.Runtime.InteropServices;
        ...
        internal class SxProgress
        { // simple interface for of a progress pop-up form
          internal delegate     bool ProcD(int ItemIndex,object[] UserObjects) ;
          internal static Image StopImage = null ;
     
          internal static bool Execute(string Title,int MaxCount,bool ShowCountLabel,bool StopAllowed,ProcD UserProc,Object[] UserObjects)
          { 
            SxProgressForm ProgressForm = new SxProgressForm() ;
            bool Result=ProgressForm.Execute(Title,MaxCount,ShowCountLabel,StopAllowed,UserProc,UserObjects) ;
            ProgressForm.Dispose() ;
            return Result ;
          }
     
          private class SxProgressForm : Form 
          {
            private Exception         TheException   = null ;
            private  Label            TheLabel       = null ;
            private  Button           TheStopButton  = null ;
            private  Label            TheStopLabel   = null ;
            private  ProgressBar      TheProgressBar = null ;
            private  bool             Cancelled      = false;
            private  int              Value          = 0    ; // Progress index from 0 to MaxCount
            private  bool             Ended          = false;
            private  string           Title          = ""   ;
            private  int              MaxCount       = 0    ;
            private  object[]         UserObjects    = null ;
            private  SxProgress.ProcD UserProc       = null ;
     
            private  System.Windows.Forms.Timer   TheTimer  = new System.Windows.Forms.Timer() ;
            private delegate void DoUpdateD(int ProgressValue);
     
            protected override CreateParams CreateParams 
            { // remove SYSMENU 
              get { CreateParams cp = base.CreateParams; cp.ClassStyle = cp.ClassStyle | 0x200 ; return cp; }
            }
     
            internal bool Execute(string vTitle,int vMaxCount,bool ShowLabel,bool StopAllowed,ProcD vUserProc,object[] vUserObjects)
            {
              UserProc                = vUserProc ;
              UserObjects             = vUserObjects ;
              Title                   = vTitle ;
              MaxCount                = vMaxCount ;
              FormBorderStyle         = FormBorderStyle.FixedDialog ;
              MaximizeBox             = false ;
              ShowInTaskbar           = false ;
              StartPosition           = FormStartPosition.CenterParent ;
              ClientSize              = new Size(450,25) ; 
              Text                    = Title ;
              TheTimer.Interval       = 333 ;
              TheTimer.Tick          +=TheTimer_Tick ;
              if (ShowLabel) 
              {
                TheLabel              = new Label() ;
                TheLabel.Text         = "0/"+MaxCount ;
                TheLabel.Parent       = this   ;
                TheLabel.Location     = new Point(Width-100,3) ;
              }
              TheProgressBar         = new ProgressBar() ;
              TheProgressBar.Size    = new Size (Width-(ShowLabel?115:25),10) ;
              TheProgressBar.Location= new Point(10,7) ;
              TheProgressBar.Parent  = this ;
              TheProgressBar.Maximum = MaxCount ;
              if (StopAllowed) 
              {
                TheStopButton                   = new Button() ;
                TheStopButton.Image             = SxProgress.StopImage ;
                TheStopButton.Text              = " Stop process" ;
                TheStopButton.Font              = new Font("Arial",10,FontStyle.Bold) ; 
                TheStopButton.Parent            = this ;
                TheStopButton.Size              = new Size(100+(TheStopButton.Image==null?0:TheStopButton.Image.Width+7),
                                                           Math.Max(25,(TheStopButton.Image==null?0:TheStopButton.Image.Height+7))) ;
                TheStopButton.Location          = new Point(TheProgressBar.Right-TheStopButton.Width,TheProgressBar.Bottom+5) ;
                TheStopButton.ImageAlign        = ContentAlignment.MiddleLeft ;
                TheStopButton.TextImageRelation = TextImageRelation.ImageBeforeText ;
                TheStopButton.Click            += TheStopButton_Click ;
                ClientSize                      = new Size(ClientSize.Width,TheStopButton.Bottom+5) ;
                // Stop label ready for parallel process not yet implemented
                TheStopLabel                    = new Label() ;
                TheStopLabel.Text               = "Stop required. Please wait." ;
                TheStopLabel.Parent             = this   ;
                TheStopLabel.ForeColor          = Color.Firebrick ;
                TheStopLabel.Font               = new Font("Arial",11,FontStyle.Bold) ; 
                TheStopLabel.Visible            = false ;
                TheStopLabel.Location           = new Point(10,1) ;
                TheStopLabel.Width              = 300 ;
              }
              Show() ;
              Hide() ;
              System.Threading.Thread TheProgressThread = new System.Threading.Thread(ThreadStart);
              TheProgressThread.CurrentCulture = Application.CurrentCulture ;
              TheProgressThread.Start();
              TheTimer.Enabled=true ;
              ShowDialog() ;
              return !Cancelled ;
            }
     
            private void ThreadStart()
            { 
              try 
              { 
                bool Continue = true ;
                for (int i=0;i<MaxCount && Continue;i++) { Continue=UserProc(i,UserObjects) ; Value=i ; }
                Ended=true ;
              }
              catch (Exception Ex) { TheException=Ex ; Ended=true ; }
            }
     
            private void TheStopButton_Click(object sender, EventArgs e)
            {
              TheTimer.Enabled = false ;
              Cancelled=MessageBox.Show("Stop required. Confirm ?",Title,MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes ;
              if (Cancelled) Ended = true ;
              TheTimer.Enabled = true ;
            }
     
            private void TheTimer_Tick(object sender, EventArgs e)
            {
              TheTimer.Enabled=false ;
              if (Value<TheProgressBar.Maximum && TheProgressBar.Value!=Value+1) 
              {
                if (TheLabel!=null) TheLabel.Text=(Value+1)+"/"+TheProgressBar.Maximum ;
                TheProgressBar.Value=Value+1;
              }
              if (Ended)
              { 
                Refresh() ;
                DialogResult = DialogResult.OK ; 
                if (Cancelled) { TheProgressBar.Visible=false ; TheStopLabel.Visible = true ; }
                if (TheException!=null) throw new Exception(TheException.Message+Environment.NewLine+TheException.StackTrace) ;
              } 
              else TheTimer.Enabled = true ;
            }
     
          }// SxProgressForm
     
        } // SxProgress
    " Le croquemitaine ! Aaaaaah ! Où ça ? " ©Homer Simpson

  7. #7
    Expert éminent Avatar de Graffito
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    5 993
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 5 993
    Points : 7 903
    Points
    7 903
    Par défaut
    Dernière version permettant une éxecution multi thread (autant de threads que de "cores").
    Toujours aussi simple à intégrer dans une application :
    - une fonction utilisateur (callback) pour traiter un item,
    - un appel pour lancer l'exécution de l'ensemble des items.

    Mêmes paramètres d'appel en multi thread et en mono thread (avec comme dans la version précédente, un tableau d'objet qui sera passé à la fonction utilisateur traitant un item).

    Ajout de 2 fonctions utiles en cas de multithread:
    - GetThreadFirstCall pour savoir si il s'agit du premier appel du thread,
    - GetThreadIndex pour identifier le thread (à utiliser par exemple pour travailler avec des objets différents suivant les threads)
    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
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    // ================================== SxProgress=========================================
        /*
        // SxProgress is simple implementation of a progress pop-up form as shown in following example
        using System.Runtime.InteropServices;
     
        private void ProgressTest_Click(object sender,EventArgs e)
        {
          // SxProgress.StopImage=MyStopImage ;
          object[] UserObjects = null ; 
          // To pass parameters to procedure, replace this instruction by: 
          // object[] UserObjects = new object[] { Param1, Param2 } ; 
          if (SxProgress.Execute("XXXXX in progress...",300,true,true,ProgressTest_ExecInThread,UserObjects))
               MessageBox.Show("Terminated") ;
          else MessageBox.Show("Cancelled by user") ;
        }
     
        private bool ProgressTest_ExecInThread(int ItemIndex,object[] UserObjects)
        {
          System.Threading.Thread.Sleep(5) ;
          LastItemIndex=Math.Max(LastItemIndex,ItemIndex) ;
          System.Threading.Thread.Sleep(1) ;
          // display a SubProgressBar for first 100 items, then hide it
          if (ItemIndex<=100) for (int i=0;i<100;i++) SxProgress.SetSubProgressValue(i==100?-1:i,100,UserObjects) ; ²
          return true ; 
        }
        */
     
        internal class SxProgress
        { // simple interface for of a progress pop-up form
          internal delegate     bool  ProcD(int ItemIndex,object[] UserObjects) ;
          internal static       Image StopImage = null ;
     
          internal static bool Execute     (string Title,int MaxCount,bool ShowCountLabel,bool StopAllowed,ProcD UserProc,Object[] UserObjects)
          { // function calls are executed in a separate thread in order to have a progress HMI.
            SxProgressForm ProgressForm = new SxProgressForm() ;
            bool Result=ProgressForm.Execute(false,Title,MaxCount,ShowCountLabel,StopAllowed,UserProc,UserObjects) ;
            Exception TheException = ProgressForm.TheException;
            ProgressForm.Dispose() ;
            if (TheException!=null) throw new Exception(TheException.Message+Environment.NewLine+TheException.StackTrace) ;
            return Result ;
          }
     
          internal static bool ExecuteMulti(string Title,int MaxCount,bool ShowCountLabel,bool StopAllowed,ProcD UserProc,Object[] UserObjects)
          { // function calls are executed in parallel in different threads with a progress HMI (threads count is equal to cores count) 
            SxProgressForm ProgressForm = new SxProgressForm() ;
            bool Result=ProgressForm.Execute(true,Title,MaxCount,ShowCountLabel,StopAllowed,UserProc,UserObjects) ;
            Exception TheException = ProgressForm.TheException;
            ProgressForm.Dispose() ;
            if (TheException!=null) throw new Exception(TheException.Message+Environment.NewLine+TheException.StackTrace) ;
            return Result ;
          }
     
          internal static bool ExecuteNoThread(string Title,int MaxCount,bool ShowCountLabel,bool StopAllowed,ProcD UserProc,Object[] UserObjects)
          { // Execute function calls in application main thread for debug purpose. No Progress HMI.
            bool FirstCall = true ;
            object[] NewObjects = SxProgressForm.UpdateUserObjects(UserObjects,FirstCall) ;
            bool     Cancelled  = false ;
            for (int i=0;i<MaxCount && !Cancelled;i++) { Cancelled = !UserProc(i,NewObjects) ; FirstCall=false ; }
            return !Cancelled ;
          }
     
          internal static void SetSubProgressValue(int SubValue,int SubMaxCount,object[] UserObjects)
          { // Allows to visualize a sub progress bar inside a function call (sub progress bar is cleared if SubMaxCount<0)
            object UserObject =  UserObjects[UserObjects.Length-1] ;
            if (UserObject!=null)
            {
              if (UserObject is SxProgressForm  ) { ((SxProgressForm )UserObject).SubValue=SubValue ; ((SxProgressForm)UserObject).SubMaxCount=SubMaxCount ; }
              else SxProgressForm.SetSubProgress(UserObject,SubValue,SubMaxCount) ; 
            }
          }
     
          internal static int GetThreadIndex(object[] UserObjects)
          { // Provides the index of the thread in case of multithread execution. 
            // The objective is to associate to each thread different instances of process classes 
            object UserObject =  UserObjects[UserObjects.Length-1] ;
            return UserObject==null || UserObject is SxProgressForm ? 0 : SxProgressForm.GetMultiThreadIndex(UserObjects) ; 
          }
     
          internal static bool GetThreadFirstCall(object[] UserObjects)
          { // Indicates if it is the the first function call of a thread. 
            // Objective : initialize the process classes associated to the thread.
            object UserObject =  UserObjects[UserObjects.Length-1] ;
            return UserObject==null ? (bool)UserObject : UserObject is SxProgressForm ? ((SxProgressForm)UserObject).FirstCall : SxProgressForm.GetMultiThreadFirstCall(UserObjects) ; 
          }
     
     
          private class SxProgressForm : Form 
          {
            private  bool                     OneEnded            = false;
            private  bool                     AllEnded            = false;
            private  bool                     Cancelled           = false;
            internal Exception                TheException        = null ;
            private  bool                     MultiThread         = false;
            private  int                      Value               = 0    ; // Progress index from 0 to MaxCount
            private  string                   Title               = ""   ;
            private  int                      MaxCount            = 0    ;
            private  object[]                 UserObjects         = null ;
            private  SxProgress.ProcD         UserProc            = null ;
            // common controls                                
            private  SxProgressPanel          TheProgressPanel    = null ; 
            private  Button                   TheStopButton       = null ;
            private  Label                    TheStopLabel        = null ;
            internal int                      SubMaxCount         = 0    ; // Count for SubProgressBar
            internal int                      SubValue            = -1   ; // SubProgress index from 0 to SubMaxCount (-1:SubProgressBar not visible)
            private  int                      SubMaxCountPrec     = 0    ; 
            private  int                      SubValuePrec        = -1   ; 
            // multi thread variables     
            private  int                      ProgressThreadIdx   = 0    ;
            private  List<SxProgressThread>   ProgressThreads     = null ;
            private  List<SxProgressPanel>    TheProgressPanels   = new List<SxProgressPanel>();
            private  int                      ProcessorsCount     = Environment.ProcessorCount ;
            private  int                      ThreadsCount        = 1 ; 
            private  List<Point>              Blocks              = new List<Point>() ;                            
            // mono thread variables
            internal bool                     FirstCall           = true ;
     
            private  System.Windows.Forms.Timer   TheTimer  = new System.Windows.Forms.Timer() ;
            private delegate void DoUpdateD(int ProgressValue);
     
            protected override CreateParams CreateParams 
            { // remove SYSMENU 
              get { CreateParams cp = base.CreateParams; cp.ClassStyle = cp.ClassStyle | 0x200 ; return cp; }
            }
     
            internal bool Execute(bool vMultiThread,string vTitle,int vMaxCount,bool ShowLabel,bool StopAllowed,ProcD vUserProc,object[] vUserObjects)
            {
              MultiThread             = vMultiThread ;
              UserProc                = vUserProc ;
              UserObjects             = vUserObjects ;
              Title                   = vTitle ;
              MaxCount                = vMaxCount ;
              FormBorderStyle         = FormBorderStyle.FixedDialog ;
              MaximizeBox             = false ;
              ShowInTaskbar           = false ;
              StartPosition           = FormStartPosition.CenterParent ;
              ClientSize              = new Size(450,25) ; 
              Text                    = Title ;
              // BackColor               = Color.FromArgb(255,255,160);
              BackColor               = Color.Silver;
              TheTimer.Interval       = 333 ;
              TheProgressPanel        = new SxProgressPanel() ;
              int ProgressBar_Right ; 
              TheProgressPanel.Init(ShowLabel,MaxCount,-1,this,out ProgressBar_Right) ;
              HmiInit(ShowLabel,StopAllowed,ProgressBar_Right) ;
              Show() ;
              Hide() ;
              if (MultiThread) 
              {
                BuildBlocks() ;
                ThreadsCount=Math.Min(ProcessorsCount,Blocks.Count) ;
                if (ThreadsCount<=1) MultiThread = false ; 
              }
              // MessageBox.Show("Multithread="+MultiThread+" BlockSize="+(MultiThread?Blocks[0].Y-Blocks[0].X+1:MaxCount)+" BlocksCount="+Blocks.Count) ;
              if (MultiThread) 
              {  // Multiple Threads 
                 TheTimer.Tick          +=TheTimer_TickMulti ;
                 ProgressThreads = new List<SxProgressThread>() ;
                for (int i=0;i<ThreadsCount;i++) 
                {
                  TheProgressPanels.Add(new SxProgressPanel()) ;
                  TheProgressPanels[i].Init(ShowLabel,Blocks[0].Y-Blocks[0].X+1,i,this,out ProgressBar_Right) ;
                  TheProgressPanels[i].BringToFront() ;
                  ProgressThreads.Add(new SxProgressThread(this,TheProgressPanels[i],ProgressThreads.Count)) ;
                }
                Height=Height+ThreadsCount*TheProgressPanels[0].Height ;
                for (int i=0;i<ThreadsCount;i++)
                {
                  System.Threading.Thread TheProgressMultiThread = new System.Threading.Thread(ThreadStartMulti); 
                  TheProgressMultiThread.CurrentCulture = Application.CurrentCulture ;
                  TheProgressMultiThread.Start();
                }
              }
              else
              { // single Thread
                TheTimer.Tick          +=TheTimer_Tick ;
                System.Threading.Thread TheProgressThread = new System.Threading.Thread(ThreadStart);
                TheProgressThread.CurrentCulture = Application.CurrentCulture ;
                TheProgressThread.Start();
              }
              TheTimer.Enabled=true ;
              ShowDialog() ;
              return !Cancelled ;
            }
     
            private void HmiInit(bool ShowLabel,bool StopAllowed,int ProgressBar_Right)
            {
              if (StopAllowed) 
              {
                TheStopButton                   = new Button() ;
                TheStopButton.TextAlign         = ContentAlignment.MiddleLeft ;
                TheStopButton.ImageAlign        = ContentAlignment.MiddleLeft ;
                TheStopButton.TextImageRelation = TextImageRelation.ImageBeforeText ;
                TheStopButton.Image             = SxProgress.StopImage ;
                TheStopButton.Size              = new Size(120+(TheStopButton.Image==null?0:TheStopButton.Image.Width+7),
                                                           Math.Max(25,(TheStopButton.Image==null?0:TheStopButton.Image.Height+7))) ;
                TheStopButton.Location          = new Point(ProgressBar_Right-TheStopButton.Width,TheProgressPanel.Bottom+5) ;
                TheStopButton.BackColor         = Color.LightGray ;
                TheStopButton.Text              = " Stop process" ;
                TheStopButton.Font              = new Font("Arial",10,FontStyle.Bold) ; 
                TheStopButton.Parent            = this ;
                TheStopButton.Click            += TheStopButton_Click ;
                ClientSize                      = new Size(ClientSize.Width,TheStopButton.Bottom+5) ;
                TheStopButton.Anchor            = AnchorStyles.Bottom | AnchorStyles.Left ;
                // Stop label ready for parallel process not yet implemented
                TheStopLabel                    = new Label() ;
                TheStopLabel.Text               = "Process interrupted. Please wait." ;
                TheStopLabel.Parent             = this   ;
                TheStopLabel.ForeColor          = Color.FromArgb(255,72,72) ;
                TheStopLabel.Font               = new Font("Arial",11,FontStyle.Bold) ; 
                TheStopLabel.Visible            = false ;
                TheStopLabel.Location           = new Point(10,3) ;
                TheStopLabel.Width              = 300 ;
              }
            }
     
            internal static object[] UpdateUserObjects(object[] UserObjects,object AddedObject)
            {
     
              object[] Result=new object[UserObjects==null?1:UserObjects.Length+1] ;
              if (UserObjects!=null) for (int i=0;i<UserObjects.Length;i++) Result[i]=UserObjects[i] ;
               Result[Result.Length-1]=AddedObject ;
              return Result ;
            }
     
            private void ThreadStart()
            { 
              try 
              { 
                object[] NewObjects = UpdateUserObjects(UserObjects,this) ;
                for (int i=0;i<MaxCount && !Cancelled;i++) { Cancelled = !UserProc(i,NewObjects) ; Value=i ; FirstCall=false ; }
                OneEnded=true ;
              }
              catch (Exception Ex) { TheException=Ex ; OneEnded=true ; Cancelled=true ; }
            }
     
            private void ThreadStartMulti()
            { 
              int ThreadIndex ;
              SxProgressThread ProgressThread ; 
              lock (ProgressThreads) { ThreadIndex = ProgressThreadIdx++ ; ProgressThread = ProgressThreads[ThreadIndex] ; }
              object[] NewObjects = UpdateUserObjects(UserObjects,ProgressThread) ;
              try 
              { 
                bool Continue = true ;
                Point Block ;
                while (!Cancelled && (Block=GetNextBlock()).Y>0)
                {
                  ProgressThread.BlockValue = 0 ;
                  ProgressThread.BlockCount = Block.Y -Block.X+1 ;
                  for (int i=Block.X;i<=Block.Y && !Cancelled;i++) 
                  { 
                    Continue=UserProc(i,NewObjects) ;
                    if (!Continue) Cancelled=true ;
                    ProgressThread.BlockValue=i-Block.X+1 ; 
                    ProgressThread.Value++ ;
                    ProgressThread.FirstCall = false ;
                  }
                }
                ProgressThread.Ended=true ;
              }
              catch (Exception Ex) { ProgressThread.TheException=Ex ; ProgressThread.Ended=true ; Cancelled=true ; }
            }
     
            private void TheStopButton_Click(object sender, EventArgs e)
            {
              TheTimer.Enabled = false ;
              Cancelled=MessageBox.Show("Stop required. Confirm ?",Title,MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes ;
              if (Cancelled) OneEnded = true ;
              TheTimer.Enabled = true ;
            }
     
            private void TheTimer_Tick(object sender, EventArgs e)
            {
              TheTimer.Enabled=false ;
              TheProgressPanel.SetProgressBarValue(Value,MaxCount) ;
              if (SubValuePrec!=SubValue || SubMaxCountPrec!=SubMaxCount) 
              { 
                TheProgressPanel.SetSubProgressBarValue(SubValue,SubMaxCount) ; 
                SubValuePrec   = SubValue ;
                SubMaxCountPrec= SubMaxCount; 
              }
              if (OneEnded)
              { 
                Refresh() ;
                DialogResult = DialogResult.OK ; 
                if (Cancelled) { TheProgressPanel.SetProgressBarValue(-1,1) ; if (TheStopLabel!=null) TheStopLabel.Visible=true ; }
              } 
              else TheTimer.Enabled = true ;
            }
     
            private void TheTimer_TickMulti(object sender, EventArgs e)
            {
              TheTimer.Enabled=false ;
              int  AllValue=0 ;
              AllEnded=true ;
              for (int i=0;i<ProgressThreads.Count;i++) 
              {
                SxProgressThread ProgressThread = ProgressThreads[i] ;
                AllValue+=ProgressThread.Value ;
                AllEnded=AllEnded && ProgressThread.Ended ;
                if (ProgressThread.Ended && !ProgressThread.HideProcessed) 
                { // Hide Phread progress bar 
                  Height=Height-TheProgressPanels[i].Height ; 
                  TheProgressPanels[i].Visible       = false ; 
                  ProgressThread      .HideProcessed = true  ;
                }
                else 
                { // Update Thread progress bars 
                  TheProgressPanels[i].SetProgressBarValue(ProgressThread.BlockValue,ProgressThread.BlockCount ) ;
                  if (ProgressThread.SubValuePrec!=ProgressThread.SubValue || ProgressThread.SubMaxCountPrec!=ProgressThread.SubMaxCount) 
                  { 
                    TheProgressPanels[i].SetSubProgressBarValue(ProgressThread.SubValue,ProgressThread.SubMaxCount) ; 
                    ProgressThread.SubValuePrec   = ProgressThread.SubValue ;
                    ProgressThread.SubMaxCountPrec= ProgressThread.SubMaxCount; 
                  }
                }
                OneEnded = OneEnded || ProgressThreads[i].Ended ;
                AllEnded = AllEnded && ProgressThreads[i].Ended ;
                if (ProgressThreads[i].TheException!=null) { TheException=ProgressThreads[i].TheException ; Cancelled=true ; }
              }
              TheProgressPanel.SetProgressBarValue(Cancelled?-1:AllValue,MaxCount) ;
              if (Cancelled) { TheStopLabel.Visible=true ; TheStopLabel.BringToFront() ; TheStopButton.Enabled = false; } 
              if (AllEnded)
              { 
                Refresh() ;
                DialogResult = DialogResult.OK ; 
                if (TheException!=null) throw new Exception(TheException.Message+Environment.NewLine+TheException.StackTrace) ;
              } 
              else TheTimer.Enabled = true ;
            }
     
            [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
            static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr w, IntPtr l);
     
            private void BuildBlocks()
            {
              int BlockSize = MaxCount<25  ? 1 : MaxCount<50  ? 2 : MaxCount<125 ? 5 :
                              MaxCount<250 ? 10: MaxCount<500 ? 20: MaxCount<1250? 50:100 ;
              BlockSize = Math.Max(Math.Min((MaxCount+ProcessorsCount-1)/ProcessorsCount,BlockSize),1) ;
              for (int i=0;i<MaxCount;i+=BlockSize) Blocks.Add(new Point(i,Math.Min(i+BlockSize-1,MaxCount-1))) ;
            }
     
            internal Point GetNextBlock()
            {
              // Warning : routine must be thread safe
              Point Result = new Point(0,-1) ;
              lock (Blocks) { if (Blocks.Count>0) { Result=Blocks[0] ; Blocks.RemoveAt(0) ; } }
              return Result;
            }
     
            internal static void SetSubProgress(object ProgressThreadObj,int SubValue,int SubMaxCount) 
            {
              ((SxProgressThread)ProgressThreadObj).SubValue    = SubValue    ;
              ((SxProgressThread)ProgressThreadObj).SubMaxCount = SubMaxCount ;
            }
     
            internal static int GetMultiThreadIndex(object[] UserObjects) 
            {
              return ((SxProgressThread)UserObjects[UserObjects.Length-1]).ThreadIndex ; 
            }
     
            internal static bool GetMultiThreadFirstCall(object[] UserObjects) 
            {
              return ((SxProgressThread)UserObjects[UserObjects.Length-1]).FirstCall ; 
            }
     
            private class SxProgressThread 
            {
              internal  int                    ThreadIndex      = 0    ;
              internal  SxProgressPanel        ProgressPanel    = null ;
              internal  Exception              TheException     = null ;
              internal  SxProgressForm         ProgressForm     = null ;
              internal  bool                   Ended            = false;
              internal  int                    Value            = 0    ; // Progress index from 0 to MaxCount
              internal  int                    BlockValue       = 0    ;
              internal  int                    BlockCount       = 0    ;
              internal  bool                   HideProcessed    = false;
              internal  int                    SubValue         = 0    ;
              internal  int                    SubMaxCount      = 0    ;
              internal  int                    SubMaxCountPrec  = 0    ; 
              internal  int                    SubValuePrec     = -1   ; 
              internal  bool                   FirstCall        = true ;
     
              internal SxProgressThread(SxProgressForm vProgressForm, SxProgressPanel vProgressPanel,int vThreadIndex) 
              { 
                ProgressForm = vProgressForm  ; 
                ProgressPanel= vProgressPanel ;
                ThreadIndex  = vThreadIndex   ;
              }
     
              } // SxProgressThread
     
            private class SxProgressPanel : Panel 
            {
              private  Label           TheLabel            = null ;
              private  ProgressBar     TheProgressBar      = null ;
              private  ProgressBar     TheSubProgressBar   = null ;
              private  int             MaxCount            = 0    ;
              private  int             ThreadIndex         = 0    ;
              private  bool            ShowLabel           = false;
              private  bool            SubProgressVisible  = false;
     
              internal void Init(bool vShowLabel,int vMaxCount,int vThreadIndex,Control ParentControl,out int ProgressBar_Right)
              { 
                ShowLabel   = vShowLabel ;
                MaxCount    = vMaxCount  ;
                ThreadIndex = vThreadIndex ;
                Dock        = DockStyle.Top ;
                Parent      = ParentControl ;
                Height      = 29 ;
                if (ShowLabel) 
                {
                  TheLabel                  = new Label() ;
                  TheLabel.Text             = ThreadIndex<0 ? "0/"+MaxCount : "Thread "+(ThreadIndex<24?""+(char)((int)'A'+ThreadIndex):'Y'+(ThreadIndex-24).ToString()) ;
                  TheLabel.Parent           = this   ;
                  TheLabel.Location         = new Point(Width-100,7) ;
                  TheLabel.ForeColor        = ThreadIndex<0 ? Color.Black : Color.Gray ;
                }                         
                TheProgressBar              = new ProgressBar() ;
                TheProgressBar.Maximum      = MaxCount ;
                TheProgressBar   .Size      = new Size (Width-(ShowLabel?115:25),12) ;
                TheProgressBar   .Location  = new Point(10,7) ;
                TheProgressBar   .Parent    = this ;
                ProgressBar_Right           = TheProgressBar.Right ;
                TheSubProgressBar           = new ProgressBar() ;
                TheSubProgressBar.Size      = new Size (Width-(ShowLabel?115:25),6) ;
                TheSubProgressBar.ForeColor = Color.Firebrick ;
                TheSubProgressBar.Location  = new Point(10,22) ;
                TheSubProgressBar.Parent    = this ;
                TheSubProgressBar.Visible   = false ;
                // 1 = normal (green); 2 = error (red); 3 = warning (yellow).
                SendMessage(TheProgressBar   .Handle, 1040, (IntPtr)(ThreadIndex<0?1:3), IntPtr.Zero);
                SendMessage(TheSubProgressBar.Handle, 1040, (IntPtr) 2                 , IntPtr.Zero);
              }
     
              internal void SetProgressBarValue(int Value,int MaxCount) 
              {
                if (MaxCount!=TheProgressBar.Maximum && MaxCount>=0) TheSubProgressBar.Maximum=MaxCount ;  
                if (Value<MaxCount && TheProgressBar.Value!=Value) 
                {
                  if (TheLabel!=null && ThreadIndex<0) TheLabel.Text=(Value+0)+"/"+TheProgressBar.Maximum ;
                  TheProgressBar.Value = Math.Max(0,Value);
                }
                if (Value<0) 
                { 
                  TheProgressBar.Visible=false ; 
                  if (TheLabel!=null) TheLabel.Visible=false ; 
                }
              } 
     
              internal void SetSubProgressBarValue(int SubValue,int SubMaxCount) 
              {
                if (SubValue<0) TheSubProgressBar.Visible=SubProgressVisible=false ; 
                else 
                {
                  if (SubMaxCount!=TheSubProgressBar.Maximum && SubMaxCount>=0) TheSubProgressBar.Maximum=SubMaxCount ;  
                  if (SubValue<TheSubProgressBar.Maximum && TheSubProgressBar.Value!=SubValue+1) TheSubProgressBar.Value=SubValue+1;
                  if (!SubProgressVisible) TheSubProgressBar.Visible=SubProgressVisible=true ; 
                }
              } 
     
            } // SxProgressPanel
     
          }// SxProgressForm
     
     
        } // SxProgress
    " Le croquemitaine ! Aaaaaah ! Où ça ? " ©Homer Simpson

  8. #8
    Expert éminent Avatar de Graffito
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    5 993
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 5 993
    Points : 7 903
    Points
    7 903
    Par défaut
    Une bug sur cette ligne :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    while (!Cancelled && (Block=GetNextBlock()).Y>0)
    à rempacer par:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    while (!Cancelled && (Block=GetNextBlock()).Y>=0)
    Je ne comprends pas pourquoi, dans certains cas, il n'est plus possible de modifier ses propres messages ???
    " Le croquemitaine ! Aaaaaah ! Où ça ? " ©Homer Simpson

  9. #9
    Expert confirmé

    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Septembre 2006
    Messages
    3 580
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Chef de projet NTIC
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Septembre 2006
    Messages : 3 580
    Points : 5 195
    Points
    5 195
    Par défaut
    Super

    Pour la modif, je lance une hypothèse ==> Diff entre date du message et date de la modification trop important ?
    The Monz, Toulouse
    Expertise dans la logistique et le développement pour
    plateforme .Net (Windows, Windows CE, Android)

Discussions similaires

  1. Votre avis sur une utilisation des templates
    Par the_angel dans le forum Langage
    Réponses: 2
    Dernier message: 09/08/2012, 10h36
  2. diagramme cas d'utilisation votre avis
    Par carieliococs dans le forum Cas d'utilisation
    Réponses: 9
    Dernier message: 03/02/2009, 17h46
  3. Mutex dans une page ASP.Net : votre avis
    Par Yannick Biet dans le forum ASP.NET
    Réponses: 2
    Dernier message: 20/11/2007, 18h49
  4. Votre avis sur une proposition de job
    Par plex dans le forum Emploi
    Réponses: 7
    Dernier message: 18/01/2007, 10h11
  5. [C#] Utilisation d'une ProgressBar pour un téléchargement
    Par snoof dans le forum Windows Forms
    Réponses: 10
    Dernier message: 04/10/2004, 19h37

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo