SmartContentSource plugin and preset Alignment

I have written a plugin that extendsSmartContentSource. I persist theISmartContent.Layout.Alignment property and later reload it to be my default value. When I create a new instance by selectingInsert Plugin Name from the side panel and the alignment is eitherAlignment.Left orAlignment.Right, the smart content instance does not layout correctly. I have to reset it to either of these values via the UI to force the correct layout. I am trying to set this property in theCreateContent method. Any ideas what may be causing this?

[820 byte] By [LeoVildosola] at [2008-2-22]
# 1
Shot in the dark, try setting it in the GeneratePublishHtml method instead...
Sc?tt at 2007-9-25 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Writer: Development...
# 2

Thanks for the suggestion. Unfotunately, this did not work either. In fact, I tried it in GetEditorHtml since I use different rendering for the editor vs. what is published.

To provide more detail, what is happening is that the bounding rectangle of the smart content draws all the way to the right taking the entire width of the editor area when I set the ISmartContent.Layout.Alignment to Alignment.Right. The object is set not to be resizable.

LeoVildosola at 2007-9-25 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Writer: Development...
# 3
Not the answer you a looking for but check out this thread New SDK Version which may fix what you are seeing once the next beta version is released.

PS Love your code snippet plugin; the use of Winforms is very clean and I have had no problems using it.

OmegaMan at 2007-9-25 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Writer: Development...
# 4
Thanks for the update on the new SDK. I can't wait for the new Beta to come out.

I'm glad to hear you enjoy using the plugin. I will be making changes to it to allow editing already formatted code. I'll be doing this when I get a chance. I will probably wait until the next Beta release of WLW to do it.

LeoVildosola at 2007-9-25 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Writer: Development...

Windows Live Developer Forums

Site Classified