Beispiel #1
0
            public Entry(LiteResult result)
            {
                MouseFilter = MouseFilterMode.Stop;
                Result      = result;
                var compl = new FormattedMessage.Builder();
                var dim   = Color.FromHsl((0f, 0f, 0.8f, 1f));

                // warning: ew ahead
                string basen = "default";

                if (Result.Tags.Contains("Interface"))
                {
                    basen = "interface name";
                }
                else if (Result.Tags.Contains("Class"))
                {
                    basen = "class name";
                }
                else if (Result.Tags.Contains("Struct"))
                {
                    basen = "struct name";
                }
                else if (Result.Tags.Contains("Keyword"))
                {
                    basen = "keyword";
                }
                else if (Result.Tags.Contains("Namespace"))
                {
                    basen = "namespace name";
                }
                else if (Result.Tags.Contains("Method"))
                {
                    basen = "method name";
                }
                else if (Result.Tags.Contains("Property"))
                {
                    basen = "property name";
                }
                else if (Result.Tags.Contains("Field"))
                {
                    basen = "field name";
                }

                Color basec = ScriptingColorScheme.ColorScheme[basen];

                compl.PushColor(basec * dim);
                compl.AddText(Result.DisplayTextPrefix);
                compl.PushColor(basec);
                compl.AddText(Result.DisplayText);
                compl.PushColor(basec * dim);
                compl.AddText(Result.DisplayTextSuffix);
                compl.AddText(" [" + String.Join(", ", Result.Tags) + "]");
                if (Result.InlineDescription.Length != 0)
                {
                    compl.PushNewline();
                    compl.AddText(": ");
                    compl.PushColor(Color.LightSlateGray);
                    compl.AddText(Result.InlineDescription);
                }
                SetMessage(compl.Build());
            }