Skip to content
Permalink
Browse files

Temporary commit to continue working

  • Loading branch information
IvenBach committed Aug 25, 2019
1 parent c0d04c9 commit 1f39871d071d371a6818783d4a3e54c91e08d8b3
@@ -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,
@@ -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)
@@ -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();
}

0 comments on commit 1f39871

Please sign in to comment.
You can’t perform that action at this time.