51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
using DevComponents.DotNetBar.Controls;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.Design;
|
|
using System.Text;
|
|
|
|
namespace DevComponents.DotNetBar.Design
|
|
{
|
|
public class FlyoutDesigner : ComponentDesigner
|
|
{
|
|
#region Implementation
|
|
public override void InitializeNewComponent(IDictionary defaultValues)
|
|
{
|
|
SetDefaults();
|
|
base.InitializeNewComponent(defaultValues);
|
|
|
|
}
|
|
|
|
private void SetDefaults()
|
|
{
|
|
IDesignerHost dh = (IDesignerHost)GetService(typeof(IDesignerHost));
|
|
if (dh != null)
|
|
{
|
|
if (dh.Loading)
|
|
{
|
|
dh.LoadComplete += DesignerLoadComplete;
|
|
return;
|
|
}
|
|
Flyout flyout = this.Component as Flyout;
|
|
if (flyout != null)
|
|
{
|
|
System.Windows.Forms.Control parent = dh.RootComponent as System.Windows.Forms.Control;
|
|
if (parent != null)
|
|
{
|
|
flyout.Parent = parent;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
void DesignerLoadComplete(object sender, EventArgs e)
|
|
{
|
|
IDesignerHost dh = (IDesignerHost)GetService(typeof(IDesignerHost));
|
|
if (dh != null)
|
|
dh.LoadComplete -= DesignerLoadComplete;
|
|
SetDefaults();
|
|
}
|
|
#endregion
|
|
}
|
|
}
|