TSMGeorge Δημοσ. 8 Νοεμβρίου 2014 Δημοσ. 8 Νοεμβρίου 2014 Test Function void Test() { Position[] positions = new Position[10]; for (int i = 0; i < 10; i++) { positions[i] = new Position(i.ToString(), "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", new String[] { "1" }); } dataGirdResult.ItemsSource = positions; } Position Class using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Atlas { class Position : GeneralPositionInfo { // Properties public String Code { get; private set; } public String Date { get; private set; } public String Title { get; private set; } public String Organization { get; private set; } // Default Constructor public Position() { // Basic Position Informations this.Code = "-1"; this.Date = "Empty"; this.Title = "Empty"; this.Organization = "Empty"; // General Position Informations GeneralPositionInfo("Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty", "Empty", new String[] { "Empty" }); } //Default Constructor // Constructor public Position(String code, String date, String title, String organization, String description, String duration, String country, String city1, String city2, String timeLimit, String typeOfPosition, String proctorName, String proctorEmail, String proctorPhone, String[] subjects) { // (This) Basic Position Info this.Code = code; this.Date = date; this.Title = title; this.Organization = organization; // General Position Info GeneralPositionInfoSet(description, duration, country, city1, city2, timeLimit, typeOfPosition, proctorName, proctorEmail, proctorPhone, subjects); }//Constructor } } GeneralPositionInfo Class using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Atlas { abstract class GeneralPositionInfo { // Properties public String Description { get; private set; } public String Duration { get; private set; } public String Country { get; private set; } public String City1 { get; private set; } public String City2 { get; private set; } public String TimeLimit { get; private set; } public String TypeOfPosition { get; private set; } public String ProctorName { get; private set; } public String ProctorEmail { get; private set; } public String ProctorPhone { get; private set; } public String[] Subjects { get; private set; } public void GeneralPositionInfoSet(String description, String duration, String country, String city1, String city2, String timeLimit, String typeOfPosition, String proctorName, String proctorEmail, String proctorPhone, String[] subjects ) { this.Description = description; this.Duration = duration; this.Country = country; this.City1 = city1; this.City2 = city2; this.TimeLimit = timeLimit; this.TypeOfPosition = typeOfPosition; this.ProctorName = proctorName; this.ProctorEmail = proctorEmail; this.ProctorPhone = proctorPhone; this.Subjects = new String[subjects.Length]; for (int i = 0; i < subjects.Length; i++) { this.Subjects[i] = subjects[i]; } } // GeneralPositionInfo } }
Προτεινόμενες αναρτήσεις
Δημιουργήστε ένα λογαριασμό ή συνδεθείτε για να σχολιάσετε
Πρέπει να είστε μέλος για να αφήσετε σχόλιο
Δημιουργία λογαριασμού
Εγγραφείτε με νέο λογαριασμό στην κοινότητα μας. Είναι πανεύκολο!
Δημιουργία νέου λογαριασμούΣύνδεση
Έχετε ήδη λογαριασμό; Συνδεθείτε εδώ.
Συνδεθείτε τώρα