Exemplo n.º 1
0
        private PilotLicense MergeCheckrides(IEnumerable <Checkride> lstIn)
        {
            PilotLicense pl = null;

            if (lstIn == null)
            {
                return(pl);
            }

            HashSet <string> hsPrivs = new HashSet <string>();

            foreach (Checkride cr in lstIn)
            {
                if (pl == null)
                {
                    pl = new PilotLicense(cr);
                }
                hsPrivs.Add(cr.Privilege);
            }

            // Sort and add privs
            if (pl != null)
            {
                List <string> lstPrivs = new List <string>(hsPrivs);
                lstPrivs.Sort();
                foreach (string szPriv in lstPrivs)
                {
                    pl.AddPrivilege(szPriv);
                }
            }

            return(pl);
        }
Exemplo n.º 2
0
 public IDictionary <string, object> AsKeyValuePairs()
 {
     return(new Dictionary <string, object>
     {
         ["Checkrides"] = Checkride.AsPublicList(Checkrides),
         ["Certificates"] = PilotLicense.AsPublicList(Licenses)
     });
 }
Exemplo n.º 3
0
        private void AddMergedCheckridesToList(IEnumerable <Checkride> lstIn)
        {
            PilotLicense pl = MergeCheckrides(lstIn);

            if (pl != null)
            {
                m_lstLicenses.Add(pl);
            }
        }
Exemplo n.º 4
0
        public int CompareTo(object obj)
        {
            PilotLicense pl = obj as PilotLicense;

            return((pl == null) ? -1 : LicenseKind.CompareTo(pl.LicenseKind));
        }