Smart Paster plugin for Visual Studio
Shame on me for not posting about the Smart Paster 1.1 plugin before.
In Windows Forms applications I sometimes have to show long messages explaining why an operation failed or to provide additional information. The text is usually provided by the customer or a technical writer. Cutting and pasting it directly is normally not an option as:
- the string is impossible to read in the editor or on paper when it is too long
- there may be formatting characters which have to be escaped
XML and other text formats with quotes in them are even worse.
Unless you use Spart Paster that is;
The Smart Paster inserts the contents in a properly formatted String builder according to the configuration options:
Building XML the brutal way with string (i.e. not using XmlWriter) becomes a piece of cake. This source string in the clipboard:
<root>
<node attribA="a" attribB="b"/>
<path ="c:\temp\test.txt"/>
</root>
Automagically becomes this if you paste it as a StringBuilder called builder:
StringBuilder builder = new StringBuilder(81);
builder.AppendFormat(@"{0}", Environment.NewLine); {0}", Environment.NewLine);
builder.AppendFormat(@"{0}{1}", ControlChars.Tab, Environment.NewLine);
builder.AppendFormat(@"{0}{1}", ControlChars.Tab, Environment.NewLine);
builder.AppendFormat(@"
All quotes and strange characters taken care of. What more can you ask for?
Your post truly opened my eyes! I feel lot better informed now, even though I hadn't thought of some of the things you brought up. Fantastic work! This is because you no longer have to be concerned about the time you lost on lessons that you missed because of your poor routine. Employ someone to attend my online course. We are offering a 40% off first order, which will help you create 100% authentic online class help and flawless content that will make your presentation stand out with the highest scores. This is one of the best new ways to take online classes and ace your exams, even though the pandemic is still going strong. Please feel free to reach me at any time.
ReplyDelete