private void MirrorDOCsToUI() { // todo: extend PathIsValid GatherUserInput(); try { cache.BIVs[selectedBIVName].LoadDOC(cctsR); } catch (CacheException ce) { MessageBox.Show(ce.Message, "VIENNA Add-In Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); } // model // todo: set default value for document model and select afterwards //comboModels.SelectedItem = cache.DOCLs[selectedBIVName].DocumentModel; // documents comboboxDocuments.Items.Clear(); cDOC doc = cache.BIVs[selectedBIVName].DOC; if (doc != null) { var newItem = new CheckBox { Content = doc.Name, IsChecked = (doc.State == CheckState.Checked ? true : false) }; comboboxDocuments.Items.Add(newItem); } }
private void buttonExport_Click(object sender, RoutedEventArgs e) { Cursor = Cursors.Wait; textBoxStatus.Text = "Starting to generate XML schemas ...\n\n"; GatherUserInput(); cBIV currentBIV = cache.BIVs[selectedBIVName]; IDocLibrary docl = cctsR.GetDocLibraryById(currentBIV.Id); // TODO: xsd generator needs to be adapted - currently all doc libraries are being generated whereas // only the ones that are checked should be generated.. //TODO: currently the wizard just takes the input from the text fields whereas the prefix and the // target namespace should be (a) stored in the cache and (b) read from there while generation.. if (comboboxDocumentModel.SelectedItem.Equals("CCTS")) { // TODO: check if path is valid cDOC document = currentBIV.DOC; if (document != null && document.State == CheckState.Checked) { } string targetNamespace = textboxTagetNamespace.Text; string namespacePrefix = textboxPrefix.Text; bool annotate = checkboxDocumentationAnnotations.IsChecked == true ? true : false; bool allschemas = checkboxGenerateCcSchemas.IsChecked == true ? true : false; var generationContext = new GeneratorContext(cctsR, targetNamespace, namespacePrefix, annotate, allschemas, outputDirectory, docl); generationContext.SchemaAdded += HandleSchemaAdded; XSDGenerator.GenerateSchemas(generationContext); } else { SubsetExporter.ExportSubset(docl, originalXMLSchema, outputDirectory); } textBoxStatus.Text += "\nGenerating XML schemas completed!"; Cursor = Cursors.Arrow; }