Game Development Reference
In-Depth Information
Storing Custom Data Formats
Situations arise when your application needs to store custom data on the
Clipboard, either for use within the same application or so that other related
applications can use the data. The .NET framework allows you to store any serial-
izable data type on the Clipboard. To start, we will define a simple custom data
object that will be stored on the Clipboard. This object is described with the fol-
lowing code.
[Serializable]
public class CustomData
{
private static DataFormats.Format dataFormat;
public static DataFormats.Format DataFormat
{
get { return dataFormat; }
}
static CustomData()
{
dataFormat = DataFormats.GetFormat(typeof(CustomData).FullName);
}
private string testString;
private int testInteger;
public CustomData()
{
testString = string.Empty;
testInteger = 0;
}
public CustomData(string testString, int testInteger)
{
this.testString = testString;
this.testInteger = testInteger;
}
public string TestString
{
get { return testString; }
set { testString = value; }
}
Search Nedrilad ::




Custom Search