基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
/******************************
|
||||
* 说明:BaseUserControl 扩展类
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-12-15
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Lskj.Control.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// BaseUserControl 扩展类
|
||||
/// </summary>
|
||||
public static class BaseUserControlExtend
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>说明:将Control转换为BaseUserControl</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-12-15 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="control">The control.</param>
|
||||
/// <returns>BaseUserControl.</returns>
|
||||
public static BaseUserControl ToBaseUserControl(this System.Windows.Forms.Control control)
|
||||
{
|
||||
if (control == null) return null;
|
||||
|
||||
control = control.Parent;
|
||||
if (control != null && control.Tag == null)
|
||||
control = control.Parent;
|
||||
|
||||
return (control != null && control is BaseUserControl) ? control as BaseUserControl : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user