当前位置: 首页>>代码示例>>C#>>正文


C# Panel.Fit方法代码示例

本文整理汇总了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);
				}
		}
开发者ID:jozilla,项目名称:Uiml.net,代码行数:59,代码来源:WxRenderer.cs


注:本文中的Panel.Fit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。