コード例 #1
0
ファイル: PxDatabase.cs プロジェクト: passxyz/KPCLib
        /// <summary>
        /// Find a list of entries with a defined property, such as OTP Url
        /// The customized properties are stored in CustomData per PxDefs, such as PxCustomDataOtpUrl
        /// </summary>
        /// <param name="name">The property name. Must not be <c>null</c>.</param>
        /// <returns>a list of entries</returns>
        public IEnumerable <PwEntry> GetEntryListByProperty(string name)
        {
            if (name == null)
            {
                Debug.Assert(false); throw new ArgumentNullException("name");
            }

            List <PwEntry> resultsList = new List <PwEntry>();

            LinkedList <PwGroup> flatGroupList = RootGroup.GetFlatGroupList();

            foreach (PwEntry entry in RootGroup.Entries)
            {
                if (entry.CustomData != null && entry.CustomData.Exists(name))
                {
                    if (!string.IsNullOrWhiteSpace(entry.CustomData.Get(name)))
                    {
                        resultsList.Add(entry);
                    }
                }
            }

            foreach (PwEntry entry in PwGroup.GetFlatEntryList(flatGroupList))
            {
                if (entry.CustomData != null && entry.CustomData.Exists(name))
                {
                    if (!string.IsNullOrWhiteSpace(entry.CustomData.Get(name)))
                    {
                        resultsList.Add(entry);
                    }
                }
            }
            return(resultsList);
        }
コード例 #2
0
 private IEnumerable <PwEntry> GetAllEntries()
 {
     if (_database == null || !_database.IsOpen)
     {
         throw new ArgumentException("Database is not opended. Call Open() first.");
     }
     return(PwGroup.GetFlatEntryList(_database.RootGroup.GetFlatGroupList()).ToList());
 }
コード例 #3
0
 public List <PwEntry> GetAllEntries()
 {
     return(PwGroup.GetFlatEntryList(Database.RootGroup.GetFlatGroupList()).ToList());
 }