PerformDefaultUrlAction() private method

private PerformDefaultUrlAction ( PwEntry vOptEntries, bool bForceOpen ) : void
vOptEntries PwEntry
bForceOpen bool
return void
Beispiel #1
0
        private static void OpenEntryUrl(IpcParamEx ip, MainForm mf)
        {
            string strUuid = ip.Param0;
            if(string.IsNullOrEmpty(strUuid)) return; // No assert (user data)

            byte[] pbUuid = MemUtil.HexStringToByteArray(strUuid);
            if((pbUuid == null) || (pbUuid.Length != PwUuid.UuidSize)) return;
            PwUuid pwUuid = new PwUuid(pbUuid);

            List<PwDocument> lDocs = new List<PwDocument>(mf.DocumentManager.Documents);
            PwDocument pwDocActive = mf.DocumentManager.ActiveDocument;
            for(int i = 1; i < lDocs.Count; ++i)
            {
                if(object.ReferenceEquals(lDocs[i], pwDocActive))
                {
                    lDocs.RemoveAt(i);
                    lDocs.Insert(0, pwDocActive);
                    break;
                }
            }

            foreach(PwDocument pwDoc in lDocs)
            {
                if(pwDoc == null) { Debug.Assert(false); continue; }

                PwDatabase pdb = pwDoc.Database;
                if((pdb == null) || !pdb.IsOpen) continue;

                PwEntry pe = pdb.RootGroup.FindEntry(pwUuid, true);
                if(pe == null) continue;

                mf.PerformDefaultUrlAction(new PwEntry[]{ pe }, true);
                break;
            }
        }
Beispiel #2
0
        private static void OpenEntryUrl(IpcParamEx ip, MainForm mf)
        {
            string strUuid = ip.Param0;
            if(string.IsNullOrEmpty(strUuid)) return; // No assert (user data)

            byte[] pbUuid = MemUtil.HexStringToByteArray(strUuid);
            if((pbUuid == null) || (pbUuid.Length != PwUuid.UuidSize)) return;

            PwDatabase pdb = mf.ActiveDatabase;
            if((pdb == null) || !pdb.IsOpen) return;

            PwEntry pe = pdb.RootGroup.FindEntry(new PwUuid(pbUuid), true);
            if(pe == null) return;

            mf.PerformDefaultUrlAction(new PwEntry[]{ pe }, true);
        }
Beispiel #3
0
        private static void OpenEntryUrl(IpcParamEx ip, MainForm mf)
        {
            string strUuid = ip.Param0;
            if(string.IsNullOrEmpty(strUuid)) return; // No assert (user data)

            byte[] pbUuid = MemUtil.HexStringToByteArray(strUuid);
            if((pbUuid == null) || (pbUuid.Length != PwUuid.UuidSize)) return;
            PwUuid pwUuid = new PwUuid(pbUuid);

            List<PwDocument> lDocs = mf.DocumentManager.GetDocuments(int.MinValue);
            foreach(PwDocument pwDoc in lDocs)
            {
                if(pwDoc == null) { Debug.Assert(false); continue; }

                PwDatabase pdb = pwDoc.Database;
                if((pdb == null) || !pdb.IsOpen) continue;

                PwEntry pe = pdb.RootGroup.FindEntry(pwUuid, true);
                if(pe == null) continue;

                mf.PerformDefaultUrlAction(new PwEntry[]{ pe }, true);
                break;
            }
        }