Exemple #1
0
        public void LoadSyntaxHighlighting(HighlightingType highlighting)
        {
            Stream xshdStream;

            switch (highlighting)
            {
            case HighlightingType.ShaderBuilder:
                xshdStream = File.OpenRead("SBSyntaxHighlighting.xshd");
                break;

            case HighlightingType.Tim:
                xshdStream = File.OpenRead("SyntaxHighlighting.xshd");
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(highlighting));
            }


            XmlTextReader xshdReader = new XmlTextReader(xshdStream);

            Editor.SyntaxHighlighting = ICSharpCode.AvalonEdit.Highlighting.Xshd.HighlightingLoader.Load(xshdReader, ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance);
            xshdReader.Close();
            xshdStream.Close();
        }
Exemple #2
0
        void UpdateSpanInfos(HighlightingType highlightingType, ImmutableArray <SpanInfo> spanInfos, FileVersion version)
        {
            var classifierOpt = GetClassifierOpt();

            if (classifierOpt == null)
            {
                return;
            }
            classifierOpt.Update(highlightingType, spanInfos, version);
        }
        internal void Update(HighlightingType highlightingType, ImmutableArray <SpanInfo> spanInfos, FileVersion version)
        {
            if (ClassificationChanged == null)
            {
                return;
            }

            var snapshot = _buffer.CurrentSnapshot;

            if (snapshot.Version.Convert() != version)
            {
                return;
            }

            _snapshots[(int)highlightingType] = snapshot;
            _spanInfos[(int)highlightingType] = spanInfos;
            ClassificationChanged(this, new ClassificationChangedEventArgs(new SnapshotSpan(snapshot, new Span(0, snapshot.Length))));
        }
Exemple #4
0
    internal void Update(HighlightingType highlightingType, ImmutableArray<SpanInfo> spanInfos, FileVersion version)
    {
      if (ClassificationChanged == null)
        return;

      var snapshot = _buffer.CurrentSnapshot;

      if (snapshot.Version.Convert() != version)
        return;

      _snapshots[(int)highlightingType] = snapshot;
      _spanInfos[(int)highlightingType] = spanInfos;
      ClassificationChanged(this, new ClassificationChangedEventArgs(new SnapshotSpan(snapshot, new Span(0, snapshot.Length))));
    }
Exemple #5
0
 void UpdateSpanInfos(HighlightingType highlightingType, ImmutableArray<SpanInfo> spanInfos, FileVersion version)
 {
   var classifierOpt = GetClassifierOpt();
   if (classifierOpt == null)
     return;
   classifierOpt.Update(highlightingType, spanInfos, version);
 }
Exemple #6
0
    void UpdateSpanInfos(ITextBuffer textBuffer, HighlightingType highlightingType, ImmutableArray<SpanInfo> spanInfos, FileVersion version)
    {
      if (!textBuffer.Properties.ContainsProperty(Constants.NitraEditorClassifierKey))
        return;

      var tegget = (NitraEditorClassifier)textBuffer.Properties.GetProperty(Constants.NitraEditorClassifierKey);
      tegget.Update(highlightingType, spanInfos, version);
    }