public override void InitializeNewComponent(System.Collections.IDictionary defaultValues)
{
base.InitializeNewComponent(defaultValues);
if (DesignerHost != null)
{
DesignerTransaction trans = DesignerHost.CreateTransaction(
"Adding Syntaxdocument");
var sd = DesignerHost.CreateComponent
(typeof(SyntaxDocument)) as
SyntaxDocument;
var sb = Control as SyntaxBoxControl;
if (sb == null)
{
trans.Cancel();
}
else
{
sb.Document = sd;
trans.Commit();
}
}
}
}