本文整理汇总了C#中PwEntry.EqualsEntry方法的典型用法代码示例。如果您正苦于以下问题:C# PwEntry.EqualsEntry方法的具体用法?C# PwEntry.EqualsEntry怎么用?C# PwEntry.EqualsEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PwEntry
的用法示例。
在下文中一共展示了PwEntry.EqualsEntry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveEntry
private bool SaveEntry(PwEntry peTarget, bool bValidate)
{
if(m_pwEditMode == PwEditMode.ViewReadOnlyEntry) return true;
if(bValidate && !m_icgPassword.ValidateData(true)) return false;
if(this.EntrySaving != null)
{
CancellableOperationEventArgs eaCancel = new CancellableOperationEventArgs();
this.EntrySaving(this, eaCancel);
if(eaCancel.Cancel) return false;
}
peTarget.History = m_vHistory; // Must be called before CreateBackup()
bool bCreateBackup = (m_pwEditMode != PwEditMode.AddNewEntry);
if(bCreateBackup) peTarget.CreateBackup(null);
peTarget.IconId = m_pwEntryIcon;
peTarget.CustomIconUuid = m_pwCustomIconID;
if(m_cbCustomForegroundColor.Checked)
peTarget.ForegroundColor = m_clrForeground;
else peTarget.ForegroundColor = Color.Empty;
if(m_cbCustomBackgroundColor.Checked)
peTarget.BackgroundColor = m_clrBackground;
else peTarget.BackgroundColor = Color.Empty;
peTarget.OverrideUrl = m_cmbOverrideUrl.Text;
List<string> vNewTags = StrUtil.StringToTags(m_tbTags.Text);
peTarget.Tags.Clear();
foreach(string strTag in vNewTags) peTarget.AddTag(strTag);
peTarget.Expires = m_cgExpiry.Checked;
if(peTarget.Expires) peTarget.ExpiryTime = m_cgExpiry.Value;
UpdateEntryStrings(true, false, false);
peTarget.Strings = m_vStrings;
peTarget.Binaries = m_vBinaries;
m_atConfig.Enabled = m_cbAutoTypeEnabled.Checked;
m_atConfig.ObfuscationOptions = (m_cbAutoTypeObfuscation.Checked ?
AutoTypeObfuscationOptions.UseClipboard :
AutoTypeObfuscationOptions.None);
SaveDefaultSeq();
peTarget.AutoType = m_atConfig;
peTarget.Touch(true, false); // Touch *after* backup
if(object.ReferenceEquals(peTarget, m_pwEntry)) m_bTouchedOnce = true;
StrUtil.NormalizeNewLines(peTarget.Strings, true);
bool bUndoBackup = false;
PwCompareOptions cmpOpt = m_cmpOpt;
if(bCreateBackup) cmpOpt |= PwCompareOptions.IgnoreLastBackup;
if(peTarget.EqualsEntry(m_pwInitialEntry, cmpOpt, MemProtCmpMode.CustomOnly))
{
// No modifications at all => restore last mod time and undo backup
peTarget.LastModificationTime = m_pwInitialEntry.LastModificationTime;
bUndoBackup = bCreateBackup;
}
else if(bCreateBackup)
{
// If only history items have been modified (deleted) => undo
// backup, but without restoring the last mod time
PwCompareOptions cmpOptNH = (m_cmpOpt | PwCompareOptions.IgnoreHistory);
if(peTarget.EqualsEntry(m_pwInitialEntry, cmpOptNH, MemProtCmpMode.CustomOnly))
bUndoBackup = true;
}
if(bUndoBackup) peTarget.History.RemoveAt(peTarget.History.UCount - 1);
peTarget.MaintainBackups(m_pwDatabase);
if(this.EntrySaved != null) this.EntrySaved(this, EventArgs.Empty);
return true;
}