44/* information. */
55/******************************************************************************/
66using System ;
7- using System . Collections . Generic ;
87using System . ComponentModel ;
98using System . Drawing ;
109using System . Drawing . Drawing2D ;
11- using System . Linq ;
1210using System . Windows . Forms ;
1311using Polycode . NostalgicPlayer . Controls . Components ;
1412using Polycode . NostalgicPlayer . Controls . Containers ;
13+ using Polycode . NostalgicPlayer . Controls . Designer ;
1514using Polycode . NostalgicPlayer . Controls . Theme ;
1615using Polycode . NostalgicPlayer . Controls . Theme . Interfaces ;
1716
@@ -568,8 +567,7 @@ private void DrawDropDownItemText(Graphics g, Rectangle rect, DropDownStateColor
568567 string text = GetItemText ( Items [ itemIndex ] ) ;
569568
570569 TextFormatFlags flags = TextFormatFlags . Left | TextFormatFlags . VerticalCenter | TextFormatFlags . SingleLine | TextFormatFlags . EndEllipsis ;
571- Rectangle drawRect = new Rectangle ( rect . X , rect . Y , rect . Width , rect . Height ) ;
572- TextRenderer . DrawText ( g , text , font , drawRect , stateColors . TextColor , flags ) ;
570+ TextRenderer . DrawText ( g , text , font , rect , stateColors . TextColor , flags ) ;
573571 }
574572 #endregion
575573
@@ -591,9 +589,9 @@ static NostalgicComboBox()
591589 /// </summary>
592590 private sealed class NostalgicComboBoxTypeDescriptionProvider : TypeDescriptionProvider
593591 {
594- private static readonly TypeDescriptionProvider Parent = TypeDescriptor . GetProvider ( typeof ( ComboBox ) ) ;
592+ private static readonly TypeDescriptionProvider parent = TypeDescriptor . GetProvider ( typeof ( ComboBox ) ) ;
595593
596- private static readonly string [ ] PropertiesToHide =
594+ private static readonly string [ ] propertiesToHide =
597595 [
598596 nameof ( FlatStyle ) ,
599597 nameof ( BackColor ) ,
@@ -611,7 +609,7 @@ private sealed class NostalgicComboBoxTypeDescriptionProvider : TypeDescriptionP
611609 /// Constructor
612610 /// </summary>
613611 /********************************************************************/
614- public NostalgicComboBoxTypeDescriptionProvider ( ) : base ( Parent )
612+ public NostalgicComboBoxTypeDescriptionProvider ( ) : base ( parent )
615613 {
616614 }
617615
@@ -624,57 +622,7 @@ public NostalgicComboBoxTypeDescriptionProvider() : base(Parent)
624622 /********************************************************************/
625623 public override ICustomTypeDescriptor GetTypeDescriptor ( Type objectType , object instance )
626624 {
627- return new HidingTypeDescriptor ( base . GetTypeDescriptor ( objectType , instance ) ) ;
628- }
629-
630- /// <summary>
631- ///
632- /// </summary>
633- private sealed class HidingTypeDescriptor : CustomTypeDescriptor
634- {
635- /********************************************************************/
636- /// <summary>
637- /// Constructor
638- /// </summary>
639- /********************************************************************/
640- public HidingTypeDescriptor ( ICustomTypeDescriptor parent ) : base ( parent )
641- {
642- }
643-
644-
645-
646- /********************************************************************/
647- /// <summary>
648- ///
649- /// </summary>
650- /********************************************************************/
651- public override PropertyDescriptorCollection GetProperties ( )
652- {
653- return GetProperties ( null ) ;
654- }
655-
656-
657-
658- /********************************************************************/
659- /// <summary>
660- ///
661- /// </summary>
662- /********************************************************************/
663- public override PropertyDescriptorCollection GetProperties ( Attribute [ ] attributes )
664- {
665- PropertyDescriptorCollection props = base . GetProperties ( attributes ) ;
666- List < PropertyDescriptor > kept = new List < PropertyDescriptor > ( props . Count ) ;
667-
668- foreach ( PropertyDescriptor pd in props )
669- {
670- if ( PropertiesToHide . Contains ( pd . Name ) )
671- continue ;
672-
673- kept . Add ( pd ) ;
674- }
675-
676- return new PropertyDescriptorCollection ( kept . ToArray ( ) , true ) ;
677- }
625+ return new HidingTypeDescriptor ( base . GetTypeDescriptor ( objectType , instance ) , propertiesToHide ) ;
678626 }
679627 }
680628 #endregion
0 commit comments