ProfIR
Newbie | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Вопрос про C#. Есть несколько Классов. Не могу связать объекты одного класса с другим. Причем в редакторе нет ошибок, а при запуске на последней строке ошибка: нет ссылки на объект. Подскажите как исправить? public partial class Form1 : Form { [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)] public partial class Document { private object[] dataField; [System.Xml.Serialization.XmlArrayItemAttribute("Subject_FL", typeof(DocumentSubject_FL), IsNullable = false)] public object[] Data { get { return this.dataField; } set { this.dataField = value; } } } [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] public partial class DocumentSubject_FL { //private SubjectTitleDataFL titleField; //public SubjectTitleDataFL Title //{ // get // { // return this.titleField; // } // set // { // this.titleField = value; // } //} } public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Document doc = new Document(); DocumentSubject_FL docsubj = new DocumentSubject_FL(); doc.Data[0] = docsubj; } } |