位标志有点难以理解:)
我知道这个和这个问题,我确实理解答案,我什至从我的一个好朋友那里关注了这篇文章。
但是当我需要“进化”超过标准时,我仍然无法弄清楚......
我想要做的是:
if (HttpContext.Current.Session["DebugSessionText"] != null)
{
showType = parDebug.Write2LogType.WARN |
parDebug.Write2LogType.ERROR |
parDebug.Write2LogType.INFO;
if (!chkInfo.Checked)
showType &= ~parDebug.Write2LogType.INFO; // remove INFOs
if (!chkError.Checked)
showType &= ~parDebug.Write2LogType.ERROR; // remove ERRORs
List<myDebugRow> list =
(List<myDebugRow>)HttpContext.Current.Session["DebugSessionText"];
gv.DataSource = list.FindAll(x => x.Type == showType));
}
gv.DataBind();
我确实需要过滤一个 List 对象,这样我才能得到用户想要的东西(只显示 INFO 错误、异常错误,但总是会显示 WARNing 错误)......
有没有直接的方法可以做到这一点,或者我需要在不使用 LAMBDA 表达式的情况下手动过滤它?
谢谢大家的帮助。