Пример #1
0
        private void cboResultsFormat_SelectedIndexChanged(object sender, EventArgs e)
        {
            fclsStylesheetPicker stylesheetPicker;

            switch (this.cboResultsFormat.SelectedIndex)
            {
            case 0:
                this._resultswriter = new SparqlCsvWriter();
                this._resultsext    = ".csv";
                break;

            case 1:
                this._resultswriter = new SparqlRdfWriter(this._rdfwriter);
                this._resultsext    = this._rdfext;
                break;

            case 2:
                this._resultswriter = new SparqlHtmlWriter();
                this._resultsext    = ".html";
                break;

            case 3:
                stylesheetPicker = new fclsStylesheetPicker("CSS");
                if (stylesheetPicker.ShowDialog() == DialogResult.OK)
                {
                    SparqlHtmlWriter temp = new SparqlHtmlWriter();
                    temp.Stylesheet     = stylesheetPicker.StylesheetUri;
                    this._resultswriter = temp;
                }
                else
                {
                    this._resultswriter = new SparqlHtmlWriter();
                }
                this._resultsext = ".html";
                break;

            case 4:
                this._resultswriter = new SparqlJsonWriter();
                this._resultsext    = ".json";
                break;

            case 5:
                this._resultswriter = new SparqlTsvWriter();
                this._resultsext    = ".tsv";
                break;

            case 6:
                this._resultswriter = new SparqlXmlWriter();
                this._resultsext    = ".srx";
                break;

            case 7:
                stylesheetPicker = new fclsStylesheetPicker("XSLT");
                if (stylesheetPicker.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        this._resultswriter = new SparqlXsltWriter(stylesheetPicker.StylesheetUri);
                        this._resultsext    = ".xml";
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Unable to use the selected XSLT Stylesheet due to the following error:\n" + ex.Message, "Invalid Stylesheet", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        this.cboResultsFormat.SelectedIndex = 2;
                        this._resultswriter = new SparqlHtmlWriter();
                        this._resultsext    = ".html";
                    }
                }
                else
                {
                    this.cboResultsFormat.SelectedIndex = 2;
                    this._resultswriter = new SparqlHtmlWriter();
                    this._resultsext    = ".html";
                }
                break;
            }
        }
