本文整理汇总了C#中PwEntry.GetKPRPCConfig方法的典型用法代码示例。如果您正苦于以下问题:C# PwEntry.GetKPRPCConfig方法的具体用法?C# PwEntry.GetKPRPCConfig怎么用?C# PwEntry.GetKPRPCConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PwEntry
的用法示例。
在下文中一共展示了PwEntry.GetKPRPCConfig方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: KeeFoxEntryUserControl
public KeeFoxEntryUserControl(KeePassRPCExt keePassRPCPlugin, PwEntry entry,
CustomListViewEx advancedListView, PwEntryForm pwEntryForm, ProtectedStringDictionary strings)
{
KeePassRPCPlugin = keePassRPCPlugin;
_entry = entry;
InitializeComponent();
_pwEntryForm = pwEntryForm;
_strings = strings;
_conf = entry.GetKPRPCConfig(strings);
}
示例2: GetEntryFromPwEntry
private LightEntry GetEntryFromPwEntry(PwEntry pwe, int matchAccuracy, bool fullDetails, PwDatabase db, bool abortIfHidden)
{
EntryConfig conf = pwe.GetKPRPCConfig();
if (conf == null)
return null;
return GetEntryFromPwEntry(pwe, conf, matchAccuracy, fullDetails, db, abortIfHidden);
}
示例3: MergeEntries
private void MergeEntries(PwEntry destination, PwEntry source, int urlMergeMode, PwDatabase db)
{
EntryConfig destConfig = destination.GetKPRPCConfig();
if (destConfig == null)
return;
EntryConfig sourceConfig = source.GetKPRPCConfig();
if (sourceConfig == null)
return;
destination.CreateBackup(db);
destConfig.HTTPRealm = sourceConfig.HTTPRealm;
destination.IconId = source.IconId;
destination.CustomIconUuid = source.CustomIconUuid;
destination.Strings.Set("UserName", new ProtectedString(
host.Database.MemoryProtection.ProtectUserName, source.Strings.ReadSafe("UserName")));
destination.Strings.Set("Password", new ProtectedString(
host.Database.MemoryProtection.ProtectPassword, source.Strings.ReadSafe("Password")));
destConfig.FormFieldList = sourceConfig.FormFieldList;
// This algorithm could probably be made more efficient (lots of O(n) operations
// but we're dealing with pretty small n so I've gone with the conceptually
// easiest approach for now).
List<string> destURLs = new List<string>();
destURLs.Add(destination.Strings.ReadSafe("URL"));
if (destConfig.AltURLs != null)
destURLs.AddRange(destConfig.AltURLs);
List<string> sourceURLs = new List<string>();
sourceURLs.Add(source.Strings.ReadSafe("URL"));
if (sourceConfig.AltURLs != null)
sourceURLs.AddRange(sourceConfig.AltURLs);
switch (urlMergeMode)
{
case 1:
MergeInNewURLs(destURLs, sourceURLs);
break;
case 2:
destURLs.RemoveAt(0);
MergeInNewURLs(destURLs, sourceURLs);
break;
case 3:
if (sourceURLs.Count > 0)
{
foreach (string sourceUrl in sourceURLs)
if (!destURLs.Contains(sourceUrl))
destURLs.Add(sourceUrl);
}
break;
case 4:
default:
// No changes to URLs
break;
}
// These might not have changed but meh
destination.Strings.Set("URL", new ProtectedString(host.Database.MemoryProtection.ProtectUrl, destURLs[0]));
destConfig.AltURLs = new string[0];
if (destURLs.Count > 1)
destConfig.AltURLs = destURLs.GetRange(1,destURLs.Count-1).ToArray();
destination.SetKPRPCConfig(destConfig);
destination.Touch(true);
}