using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LYFZ.Software.MainBusiness.VersionControl
{
public class VersionFunction : IVersionFuction
{
///
/// 下拉框数据移除控制
///
/// 下拉框
/// 需要移除的数据
public void RemoveDrowDownListData(System.Windows.Forms.Control control, string[] MoveValueList)
{
LYFZ.ComponentLibrary.ComboBoxTreeViewEx comboBox = (LYFZ.ComponentLibrary.ComboBoxTreeViewEx)control;
string strValueData = "," + string.Join(",", MoveValueList) + ",";
List removeItemLsit = new List();
foreach (System.Windows.Forms.TreeNode obj in comboBox.Nodes)
{
if(strValueData.IndexOf(","+obj.Tag.ToString()+",")>-1)
{
removeItemLsit.Add(obj);
}
}
foreach (System.Windows.Forms.TreeNode obj in removeItemLsit)
{
comboBox.Nodes.Remove(obj);
}
}
///
/// 控件隐藏和显示并调整布局
///
/// 显示隐藏控件
/// 调整控件位置
public void ShowOrHideControl(
List showHideControls,
List moveControls)
{
int splitWidth = 10;
System.Drawing.Point firstPoint = new System.Drawing.Point(-1,-1);
if(showHideControls.Count>0)
{
for(int i=0;ishowHideControls[i].Location.X)
{
firstPoint.X = showHideControls[i].Location.X;
}
}
}
}
if (moveControls != null)
{
foreach (System.Windows.Forms.Control control in moveControls)
{
control.Location = new System.Drawing.Point(
firstPoint.X,
control.Location.Y
);
firstPoint.X +=control.Width+ splitWidth;
}
}
}
///
/// 移除tab控件数据
///
///
///
public void ShowOrHideTabControl(System.Windows.Forms.TabControl tabControl, List tabPages)
{
foreach(System.Windows.Forms.TabPage tabPage in tabPages)
{
tabControl.TabPages.Remove(tabPage);
}
}
}
}