예제 #1
0
        public QueryWindow(IQueryVM iQueryVM)
        {
            vm = iQueryVM;
            DataContext = vm;
            InitializeComponent();

            IHighlightingDefinition customHighlighting;
            using (Stream s = typeof(QueryWindow).Assembly.GetManifestResourceStream("Schema.Views.CustomHighlighting.xshd"))
            {
                if (s == null)
                    throw new InvalidOperationException("Could not find embedded resource");
                using (XmlReader reader = new XmlTextReader(s))
                {
                    customHighlighting = ICSharpCode.AvalonEdit.Highlighting.Xshd.
                        HighlightingLoader.Load(reader, HighlightingManager.Instance);
                }
            }
            // and register it in the HighlightingManager
            HighlightingManager.Instance.RegisterHighlighting("Custom Highlighting", new string[] { ".cool" }, customHighlighting);
            txtQuery.SyntaxHighlighting = customHighlighting;
        }
예제 #2
0
        public QueryWindow(IQueryVM iQueryVM)
        {
            vm          = iQueryVM;
            DataContext = vm;
            InitializeComponent();

            IHighlightingDefinition customHighlighting;

            using (Stream s = typeof(QueryWindow).Assembly.GetManifestResourceStream("Schema.Views.CustomHighlighting.xshd"))
            {
                if (s == null)
                {
                    throw new InvalidOperationException("Could not find embedded resource");
                }
                using (XmlReader reader = new XmlTextReader(s))
                {
                    customHighlighting = ICSharpCode.AvalonEdit.Highlighting.Xshd.
                                         HighlightingLoader.Load(reader, HighlightingManager.Instance);
                }
            }
            // and register it in the HighlightingManager
            HighlightingManager.Instance.RegisterHighlighting("Custom Highlighting", new string[] { ".cool" }, customHighlighting);
            txtQuery.SyntaxHighlighting = customHighlighting;
        }