Code formatting on Forum

What are people using to get the nice color syntax and formating for XAML samples they post on the forums?

thanks,

Kiel

[138 byte] By [wadnerk] at [2007-12-24]
# 1

If you copy from Visual Studio's HTML/XML editor and paste into the forums' HTML editor it should "just work".

DrewMarsh at 2007-8-31 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 2

Drew,

That is not my experience. I copy from VS and the text is flush left with extra line separtors.

MichaelLatta at 2007-8-31 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 3

Ok, as a slightly off-topic followup.. Why have other people been granted permission to mark my threads as answered? As in this case, the question wasn't answered.

Drew, below is a copy and paste out of VS Express. Its doesn't really "just work", unless all you are refering to is the highlighting and not the formating. =)

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">

<!-- Date -->

<TextBlock Name="dates" Text="{Binding DateAsString}" Style="{StaticResource EventDateStyle}" />

<!-- Title -->

<TextBlock Name="Title" Text="{Binding Title}" Style="{StaticResource EventTitleStyle}" />

</StackPanel>

wadnerk at 2007-8-31 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 4

I probably marked the thread as answered. If it is ever marked in error, please unmark it. Sorry, sometimes I get it wrong.

I think I end up formatting the indention by hand, but the formatting comes from VS copy/paste.

RobRelyea at 2007-8-31 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 5

I use CopySourceAsHTML:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<configSections>

<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >

<!-- ... -->

</sectionGroup>

</configSections>

<applicationSettings>

Very flexible; I'm configured it to have a border and a background colour...

PeterRitchie at 2007-8-31 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 6
Heh - neat!
NishantSivakumar at 2007-8-31 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 7
I usually end up formatting by hand after doing a copy/paste from VS. Also there is a certain level of support provided by [ code language="C#" ] tag (remove spaces)
ivolved_Mike_Brown at 2007-8-31 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 8
I use the following trick:

Copy text from Visual Studio, paste into Word, change font to Courier New, size 8, copy again, and finally paste into forum.

PaulShmakov at 2007-8-31 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 10
Thanks for all the responses. Great help!
wadnerk at 2007-8-31 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified