コード例 #1
0
        public OpenQueryResults()
        {
            InitializeComponent();

            this._manager = new EditorManager(queryEditor);
            this._manager.SetHighlighter("SparqlQuery11");
            this._manager.SetAutoCompleter("SparqlQuery11");
            this._manager.SetSymbolSelector(new WhiteSpaceSelector());
        }
コード例 #2
0
        public EditorWindow()
        {
            InitializeComponent();

            //Create the Editor Manager
            this._manager = new EditorManager(this.textEditor, this.mnuCurrentHighlighter, this.stsCurrSyntax, this.stsSyntaxValidation, this.mnuSymbolBoundaries);
          
            //Set up the Editor Options
            TextEditorOptions options = new TextEditorOptions();
            options.EnableEmailHyperlinks = Properties.Settings.Default.EnableClickableUris;
            options.EnableHyperlinks = Properties.Settings.Default.EnableClickableUris;
            options.ShowEndOfLine = Properties.Settings.Default.ShowEndOfLine;
            options.ShowSpaces = Properties.Settings.Default.ShowSpaces;
            options.ShowTabs = Properties.Settings.Default.ShowTabs;
            textEditor.Options = options;
            textEditor.ShowLineNumbers = true;
            if (Properties.Settings.Default.EditorFontFace != null)
            {
                textEditor.FontFamily = Properties.Settings.Default.EditorFontFace;
            }
            textEditor.FontSize = Math.Round(Properties.Settings.Default.EditorFontSize, 0);
            textEditor.Foreground = new SolidColorBrush(Properties.Settings.Default.EditorForeground);
            textEditor.Background = new SolidColorBrush(Properties.Settings.Default.EditorBackground);
            
            //Setup Options based on the User Config file
            if (!Properties.Settings.Default.UseUtf8Bom)
            {
                this.mnuUseBomForUtf8.IsChecked = false;
                Options.UseBomForUtf8 = false;
            }
            if (!Properties.Settings.Default.EnableSymbolSelection)
            {
                this._manager.IsSymbolSelectionEnabled = false;
                this.mnuSymbolSelectEnabled.IsChecked = false;
            }
            if (!Properties.Settings.Default.IncludeSymbolBoundaries)
            {
                this._manager.IncludeBoundaryInSymbolSelection = false;
                this.mnuSymbolSelectIncludeBoundary.IsChecked = false;
            }
            if (!Properties.Settings.Default.EnableAutoComplete) 
            {
                this._manager.IsAutoCompleteEnabled = false;
                this.mnuAutoComplete.IsChecked = false;
            }
            if (!Properties.Settings.Default.EnableHighlighting)
            {
                this._manager.IsHighlightingEnabled = false;
                this.mnuEnableHighlighting.IsChecked = false;
            }
            if (!Properties.Settings.Default.EnableValidateAsYouType)
            {
                this._manager.IsValidateAsYouType = false;
                this.mnuValidateAsYouType.IsChecked = false;
            }
            if (!Properties.Settings.Default.ShowLineNumbers)
            {
                textEditor.ShowLineNumbers = false;
                this.mnuShowLineNumbers.IsChecked = false;
            }
            if (Properties.Settings.Default.WordWrap)
            {
                textEditor.WordWrap = true;
                this.mnuWordWrap.IsChecked = true;
            }
            if (Properties.Settings.Default.EnableClickableUris)
            {
                this.mnuClickableUris.IsChecked = true;
            }
            if (Properties.Settings.Default.ShowEndOfLine)
            {
                this.mnuShowSpecialEOL.IsChecked = true;
            }
            if (Properties.Settings.Default.ShowSpaces)
            {
                this.mnuShowSpecialSpaces.IsChecked = true;
            }
            if (Properties.Settings.Default.ShowTabs)
            {
                this.mnuShowSpecialTabs.IsChecked = true;
            }
            this._manager.SetHighlighter(Properties.Settings.Default.DefaultHighlighter);

            //Enable/Disable state dependent menu options
            this.mnuUndo.IsEnabled = textEditor.CanUndo;
            this.mnuRedo.IsEnabled = textEditor.CanRedo;

            //Create our Dialogs
            _ofd.Title = "Open RDF/SPARQL File";
            _ofd.DefaultExt = ".rdf";
            _ofd.Filter = FileFilterAll;
            _sfd.Title = "Save RDF/SPARQL File";
            _sfd.DefaultExt = ".rdf";
            _sfd.Filter = _ofd.Filter;

            //Setup dropping of files
            textEditor.AllowDrop = true;
            textEditor.Drop += new DragEventHandler(textEditor_Drop);
        }