เรามี serializable เรียนที่ถือข้อมูลจากเนื้อหาบนคลิปบอร์ดจะผ่านไปจากหน้าต่างต่างๆจากควบคุมเพื่อ WPF การควบคุม มันทำงานในส่วนเฟรมเวิร์ก 4.8 หลังจากการเปลี่ยนไปอข่าย 5 ตอนนี้เราได้ข้อผิดพลาดคือ: ประเภท'ระบบRuntimeType ในโรงเรี'ระบบเป็นการส่วนตัวCoreLib,เวอร์ชั่น=5.0.0.0,วัฒนธรรม=ค่าเป็นกลาง,PublicKeyToken=7cec85d7bea7798e'คือไม่จำเป็น serializable.
มันเกิดขึ้นในห้องเหตุการณ์เครื่องมือจัดการอยู่ใน WPF ในบรรทัด:
var tClip = e.Data.GetDataPresent(typeof(ClipboardDescriptor));
ยู่ที่ไหน'e'คือระบบหน้าต่างDragEventArgs.
using System;
using System.Windows.Forms;
namespace Support.Classes
{
/// <summary>
/// Summary description for ClipboardDescriptor.
/// </summary>
[Serializable]
public class ClipboardDescriptor
{
private Guid id;
private Guid parentDocumentID;
private System.Type objtype;
private TreeNode baseTreeNode;
private string objname;
public ClipboardDescriptor()
{
baseTreeNode = null;
}
public Guid ParentDocumentID
{
get { return(parentDocumentID); }
set { parentDocumentID = value; }
}
public Guid ID
{
get { return(id); }
set { id = value; }
}
public System.Type ObjType
{
get { return(objtype); }
set { objtype = value; }
}
public string ObjName
{
get { return(objname); }
set { objname = value; }
}
/// <summary>
/// Get the treenode that this object is associated with
/// </summary>
public TreeNode BaseTreeNode
{
get { return(baseTreeNode); }
set { baseTreeNode = value; }
}
}
}