File tree Expand file tree Collapse file tree 2 files changed +6
-17
lines changed
Expand file tree Collapse file tree 2 files changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,9 @@ public static ColorSet Shared
4545 {
4646 if ( SharedInstance == null )
4747 {
48- if ( ! ( Assembly . GetEntryAssembly ( ) is Assembly assembly ) )
48+ Assembly assembly = Assembly . GetEntryAssembly ( ) ?? Assembly . GetExecutingAssembly ( ) ;
49+
50+ if ( assembly == null )
4951 {
5052 throw new ApplicationException ( "Cannot get entry assembly" ) ;
5153 }
@@ -65,14 +67,7 @@ public static ColorSet Shared
6567 {
6668 System . Resources . ResourceManager manager = new System . Resources . ResourceManager ( name . Name + ".Properties.Resources" , assembly ) ;
6769
68- if ( ! ( manager . GetObject ( "Colors" ) is byte [ ] data ) || data . Length == 0 )
69- {
70- SharedInstance = new ColorSet ( ) ;
71- }
72- else
73- {
74- SharedInstance = new ColorSet ( new Data ( data ) ) ;
75- }
70+ SharedInstance = ! ( manager . GetObject ( "Colors" ) is byte [ ] data ) || data . Length == 0 ? new ColorSet ( ) : new ColorSet ( new Data ( data ) ) ;
7671 }
7772 }
7873
@@ -166,10 +161,7 @@ public ColorSet( Data data )
166161
167162 public ColorPair this [ string key ]
168163 {
169- get
170- {
171- return this . ColorNamed ( key ) ;
172- }
164+ get => this . ColorNamed ( key ) ;
173165 }
174166
175167 public ColorPair ColorNamed ( string name )
Original file line number Diff line number Diff line change @@ -34,10 +34,7 @@ public partial class Data
3434 {
3535 public ulong Count
3636 {
37- get
38- {
39- return ( ulong ) ( this . Bytes . Count ) ;
40- }
37+ get => ( ulong ) ( this . Bytes . Count ) ;
4138 }
4239
4340 private List < byte > Bytes
You can’t perform that action at this time.
0 commit comments