Disco.Services.JobFlagExtensions.ValidFlags C# (CSharp) Method

ValidFlags() public static method

public static ValidFlags ( this j ) : Dictionary>
j this
return Dictionary>
        public static Dictionary<long, Tuple<string, bool>> ValidFlags(this Job j)
        {
            Dictionary<long, Tuple<string, bool>> validFlags = new Dictionary<long, Tuple<string, bool>>();

            CacheAllFlags();

            var currentFlags = (long)(j.Flags ?? 0);

            foreach (var jt in j.JobSubTypes)
            {
                Dictionary<long, string> g;
                if (allFlags.TryGetValue(jt.Id, out g))
                {
                    foreach (var f in g)
                        validFlags[f.Key] = new Tuple<string, bool>(string.Format("{0}: {1}", jt.Description, f.Value), ((currentFlags & f.Key) == f.Key));
                }
            }
            return validFlags;
        }
    }