public bool ContentsEqualTo(SecureEdit aSecureEdit) { Debug.Assert(aSecureEdit != null); if (aSecureEdit == null) { return(false); } using (var thisString = new PinnedArray <byte>(this.ToUtf8())) { using (var otherString = new PinnedArray <byte>(aSecureEdit.ToUtf8())) { if (thisString.Data.Length != otherString.Data.Length) { return(false); } else { for (int i = 0; i < thisString.Data.Length; ++i) { if (thisString.Data[i] != otherString.Data [i]) { return(false); } } } return(true); } } }
public PassphraseDialog() { SetupUi(this); Message = string.Empty; mSecureEdit = new SecureEdit(); ShowEvent += PassphraseDialog_ShowEvent; HideEvent += PassphraseDialog_HideEvent; }
public bool ContentsEqualTo(SecureEdit aSecureEdit) { Debug.Assert(aSecureEdit != null); if (aSecureEdit == null) { return false; } using (var thisString = new PinnedArray<byte>(this.ToUtf8())) { using (var otherString = new PinnedArray<byte>(aSecureEdit.ToUtf8())) { if (thisString.Data.Length != otherString.Data.Length) { return false; } else { for (int i = 0; i < thisString.Data.Length; ++i) { if (thisString.Data[i] != otherString.Data [i]) { return false; } } } return true; } } }