private void button1_Click(object sender, EventArgs e) { EResource ebook1 = new EResource("Ebook"); ebook1["Title"] = "Giáo trình môn..."; ebook1["Authors"] = "Author1"; EResource audio = new EResource("Audio"); ebook1["Title"] = "Song ..."; ebook1["Artists"] = "Artist 1, Artist 2"; }
public static void Initialize() { SampleEResources = new Dictionary <string, EResource>(); EResource temp; temp = new EResource(); temp.ClassType = "Ebook"; temp.Attributes.AddAttribute(new Attribute("Title", "", "String")); temp.Attributes.AddAttribute(new Attribute("Authors", "", "String")); temp.Attributes.AddAttribute(new Attribute("Publisher", "", "String")); temp.Attributes.AddAttribute(new Attribute("#Pages", "", "int")); SampleEResources.Add(temp.ClassType, temp); temp = new EResource(); temp.ClassType = "Audio"; temp.Attributes.AddAttribute(new Attribute("Title", "", "String")); temp.Attributes.AddAttribute(new Attribute("Artists", "", "String")); temp.Attributes.AddAttribute(new Attribute("Album", "", "String")); temp.Attributes.AddAttribute(new Attribute("Duration", "", "int")); temp.Attributes.AddAttribute(new Attribute("Rating", "", "double")); SampleEResources.Add(temp.ClassType, temp); }
public Form1() { InitializeComponent(); EResource.Initialize(); }