Skip to content

Commit

Permalink
Temporary commit to continue working
Browse files Browse the repository at this point in the history
  • Loading branch information
IvenBach committed Aug 25, 2019
1 parent c0d04c9 commit 1f39871
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
24 changes: 21 additions & 3 deletions Rubberduck.Core/Common/ClipboardWriter.cs
Expand Up @@ -17,7 +17,7 @@ public interface IClipboardWriter
void Flush();
//void AppendInfo(ClipboardFormat xmlSpreadsheetFormat, ClipboardFormat rtfFormat, ClipboardFormat htmlFormat, ClipboardFormat csvFormat, ClipboardFormat unicodeTextFormat);
void AppendInfo(ColumnInfo[] columnInfos,
IEnumerable<object> results,
object results,
string titleFormat,
bool includeXmlSpreadsheetformat = false,
bool includeRtfFormat = false,
Expand Down Expand Up @@ -88,15 +88,33 @@ public void Flush()
//public void AppendInfo(ClipboardFormat xmlSpreadsheetFormat, ClipboardFormat rtfFormat, ClipboardFormat htmlFormat, ClipboardFormat csvFormat, ClipboardFormat unicodeTextFormat)
//TODO: bitFlag
public void AppendInfo(ColumnInfo[] columnInfos,
IEnumerable<object> results,
object results,
string titleFormat,
bool includeXmlSpreadsheetformat = false,
bool includeRtfFormat = false,
bool includeHtmlFormat = false,
bool includeCsvFormat = false,
bool includeUnicodeFormat = false)
{
var resultsAsArray = results.Select(result => result.ToArray()).ToArray();
//var resultsAsArray = results.Select(result => result.ToArray()).ToArray();
object[][] resultsAsArray;
if (results is IEnumerable<Rubberduck.Parsing.Symbols.Declaration> declarations)
{
resultsAsArray = declarations.Select(declaration => declaration.ToArray()).ToArray();
}
else if (results is System.Collections.ObjectModel.ObservableCollection<Rubberduck.Parsing.Inspections.Abstract.IInspectionResult> inspectionResults)
{
resultsAsArray = inspectionResults.OfType<IExportable>().Select(result => result.ToArray()).ToArray();
}
else if (results is System.Collections.ObjectModel.ObservableCollection<Rubberduck.UI.UnitTesting.ViewModels.TestMethodViewModel> testMethodViewModels)
{
resultsAsArray = testMethodViewModels.Select(test => test.ToArray()).ToArray();
}
else
{
resultsAsArray = null;
}

var title = string.Format(titleFormat, DateTime.Now.ToString(CultureInfo.InvariantCulture));

if (includeXmlSpreadsheetformat)
Expand Down
3 changes: 2 additions & 1 deletion Rubberduck.Core/UI/Inspections/InspectionResultsViewModel.cs
Expand Up @@ -659,7 +659,8 @@ private void ExecuteCopyResultsCommand(object parameter)
? Resources.RubberduckUI.CodeInspections_NumberOfIssuesFound_Singular
: Resources.RubberduckUI.CodeInspections_NumberOfIssuesFound_Plural;

_clipboard.AppendInfo(ColumnInformation, Results as IEnumerable<object>, resource, true, true, true, true, true);
var resultsArgument = Results as IEnumerable<object>;
_clipboard.AppendInfo(ColumnInformation, resultsArgument, resource, true, true, true, true, true);

_clipboard.Flush();
}
Expand Down

0 comments on commit 1f39871

Please sign in to comment.