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); }
public IDictionary <string, object> AsKeyValuePairs() { return(new Dictionary <string, object> { ["Checkrides"] = Checkride.AsPublicList(Checkrides), ["Certificates"] = PilotLicense.AsPublicList(Licenses) }); }
private void AddMergedCheckridesToList(IEnumerable <Checkride> lstIn) { PilotLicense pl = MergeCheckrides(lstIn); if (pl != null) { m_lstLicenses.Add(pl); } }
public int CompareTo(object obj) { PilotLicense pl = obj as PilotLicense; return((pl == null) ? -1 : LicenseKind.CompareTo(pl.LicenseKind)); }