File tree Expand file tree Collapse file tree
Action/CorpusExplorer.Sdk.Action Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,20 +15,20 @@ public class MetaDocumentAction : IAction
1515
1616 public void Execute ( Selection selection , string [ ] args , AbstractTableWriter writer )
1717 {
18- var columns = selection . GetDocumentMetadataPrototypeOnlyPropertiesAndTypes ( ) ;
19- if ( columns . ContainsKey ( Resources . Guid ) )
18+ var columns = new HashSet < string > ( selection . GetDocumentMetadataPrototypeOnlyProperties ( ) ) ;
19+ if ( columns . Contains ( Resources . Guid ) )
2020 columns . Remove ( Resources . Guid ) ;
2121
2222 var dt = new DataTable ( ) ;
2323 dt . Columns . Add ( Resources . Guid , typeof ( string ) ) ;
2424 foreach ( var column in columns )
25- dt . Columns . Add ( column . Key , column . Value ) ;
25+ dt . Columns . Add ( column , typeof ( string ) ) ;
2626
2727 dt . BeginLoadData ( ) ;
2828 foreach ( var pair in selection . DocumentMetadata )
2929 {
3030 var items = new List < object > { pair . Key . ToString ( "N" ) } ;
31- items . AddRange ( columns . Select ( column => pair . Value . ContainsKey ( column . Key ) ? pair . Value [ column . Key ] : null ) ) ;
31+ items . AddRange ( columns . Select ( x => pair . Value . TryGetValue ( x , out var v ) ? v ? . ToString ( ) : null ) ) ;
3232 dt . Rows . Add ( items . ToArray ( ) ) ;
3333 }
3434
You can’t perform that action at this time.
0 commit comments