Ejemplo n.º 1
0
        private void ValidateToSchema()
        {
            HourGlass.Start();
            var error = new StringBuilder(1024 * 1024 * 6);
            InstrumentDescription instrument = InstrumentDescription;

            try
            {
                if (!SchemaManager.ValidateXml(instrument.Serialize(), ATMLCommon.InstrumentNameSpace, error))
                {
                    HourGlass.Stop();
                    string name = GetName(instrument);
                    ATMLErrorForm.ShowValidationMessage(
                        string.Format("The \"{0}\" Instrument has failed validation against the {1} ATML schema.", name,
                                      ATMLCommon.InstrumentNameSpace),
                        error.ToString(), "Note: This error will not prevent you from continuing.");
                }
                else
                {
                    HourGlass.Stop();
                    MessageBox.Show(@"This Instrument generated valid ATML");
                }
            }
            catch (Exception)
            {
                HourGlass.Stop();
            }
        }
Ejemplo n.º 2
0
        private void btnValidate_Click(object sender, EventArgs e)
        {
            StringBuilder  error = new StringBuilder(1024 * 1024 * 6);
            UUTDescription uut   = UUTDescription;

            if (!SchemaManager.ValidateXml(uut.Serialize(), ATMLCommon.UUTNameSpace, error))
            {
                ATMLErrorForm.ShowValidationMessage(
                    string.Format("The \"{0}\" UUT has failed validation against the {1} ATML schema.",
                                  uut.name, ATMLCommon.UUTNameSpace),
                    error.ToString(),
                    "Note: This error will not prevent you from continuing.");
            }
            else
            {
                MessageBox.Show(@"This UUT generated valid ATML");
            }
        }
Ejemplo n.º 3
0
        public static void ShowValidationMessage(string title, string message, string note = null)
        {
            ATMLErrorForm form = new ATMLErrorForm(title.Replace("\n", "<br/>"), message.Replace("\n", "<br/>"), note);

            form.Show();
        }
Ejemplo n.º 4
0
        public static void ShowError(Exception e)
        {
            ATMLErrorForm form = new ATMLErrorForm(e);

            form.Show();
        }
Ejemplo n.º 5
0
 public static void ShowValidationMessage( string title, string message, string note = null )
 {
     ATMLErrorForm form = new ATMLErrorForm(title.Replace("\n", "<br/>"), message.Replace("\n", "<br/>"), note);
     form.Show();
 }
Ejemplo n.º 6
0
 public static void ShowError(Exception e)
 {
     ATMLErrorForm form = new ATMLErrorForm(e);
     form.Show();
 }