Пример #2
0
        private void cboResultsFormat_SelectedIndexChanged(object sender, EventArgs e)
        {
            fclsStylesheetPicker stylesheetPicker;

            switch (this.cboResultsFormat.SelectedIndex)
            {
                case 0:
                    this._resultswriter = new SparqlCsvWriter();
                    this._resultsext = ".csv";
                    break;
                case 1:
                    this._resultswriter = new SparqlRdfWriter(this._rdfwriter);
                    this._resultsext = this._rdfext;
                    break;
                case 2:
                    this._resultswriter = new SparqlHtmlWriter();
                    this._resultsext = ".html";
                    break;
                case 3:
                    stylesheetPicker = new fclsStylesheetPicker("CSS");
                    if (stylesheetPicker.ShowDialog() == DialogResult.OK) 
                    {
                        SparqlHtmlWriter temp = new SparqlHtmlWriter();
                        temp.Stylesheet = stylesheetPicker.StylesheetUri;
                        this._resultswriter = temp;
                    } 
                    else 
                    {
                        this._resultswriter = new SparqlHtmlWriter();
                    }
                    this._resultsext = ".html";
                    break;
                    
                case 4:
                    this._resultswriter = new SparqlJsonWriter();
                    this._resultsext = ".json";
                    break;
                case 5:
                    this._resultswriter = new SparqlTsvWriter();
                    this._resultsext = ".tsv";
                    break;
                case 6:
                    this._resultswriter = new SparqlXmlWriter();
                    this._resultsext = ".srx";
                    break;
                case 7:
                    stylesheetPicker = new fclsStylesheetPicker("XSLT");
                    if (stylesheetPicker.ShowDialog() == DialogResult.OK)
                    {
                        try
                        {
                            this._resultswriter = new SparqlXsltWriter(stylesheetPicker.StylesheetUri);
                            this._resultsext = ".xml";
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show("Unable to use the selected XSLT Stylesheet due to the following error:\n" + ex.Message, "Invalid Stylesheet", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            this.cboResultsFormat.SelectedIndex = 2;
                            this._resultswriter = new SparqlHtmlWriter();
                            this._resultsext = ".html";
                        }
                    }
                    else
                    {
                        this.cboResultsFormat.SelectedIndex = 2;
                        this._resultswriter = new SparqlHtmlWriter();
                        this._resultsext = ".html";
                    }
                    break;
            }
        }
Пример #3
0
        private void cboGraphFormat_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (this.cboGraphFormat.SelectedIndex)
            {
            case 0:
                this._rdfwriter = new CsvWriter();
                this._rdfext    = ".csv";
                break;

            case 1:
                fclsStylesheetPicker stylesheetPicker = new fclsStylesheetPicker("CSS (Optional)");
                if (stylesheetPicker.ShowDialog() == DialogResult.OK)
                {
                    HtmlWriter temp = new HtmlWriter();
                    temp.Stylesheet = stylesheetPicker.StylesheetUri;
                    this._rdfwriter = temp;
                }
                else
                {
                    this._rdfwriter = new HtmlWriter();
                }
                this._rdfext = ".html";
                break;

            case 2:
                this._rdfwriter = new Notation3Writer();
                this._rdfext    = ".n3";
                break;

            case 3:
                this._rdfwriter = new NTriplesWriter();
                this._rdfext    = ".nt";
                break;

            case 4:
                this._rdfwriter = new RdfJsonWriter();
                this._rdfext    = ".json";
                break;

            case 5:
                this._rdfwriter = new RdfXmlWriter();
                this._rdfext    = ".rdf";
                break;

            case 6:
                this._rdfwriter = new CompressingTurtleWriter();
                this._rdfext    = ".ttl";
                break;

            case 7:
                this._rdfwriter = new TsvWriter();
                this._rdfext    = ".tsv";
                break;
            }

            if (this._rdfwriter is ICompressingWriter)
            {
                ((ICompressingWriter)this._rdfwriter).CompressionLevel = WriterCompressionLevel.High;
            }

            if (this.cboResultsFormat.SelectedIndex == 1)
            {
                this._resultswriter = new SparqlRdfWriter(this._rdfwriter);
                this._resultsext    = this._rdfext;
            }
        }
Пример #4
0
        private void cboGraphFormat_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (this.cboGraphFormat.SelectedIndex)
            {
                case 0:
                    this._rdfwriter = new CsvWriter();
                    this._rdfext = ".csv";
                    break;
                case 1:
                    fclsStylesheetPicker stylesheetPicker = new fclsStylesheetPicker("CSS (Optional)");
                    if (stylesheetPicker.ShowDialog() == DialogResult.OK)
                    {
                        HtmlWriter temp = new HtmlWriter();
                        temp.Stylesheet = stylesheetPicker.StylesheetUri;
                        this._rdfwriter = temp;
                    }
                    else
                    {
                        this._rdfwriter = new HtmlWriter();
                    }
                    this._rdfext = ".html";
                    break;
                case 2:
                    this._rdfwriter = new Notation3Writer();
                    this._rdfext = ".n3";
                    break;
                case 3:
                    this._rdfwriter = new NTriplesWriter();
                    this._rdfext = ".nt";
                    break;
                case 4:
                    this._rdfwriter = new RdfJsonWriter();
                    this._rdfext = ".json";
                    break;
                case 5:
                    this._rdfwriter = new RdfXmlWriter();
                    this._rdfext = ".rdf";
                    break;
                case 6:
                    this._rdfwriter = new CompressingTurtleWriter();
                    this._rdfext = ".ttl";
                    break;
                case 7:
                    this._rdfwriter = new TsvWriter();
                    this._rdfext = ".tsv";
                    break;
            }

            if (this._rdfwriter is ICompressingWriter)
            {
                ((ICompressingWriter)this._rdfwriter).CompressionLevel = WriterCompressionLevel.High;
            }

            if (this.cboResultsFormat.SelectedIndex == 1)
            {
                this._resultswriter = new SparqlRdfWriter(this._rdfwriter);
                this._resultsext = this._rdfext;
            }
        }