private void contentBox_MouseEnter(object sender, MouseEventArgs e) { if (Clipboard.GetDataObject().GetFormats().Length != 0 && Clipboard.GetDataObject().GetFormats()[0] == DataFormats.Text) { string content = Clipboard.GetText(); if (content[0] == '`' && content[1] == '`') { if (content == lastContent) { return; } lastContent = content; content = content.Substring(2); contentBox.Document.Blocks.Clear(); SetRtf(DESEncryption.Decrypt(content, key)); } } }
private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.F5) { Clipboard.SetData(DataFormats.Text, "``" + DESEncryption.Encrypt(GetRtf(), key)); contentBox.Document.Blocks.Clear(); } /*if (e.Key == Key.F6) * { * string content = Clipboard.GetText(); * if (content[0] == '`' && content[1] == '`') * { * content = content.Substring(2); * contentBox.Document.Blocks.Clear(); * SetRtf(DESEncryption.Decrypt(content, key)); * } * }*/ }