예제 #1
0
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(tbJsonDetail.Text))
            {
                MessageBox.Show("JSON files to validate are missing.", "Wrong input", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            var type = GetExtractType();

            if (type == null)
            {
                MessageBox.Show("No extract format selected.", "Wrong input", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            try
            {
                var jObject = JObject.Parse(tbJsonDetail.Text);
                tbJsonResult.Text = Documentation.Generate(jObject, (Documentation.Type)type);
            }
            catch (Exception exception)
            {
                tbJsonResult.Text = Utils.FormatedException(exception);
            }
        }