@@ -580,6 +580,29 @@ private void UpdatesLinkLabelLinkClicked(Object sender, LinkLabelLinkClickedEven
580
580
}
581
581
}
582
582
583
+ /// <summary>
584
+ /// On bundle link click, selects all bundled items.
585
+ /// </summary>
586
+ private void BundleLinkLabelLinkClicked ( Object sender , LinkLabelLinkClickedEventArgs e )
587
+ {
588
+ try
589
+ {
590
+ if ( this . isLoading ) return ;
591
+ this . listView . BeginUpdate ( ) ;
592
+ foreach ( ListViewItem item in this . listView . Items )
593
+ {
594
+ DepEntry entry = item . Tag as DepEntry ;
595
+ if ( Array . IndexOf ( entry . Bundles , e . Link . LinkData . ToString ( ) ) != - 1 ) item . Checked = true ;
596
+ else item . Checked = false ;
597
+ }
598
+ this . listView . EndUpdate ( ) ;
599
+ }
600
+ catch ( Exception ex )
601
+ {
602
+ DialogHelper . ShowError ( ex . ToString ( ) ) ;
603
+ }
604
+ }
605
+
583
606
/// <summary>
584
607
/// Disables the item checking when downloading.
585
608
/// </summary>
@@ -671,6 +694,7 @@ private void PopulateListView()
671
694
if ( this . appGroups . Count > 1 ) this . listView . ShowGroups = true ;
672
695
else this . listView . ShowGroups = false ;
673
696
this . UpdateEntryStates ( ) ;
697
+ this . GenerateBundleLinks ( ) ;
674
698
this . listView . EndUpdate ( ) ;
675
699
}
676
700
catch ( Exception ex )
@@ -679,6 +703,32 @@ private void PopulateListView()
679
703
}
680
704
}
681
705
706
+ /// <summary>
707
+ /// Generates the bundle selection links.
708
+ /// </summary>
709
+ private void GenerateBundleLinks ( )
710
+ {
711
+ List < String > bundleLinks = new List < String > ( ) ;
712
+ foreach ( DepEntry entry in this . depEntries )
713
+ {
714
+ foreach ( String bundle in entry . Bundles )
715
+ {
716
+ if ( ! bundleLinks . Contains ( bundle ) )
717
+ {
718
+ LinkLabel linkLabel = new LinkLabel ( ) ;
719
+ linkLabel . Anchor = ( ( System . Windows . Forms . AnchorStyles ) ( ( System . Windows . Forms . AnchorStyles . Bottom | System . Windows . Forms . AnchorStyles . Left ) ) ) ;
720
+ linkLabel . Location = new Point ( this . updateLinkLabel . Bounds . Right + 5 , this . updateLinkLabel . Location . Y ) ;
721
+ linkLabel . LinkClicked += new LinkLabelLinkClickedEventHandler ( this . BundleLinkLabelLinkClicked ) ;
722
+ linkLabel . Links [ 0 ] . LinkData = bundle ;
723
+ linkLabel . AutoSize = true ;
724
+ linkLabel . Text = bundle ;
725
+ bundleLinks . Add ( bundle ) ;
726
+ this . Controls . Add ( linkLabel ) ;
727
+ }
728
+ }
729
+ }
730
+ }
731
+
682
732
/// <summary>
683
733
/// Adds the entry into a new or existing group.
684
734
/// </summary>
@@ -1388,6 +1438,9 @@ public class DepEntry
1388
1438
[ XmlArrayItem ( "Url" ) ]
1389
1439
public String [ ] Urls = new String [ 0 ] ;
1390
1440
1441
+ [ XmlArrayItem ( "Bundle" ) ]
1442
+ public String [ ] Bundles = new String [ 0 ] ;
1443
+
1391
1444
[ XmlIgnore ]
1392
1445
public Dictionary < String , String > Temps ;
1393
1446
@@ -1396,14 +1449,15 @@ public DepEntry()
1396
1449
this . Type = MainForm . TYPE_ARCHIVE ;
1397
1450
this . Temps = new Dictionary < String , String > ( ) ;
1398
1451
}
1399
- public DepEntry ( String id , String name , String desc , String group , String version , String build , String type , String info , String cmd , String [ ] urls )
1452
+ public DepEntry ( String id , String name , String desc , String group , String version , String build , String type , String info , String cmd , String [ ] urls , String [ ] bundles )
1400
1453
{
1401
1454
this . Id = id ;
1402
1455
this . Name = name ;
1403
1456
this . Desc = desc ;
1404
1457
this . Group = group ;
1405
1458
this . Build = build ;
1406
1459
this . Version = version ;
1460
+ this . Bundles = bundles ;
1407
1461
this . Temps = new Dictionary < String , String > ( ) ;
1408
1462
if ( ! String . IsNullOrEmpty ( type ) ) this . Type = type ;
1409
1463
else this . Type = MainForm . TYPE_ARCHIVE ;
0 commit comments