protected override void WndProc(ref Message m) { // rich text paste notification Win8+ // force update if (m.Msg == WM_REFLECT + WM_NOTIFY) { var notify = (NMHDR)Marshal.PtrToStructure(m.LParam, typeof(NMHDR)); if (notify.code == EN_CLIPFORMAT) { Pasted?.Invoke(this, new EventArgs()); } } base.WndProc(ref m); /* * * private static uint HIWORD(UInt32 inp) * { * return (inp >> 16); * } * * private const int WM_COMMAND = 0x111; * if (m.Msg == (WM_REFLECT + WM_COMMAND)) * { * //System.Diagnostics.Debug.WriteLine("WM_COMMAND; cmd=" + HIWORD((uint)m.WParam.ToInt32()).ToString("X")); * // rich text paste notification Win8+ * // force update * if (HIWORD((uint)m.WParam.ToInt32()) == EN_CLIPFORMAT) * { * Pasted?.Invoke(this, new EventArgs()); * } * } * */ }
public static void Perform(Vector2?mousePosition = null) { var row = Document.Current.SelectedRows().FirstOrDefault(); var loc = row == null ? new RowLocation(Document.Current.RowTree, 0) : new RowLocation(row.Parent, row.Parent.Rows.IndexOf(row)); var data = Clipboard.Text; if (!string.IsNullOrEmpty(data)) { if (Document.Current.Animation.IsCompound) { PasteAnimationTracks(data, loc); } else { PasteNodes(data, loc, mousePosition); } } Pasted?.Invoke(); foreach (var node in Document.Current.SelectedNodes()) { node.LoadExternalScenes(); } }
protected override void WndProc(ref Message m) { if (m.Msg == WM_PASTE) { Pasted?.Invoke(this, EventArgs.Empty); return; } base.WndProc(ref m); }