本文整理汇总了C#中Control.GetParentControlList方法的典型用法代码示例。如果您正苦于以下问题:C# Control.GetParentControlList方法的具体用法?C# Control.GetParentControlList怎么用?C# Control.GetParentControlList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control.GetParentControlList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertIntoList
/// <summary>
/// Determines the correct position in the control tree of <paramref name="targetPage"/>
/// and inserts <paramref name="control"/>.
/// </summary>
/// <param name="control">The control to add.</param>
/// <param name="targetPage">The page to add control to.</param>
/// <param name="addedControls">The control ids that have been added to the target.</param>
private void InsertIntoList(Control control, Page targetPage, List<int> addedControls)
{
ControlList sourceList;
if (control.ParentId != null && this.subControls.ContainsKey(control.ParentId.Value))
{
sourceList = this.subControls[control.ParentId.Value];
}
else
{
sourceList = control.GetParentControlList(this.delta.Revision.FormDefinition.Pages.FindByPageId(targetPage.PageId).Controls);
}
ControlList targetList = !control.ParentId.HasValue ? targetPage.Controls : targetPage.Controls.FindRecursive<ContainerControl>(control.ParentId.Value).Controls;
int index = this.DetermineTargetIndex(sourceList, targetList, control, addedControls);
if (index >= targetList.Count)
{
targetList.Add(control);
}
else
{
targetList.Insert(index, control);
}
}