43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Sarand.Net.Standard.Base.Core
|
|
{
|
|
//=======================================================================
|
|
public class FlagDfn
|
|
{
|
|
//---------------------------------------------------------------
|
|
// Construction.
|
|
public FlagDfn (Byte flagPos, String caption, String columnHeading)
|
|
{
|
|
FlagPos = flagPos;
|
|
Caption = caption;
|
|
ColumnHeading = columnHeading;
|
|
}
|
|
|
|
//---------------------------------------------------------------
|
|
// Properties.
|
|
public Byte FlagPos { get; private set; } = 0;
|
|
public String Caption { get; private set; } = "";
|
|
public String ColumnHeading { get; private set; } = "";
|
|
|
|
//---------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
public static class FlagDfnList
|
|
{
|
|
public static void Add (this List<FlagDfn> values, Byte flagPos, String caption, String columnHeading)
|
|
{
|
|
values.Add(new FlagDfn(flagPos, caption, columnHeading));
|
|
}
|
|
public static FlagDfn GetFlagByPos (this List<FlagDfn> values, ushort flagPos)
|
|
{
|
|
foreach (FlagDfn flagDfn in values)
|
|
if (flagDfn.FlagPos == flagPos)
|
|
return flagDfn;
|
|
return null;
|
|
}
|
|
}
|
|
//=======================================================================
|
|
}
|