@@ -17,7 +17,7 @@ public interface IClipboardWriter
1717 void Flush ( ) ;
1818 //void AppendInfo(ClipboardFormat xmlSpreadsheetFormat, ClipboardFormat rtfFormat, ClipboardFormat htmlFormat, ClipboardFormat csvFormat, ClipboardFormat unicodeTextFormat);
1919 void AppendInfo ( ColumnInfo [ ] columnInfos ,
20- IEnumerable < object > results ,
20+ object results ,
2121 string titleFormat ,
2222 bool includeXmlSpreadsheetformat = false ,
2323 bool includeRtfFormat = false ,
@@ -88,15 +88,33 @@ public void Flush()
8888 //public void AppendInfo(ClipboardFormat xmlSpreadsheetFormat, ClipboardFormat rtfFormat, ClipboardFormat htmlFormat, ClipboardFormat csvFormat, ClipboardFormat unicodeTextFormat)
8989 //TODO: bitFlag
9090 public void AppendInfo ( ColumnInfo [ ] columnInfos ,
91- IEnumerable < object > results ,
91+ object results ,
9292 string titleFormat ,
9393 bool includeXmlSpreadsheetformat = false ,
9494 bool includeRtfFormat = false ,
9595 bool includeHtmlFormat = false ,
9696 bool includeCsvFormat = false ,
9797 bool includeUnicodeFormat = false )
9898 {
99- var resultsAsArray = results . Select ( result => result . ToArray ( ) ) . ToArray ( ) ;
99+ //var resultsAsArray = results.Select(result => result.ToArray()).ToArray();
100+ object [ ] [ ] resultsAsArray ;
101+ if ( results is IEnumerable < Rubberduck . Parsing . Symbols . Declaration > declarations )
102+ {
103+ resultsAsArray = declarations . Select ( declaration => declaration . ToArray ( ) ) . ToArray ( ) ;
104+ }
105+ else if ( results is System . Collections . ObjectModel . ObservableCollection < Rubberduck . Parsing . Inspections . Abstract . IInspectionResult > inspectionResults )
106+ {
107+ resultsAsArray = inspectionResults . OfType < IExportable > ( ) . Select ( result => result . ToArray ( ) ) . ToArray ( ) ;
108+ }
109+ else if ( results is System . Collections . ObjectModel . ObservableCollection < Rubberduck . UI . UnitTesting . ViewModels . TestMethodViewModel > testMethodViewModels )
110+ {
111+ resultsAsArray = testMethodViewModels . Select ( test => test . ToArray ( ) ) . ToArray ( ) ;
112+ }
113+ else
114+ {
115+ resultsAsArray = null ;
116+ }
117+
100118 var title = string . Format ( titleFormat , DateTime . Now . ToString ( CultureInfo . InvariantCulture ) ) ;
101119
102120 if ( includeXmlSpreadsheetformat )
0 commit comments