Example #1
0
 public AProtobufMessageVarNameClassificationFormatDefinition()
 {
     DisplayName = "Protobuf-Extension message field name ";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 189;
         color.G         = 183;
         color.B         = 107;
         ForegroundColor = color;
     }
     else
     {
         ForegroundColor = Colors.Navy;
     }
 }
Example #2
0
 public AProtobufNumberClassificationFormatDefinition()
 {
     DisplayName = "Protobuf-Extension number";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 181;
         color.G         = 206;
         color.B         = 168;
         ForegroundColor = color;
     }
     else
     {
         ForegroundColor = Colors.Black;
     }
 }
Example #3
0
 public AProtobufKeyWordClassificationFormatDefinition()
 {
     DisplayName = "Protobuf-Extension keyword ";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 86;
         color.G         = 154;
         color.B         = 214;
         ForegroundColor = color;
     }
     else
     {
         ForegroundColor = Colors.Blue;
     }
 }
Example #4
0
 public AProtobufTextClassificationFormatDefinition()
 {
     DisplayName = "Protobuf-Extension text";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 214;
         color.G         = 157;
         color.B         = 113;
         ForegroundColor = color;
     }
     else
     {
         ForegroundColor = Colors.DarkRed;
     }
 }
 public ALittleScriptDefaultClassificationFormatDefinition()
 {
     DisplayName = "ALittleScript默认";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 180;
         color.G         = 180;
         color.B         = 180;
         ForegroundColor = color;
     }
     else
     {
         ForegroundColor = Colors.Black;
     }
 }
Example #6
0
 public AProtobufCommentClassificationFormatDefinition()
 {
     DisplayName = "Protobuf-Extension comments";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 87;
         color.G         = 166;
         color.B         = 74;
         ForegroundColor = color;
     }
     else
     {
         ForegroundColor = Colors.Green;
     }
 }
 public ALittleScriptKeyWordClassificationFormatDefinition()
 {
     DisplayName = "ALittleScript关键字";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 86;
         color.G         = 154;
         color.B         = 214;
         ForegroundColor = color;
     }
     else
     {
         ForegroundColor = Colors.Blue;
     }
 }
 public ALittleScriptMethodNameClassificationFormatDefinition()
 {
     DisplayName = "ALittleScript方法名";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 255;
         color.G         = 128;
         color.B         = 0;
         ForegroundColor = color;
     }
     else
     {
         ForegroundColor = Colors.DarkRed;
     }
 }
 public ALittleScriptTextClassificationFormatDefinition()
 {
     DisplayName = "ALittleScript字符串";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 214;
         color.G         = 157;
         color.B         = 113;
         ForegroundColor = color;
     }
     else
     {
         ForegroundColor = Colors.DarkRed;
     }
 }
 public ALittleScriptCommentClassificationFormatDefinition()
 {
     DisplayName = "ALittleScript注释";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 87;
         color.G         = 166;
         color.B         = 74;
         ForegroundColor = color;
     }
     else
     {
         ForegroundColor = Colors.Green;
     }
 }
 public ALittleScriptVarNameClassificationFormatDefinition()
 {
     DisplayName = "ALittleScript变量名";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 189;
         color.G         = 183;
         color.B         = 107;
         ForegroundColor = color;
     }
     else
     {
         ForegroundColor = Colors.Navy;
     }
 }
Example #12
0
 public AProtobufEnumVarNameClassificationFormatDefinition()
 {
     DisplayName = "Protobuf-Extension enumeration field name ";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 185;
         color.G         = 119;
         color.B         = 30;
         ForegroundColor = color;
     }
     else
     {
         ForegroundColor = Colors.DarkSlateGray;
     }
 }
Example #13
0
        public ALittleScriptGotoDefinitionClassificationFormatDefinition()
        {
            this.DisplayName     = "ALittleScriptGotoDefinition";
            this.TextDecorations = System.Windows.TextDecorations.Underline;

            if (ALanguageUtility.IsDarkTheme())
            {
                var color = new Color();
                color.A         = 255;
                color.R         = 86;
                color.G         = 154;
                color.B         = 214;
                ForegroundColor = color;
            }
            else
            {
                this.ForegroundColor = Colors.Blue;
            }
        }
