Skip to content

Commit 90b2767

Browse files
ThunderFrameretailcoder
authored andcommitted
Adds Clipboard formats, improves project/component displaynames (#1589)
* Adds RTF and XML Spreadsheet data formats Still need to RTF-escape content values Temporary Fix in InspectionResultBase, for instances of unsaved filename boom. * XML Spreadsheet builds from XMLWriter instead of StringBuilder Adds ColumnInfos helper classes, for specifying and formatting column titles, not yet fully implemented. * Improves Clipboard export formatter Adds a DocumentName property to QualifiedModuleName, adds DocumentName to column output. * adds notes and placeholder for Outllook's Application.Run alternative not implemented - need to write to events in the ThisOutlookSession before this will work. * Adds columns to inspection results, and adds column titles changes to Column alignment, font weights, colspans * improvements to InspectionResults Clipboard Refines DocumentName of QualifiedModule * Adds DisplayName and Title for Projects and Components ProjectDisplayName eg. `Book1` ProjectTitle eg. `VBA Project (Book1) ComponentDisplayName eg. `Home` ComponentTitle eg. `shtHome (Home)` * corrects ComponentTitle behaviour still needs testing across multiple hosts. * removes temporary comments * adds DisplayName to extra QualifiedModuleName constructor was out of Sync with Next, so had to add these fields to the newly discovered ctor.
1 parent 5cc554d commit 90b2767

File tree

6 files changed

+502
-28
lines changed

6 files changed

+502
-28
lines changed

RetailCoder.VBE/Common/ClipboardWriter.cs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
using System.Windows;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using System.Windows;
28

39
namespace Rubberduck.Common
410
{
511
public interface IClipboardWriter
612
{
713
void Write(string text);
8-
void AppendData(string format, object data);
14+
void AppendString(string formatName, string data);
15+
void AppendStream(string formatName, MemoryStream stream);
916
void Flush();
1017
}
1118

@@ -15,17 +22,26 @@ public class ClipboardWriter : IClipboardWriter
1522

1623
public void Write(string text)
1724
{
18-
this.AppendData(DataFormats.UnicodeText, text);
25+
this.AppendString(DataFormats.UnicodeText, text);
1926
this.Flush();
2027
}
2128

22-
public void AppendData(string format, object data)
29+
public void AppendString(string formatName, string data)
2330
{
2431
if (_data == null)
2532
{
2633
_data = new DataObject();
2734
}
28-
_data.SetData(format, data);
35+
_data.SetData(formatName, data);
36+
}
37+
38+
public void AppendStream(string formatName, MemoryStream stream)
39+
{
40+
if (_data == null)
41+
{
42+
_data = new DataObject();
43+
}
44+
_data.SetData(formatName, stream);
2945
}
3046

3147
public void Flush()

0 commit comments

Comments
 (0)