Bit flags are a little difficult to understand :)
I know about this and this questions and I do understand the answers and I even followed this article from a good friend of mine.
But I still cant figure it out when I need to "evolute" more than the standard...
What I'm trying to do is this:
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();
I do need to filter a List object, so I can get just what the user wants (show only INFO errors, exception ERRORs but WARNing errrors will always be showed) ...
Is there a direct way to do this or I need to filter it manually without using the LAMBDA expression?
Thank you for all the help.