Example #1
0
        private void ResetValues()
        {
            Flags1 = _record.Flags1;
            Flags2 = _record.Flags2;
            Flags3 = _record.Flags3;
            FormID = _record.FormID;
            subRecords.Clear();
            var srs = _record.SubRecords.Select(x => x.Clone()).OfType <SubRecord>().ToArray();

            _record.MatchRecordStructureToRecord(srs);
            subRecords.AddRange(srs);
            subrecordListEditor.SubRecords = subRecords;

            tbName.Text   = _record.Name;
            tbFormID.Text = _record.FormID.ToString("X8");
            textBox1.Text = _record.Flags1.ToString("X8");

            try
            {
                comboBox1.ItemCheck -= comboBox1_ItemCheck;
                comboBox1.SetState(_record.Flags1);
            }
            finally
            {
                comboBox1.ItemCheck += comboBox1_ItemCheck;
            }
            tbFlags2.Text = _record.Flags2.ToString("X8");
            tbFlags3.Text = _record.Flags3.ToString("X8");
        }
Example #2
0
 void IDeserializationCallback.OnDeserialization(object sender)
 {
     if (serializationItems != null)
     {
         SubRecord[] items;
         if (serializationItems.TryGetValue(this, out items))
         {
             serializationItems.Remove(this);
             SubRecords.AddRange(items.OfType <SubRecord>().ToList());
             FixSubrecordOwner();
         }
         if (serializationItems.Count == 0)
         {
             serializationItems = null;
         }
     }
 }