DotNet 4.8.1 build of DotNetBar
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user