public void AddContent(RenderElement vi, object owner)
{
if (vi is RenderBoxBase)
{
if (owner is ITopWindowBox)
{
var topWinBox = owner as ITopWindowBox;
if (topWinBox.PlatformWinBox == null)
{
//create platform winbox
var newForm = new AbstractCompletionWindow();
newForm.LinkedParentForm = this.FindForm();
newForm.LinkedParentControl = this;
UISurfaceViewportControl newSurfaceViewport = this.CreateNewOne(300, 200);
newSurfaceViewport.Location = new System.Drawing.Point(0, 0);
newForm.Controls.Add(newSurfaceViewport);
vi.ResetRootGraphics(newSurfaceViewport.RootGfx);
vi.SetLocation(0, 0);
newSurfaceViewport.AddContent(vi);
//------------------------------------------------------
var platformWinBox = new PlatformWinBoxForm(newForm);
topWinBox.PlatformWinBox = platformWinBox;
platformWinBox.UseRelativeLocationToParent = true;
subForms.Add(newForm);
}
}
else
{
this.rootgfx.TopWindowRenderBox.AddChild(vi);
}
}
else
{
this.rootgfx.TopWindowRenderBox.AddChild(vi);
}
}