@@ -115,53 +115,85 @@ private IEnumerable<ConsumerDefinition> BuildColumns()
115115 foreach (
116116 var child in Enumerable
117117 . Range ( 0 , a )
118- . Select ( x => new ConsumerDefinition
118+ . Select ( x =>
119119 {
120- Content = x . ToString ( ) ,
121- Consumer = o => o is int idx ? idx + ( 2 * x ) : "Oops" ,
122- Formatter = o => $ "Res: { o } ",
123- Qualify = o =>
124- int . TryParse ( o . ToString ( ) , out var i )
125- ? i switch
126- {
127- 4 => Qualification . Remark ,
128- 6 => Qualification . Warning ,
129- 9 => Qualification . Error ,
130- 10 => Qualification . ReadOnly ,
131- 17 => Qualification . Custom ,
132- 18 => Qualification . Custom ,
133- _ => Qualification . Normal
134- }
135- : Qualification . Normal ,
136- Colorize = o =>
137- int . TryParse ( o . ToString ( ) , out var i )
138- ? i switch
139- {
140- 17
141- => (
142- new ThemeColor ( 150 , 100 , 120 , 0 ) ,
143- new ThemeColor ( 255 , 0 , 0 , 0 )
144- ) ,
145- 18
146- => (
147- new ThemeColor ( 150 , 0 , 100 , 120 ) ,
148- new ThemeColor ( 255 , 255 , 0 , 0 )
149- ) ,
150- _
151- => (
152- new ThemeColor ( 0 , 0 , 0 , 0 ) ,
153- new ThemeColor ( 0 , 255 , 0 , 0 )
154- )
155- }
156- : (
157- new ThemeColor ( 0 , 0 , 0 , 0 ) ,
158- new ThemeColor ( 0 , 0 , 0 , 0 )
159- ) ,
160- Editor = ( p , c , s ) =>
120+ var cdef = new ConsumerDefinition
121+ {
122+ Content = x . ToString ( ) ,
123+ Consumer = o => o is int idx ? idx + ( 2 * x ) : "Oops" ,
124+ Formatter = o => $ "Res: { o } ",
125+ Qualify = o =>
126+ int . TryParse ( o . ToString ( ) , out var i )
127+ ? i switch
128+ {
129+ 4 => Qualification . Remark ,
130+ 6 => Qualification . Warning ,
131+ 9 => Qualification . Error ,
132+ 10 => Qualification . ReadOnly ,
133+ 17 => Qualification . Custom ,
134+ 18 => Qualification . Custom ,
135+ _ => Qualification . Normal
136+ }
137+ : Qualification . Normal ,
138+ Colorize = o =>
139+ int . TryParse ( o . ToString ( ) , out var i )
140+ ? i switch
141+ {
142+ 17
143+ => (
144+ new ThemeColor ( 150 , 100 , 120 , 0 ) ,
145+ new ThemeColor ( 255 , 0 , 0 , 0 )
146+ ) ,
147+ 18
148+ => (
149+ new ThemeColor ( 150 , 0 , 100 , 120 ) ,
150+ new ThemeColor ( 255 , 255 , 0 , 0 )
151+ ) ,
152+ _
153+ => (
154+ new ThemeColor ( 0 , 0 , 0 , 0 ) ,
155+ new ThemeColor ( 0 , 255 , 0 , 0 )
156+ )
157+ }
158+ : (
159+ new ThemeColor ( 0 , 0 , 0 , 0 ) ,
160+ new ThemeColor ( 0 , 0 , 0 , 0 )
161+ ) ,
162+ Editor = ( p , c , s ) =>
163+ {
164+ this . Log ( ) . Debug ( $ "{ p } _ { c } _ { s } ") ;
165+ return ! string . IsNullOrWhiteSpace ( s ) ;
166+ }
167+ } ;
168+
169+ switch ( x )
161170 {
162- this . Log ( ) . Debug ( $ "{ p } _ { c } _ { s } ") ;
163- return ! string . IsNullOrWhiteSpace ( s ) ;
171+ case 3 :
172+ cdef . RightDecor = ( _ , o ) =>
173+ o switch
174+ {
175+ int i
176+ => i % 2 == 0
177+ ? "Resources/comment.svg"
178+ : string . Empty ,
179+ _ => string . Empty ,
180+ } ;
181+ cdef . Editor = ( p , c , s ) =>
182+ {
183+ this . Log ( ) . Debug ( $ "{ p } _ { c } _ { s } ") ;
184+ return ! string . IsNullOrWhiteSpace ( s ) ;
185+ } ;
186+ break ;
187+ case 5 :
188+ cdef . LeftDecor = ( _ , o ) => "Resources/comment.svg" ;
189+ break ;
190+ case 6 :
191+ cdef . RightDecor = ( _ , o ) => "Resources/comment.svg" ;
192+ cdef . LeftDecor = ( _ , o ) => "Resources/edit.svg" ;
193+ break ;
164194 }
195+
196+ return cdef ;
165197 } )
166198 )
167199 {
0 commit comments