本文整理汇总了C#中Panel.Fit方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.Fit方法的具体用法?C# Panel.Fit怎么用?C# Panel.Fit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel.Fit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
///<summary>
/// This is the ``core'' rendering method. It will recursively descend into the Part hierarchy
/// and using the .net reflection mechanisms to create the appropriate widgets
///</summary>
private Window Render(Part uiPart, Style uiStyle, Window parent) //throws WrongNestingException, MappingNotFoundException
{
string className = Voc.MapsOnCls(uiPart.Class);
Type classType = GuiAssembly.GetType(className);
Type containerType = GuiAssembly.GetType(CONTAINER);
System.Object wxObject;
// try{
// Console.WriteLine("Try to create instance for {0}", classType);
// wxObject = Activator.CreateInstance(classType);
// Console.WriteLine("Created object {0}", wxObject);
// }
// catch(MissingMethodException mme)
{
if(classType.Equals(containerType))
wxObject = CreateLayoutWithParams(classType, uiPart, uiStyle);
else
wxObject = CreateWithParams(classType, uiPart, uiStyle, parent);
}
//attach it to the Part for later manipulation
uiPart.UiObject = wxObject;
if(uiPart.HasSubParts())
{
if(classType.Equals(containerType))
{
m_adder = ADD;
IEnumerator enumParts = uiPart.GetSubParts();
Window wxContainer = new Panel(parent);
while(enumParts.MoveNext())
{
Part subPart = (Part)enumParts.Current;
Window b = Render(subPart, uiStyle, wxContainer);
MethodInfo m = classType.GetMethod(m_adder, new Type[] { b.GetType() } );
m.Invoke(wxObject, new System.Object[] { b });
}
PropertyInfo addLayout = typeof(Window).GetProperty(APPLY_LAYOUT /*, new Type[] { classType }*/ );
addLayout.SetValue(wxContainer, wxObject, null );
wxContainer.Fit();
return (Window)ApplyProperties((Window)wxContainer, uiPart, uiStyle);
}
else
{
throw new WrongNestingException(className, CONTAINER);
}
}
else
{
//wxObject = AttachEvents((Widget)wxObject, uiBehavior);
return (Window)ApplyProperties((Window)wxObject, uiPart, uiStyle);
}
}