Example #14
0
 public AProtobufCustomNameClassificationFormatDefinition()
 {
     DisplayName = "Protobuf-Extension message & enumeration name";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 78;
         color.G         = 201;
         color.B         = 176;
         ForegroundColor = color;
     }
     else
     {
         var color = new Color();
         color.A         = 0xFF;
         color.R         = 0x21;
         color.G         = 0x6F;
         color.B         = 0x85;
         ForegroundColor = color;
     }
 }
 public ALittleScriptCtrlKeyWordClassificationFormatDefinition()
 {
     DisplayName = "ALittleScript控制关键字";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 216;
         color.G         = 160;
         color.B         = 223;
         ForegroundColor = color;
     }
     else
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 143;
         color.G         = 8;
         color.B         = 196;
         ForegroundColor = color;
     }
 }
 public ALittleScriptCustomNameClassificationFormatDefinition()
 {
     DisplayName = "ALittleScript类型名";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 255;
         color.G         = 215;
         color.B         = 0;
         ForegroundColor = color;
     }
     else
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 33;
         color.G         = 111;
         color.B         = 133;
         ForegroundColor = color;
     }
 }
 public ALittleScriptDefineNameClassificationFormatDefinition()
 {
     DisplayName = "ALittleScript定义名";
     if (ALanguageUtility.IsDarkTheme())
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 78;
         color.G         = 201;
         color.B         = 176;
         ForegroundColor = color;
     }
     else
     {
         var color = new Color();
         color.A         = 255;
         color.R         = 43;
         color.G         = 145;
         color.B         = 175;
         ForegroundColor = color;
     }
 }
Example #18
0
        public ALittleScriptHighlightWordFormatDefinition()
        {
            DisplayName = "ALittleScript高亮";
            if (ALanguageUtility.IsDarkTheme())
            {
                var color = new Color();
                color.A         = 255;
                color.R         = 14;
                color.G         = 69;
                color.B         = 131;
                BackgroundColor = color;

                color           = new Color();
                color.A         = 255;
                color.R         = 173;
                color.G         = 192;
                color.B         = 211;
                ForegroundColor = color;
            }
            else
            {
                BackgroundColor = Colors.LightBlue;
            }
        }
Example #19
0
        public void Refresh(long version, List <ALanguageReferenceInfo> info_list)
        {
            // 获取版本号
            if (!m_view.Properties.TryGetProperty("version", out long id))
            {
                return;
            }
            if (version != id)
            {
                return;
            }
            if (m_view.TextSnapshot.Length == 0)
            {
                return;
            }
            var wpf_view = m_view as IWpfTextView;

            if (wpf_view == null)
            {
                return;
            }

            var list = new List <IntraTextAdornmentTag>();

            foreach (var pair in m_reference_map)
            {
                list.Add(pair.Value.Tag);
            }

            m_reference_map.Clear();
            foreach (var info in info_list)
            {
                if (m_reference_map.ContainsKey(info.line))
                {
                    continue;
                }

                int e_end = info.start;
                if (e_end >= m_view.TextSnapshot.Length)
                {
                    e_end = m_view.TextSnapshot.Length - 1;
                }

                var span = new SnapshotSpan(m_view.TextSnapshot, e_end, 0);

                IntraTextAdornmentTag tag;
                if (list.Count > 0)
                {
                    tag = list[list.Count - 1];
                    list.RemoveAt(list.Count - 1);
                    var cc = tag.Adornment as Canvas;
                    if (cc != null && cc.Children.Count > 0)
                    {
                        var ui = cc.Children[0] as TextBlock;
                        if (ui != null)
                        {
                            ui.Text = "[" + info.count + "个引用]";
                        }
                    }
                }
                else
                {
                    var cc    = new Canvas();
                    var ui    = new TextBlock();
                    var brush = new SolidColorBrush();
                    var color = new System.Windows.Media.Color();
                    if (ALanguageUtility.IsDarkTheme())
                    {
                        color.A = 255;
                        color.R = 181;
                        color.G = 206;
                        color.B = 168;
                    }
                    else
                    {
                        color.A = 255;
                        color.R = 128;
                        color.G = 128;
                        color.B = 128;
                    }
                    brush.Color   = color;
                    ui.Foreground = brush;
                    var font_size = ui.FontSize;
                    ui.FontSize -= 2;
                    ui.Text      = "[" + info.count + "个引用]";
                    ui.Foreground.Freeze();
                    (cc as IAddChild).AddChild(ui);
                    Canvas.SetTop(ui, -m_view.LineHeight);
                    tag = new IntraTextAdornmentTag(cc, null, m_view.LineHeight, font_size, 0, 0, PositionAffinity.Successor);
                }
                var tag_span = new TagSpan <IntraTextAdornmentTag>(span, tag);
                m_reference_map.Add(info.line, tag_span);
            }

            {
                var span = new SnapshotSpan(m_view.TextSnapshot, 0, m_view.TextSnapshot.Length);
                TagsChanged?.Invoke(this, new SnapshotSpanEventArgs(span));
            }
        }