Beispiel #1
0
 private static void CompareTypeDescription(TypeDescription source, TypeDescription mirror)
 {
     Assert.AreEqual <string>(source.Name, mirror.Name);
     Assert.AreSame(source.GetType(), mirror.GetType());
     if (source is StructuredType)
     {
         Compare((StructuredType)source, (StructuredType)mirror);
     }
     else
     {
         Compare((EnumeratedType)source, (EnumeratedType)mirror);
     }
 }
Beispiel #2
0
        private void buttonSaveDescription_Click(object sender, EventArgs e)
        {
            if (_feedDescription == null)
            {
                XtraMessageBox.Show("There is no description to save!", "Uh Oh!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (dialogSaveModel.ShowDialog() == DialogResult.OK)
            {
                XmlSerializer serializer = new XmlSerializer(_feedDescription.GetType());
                using (var stream = File.OpenWrite(dialogSaveModel.FileName))
                {
                    serializer.Serialize(stream, _feedDescription);
                }
                XtraMessageBox.Show("Done!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }