public static void Add(NetworkMessage message, Location location, TextColor color, string text)
 {
     message.AddByte((byte)ServerPacketType.AnimatedText);
     message.AddLocation(location);
     message.AddByte((byte)color);
     message.AddString(text);
 }
示例#2
0
 public static bool Send(Objects.Client client, string message, Objects.Location position, TextColor color)
 {
     AnimatedTextPacket p = new AnimatedTextPacket(client);
     p.Message = message;
     p.Location = position;
     p.Color = color;
     return p.Send();
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextScreen"/> class.
 /// </summary>
 /// <param name="textDevice">The text device.</param>
 public TextScreen(ITextDevice textDevice)
 {
     this.textDevice = textDevice;
     width = textDevice.Width;
     height = textDevice.Height;
     foreground = TextColor.Black;
     background = TextColor.White;
     ClearScreen();
 }
示例#4
0
 public static MvcHtmlString FontAwesome(this HtmlHelper htmlHelper, string value, TextColor? color = null)
 {
     var builder = new TagBuilder("i");
     builder.AddCssClass("fa");
     if (value != null)
     {
         builder.AddCssClass("fa-" + value.ToLower());
     }
     if (color != null)
     {
         builder.AddCssClass("text-" + color.ToString().ToLower());
     }
     return MvcHtmlString.Create(builder.ToString());
 }
		void UpdateTextEditorResource(TextColor colorType, string name) {
			var theme = themeService.Theme;

			var color = theme.GetTextColor(colorType.ToColorType());
			Application.Current.Resources[GetTextInheritedForegroundResourceKey(name)] = GetBrush(color.Foreground);
			Application.Current.Resources[GetTextInheritedBackgroundResourceKey(name)] = GetBrush(color.Background);
			Application.Current.Resources[GetTextInheritedFontStyleResourceKey(name)] = color.FontStyle ?? FontStyles.Normal;
			Application.Current.Resources[GetTextInheritedFontWeightResourceKey(name)] = color.FontWeight ?? FontWeights.Normal;

			color = theme.GetColor(colorType.ToColorType());
			Application.Current.Resources[GetInheritedForegroundResourceKey(name)] = GetBrush(color.Foreground);
			Application.Current.Resources[GetInheritedBackgroundResourceKey(name)] = GetBrush(color.Background);
			Application.Current.Resources[GetInheritedFontStyleResourceKey(name)] = color.FontStyle ?? FontStyles.Normal;
			Application.Current.Resources[GetInheritedFontWeightResourceKey(name)] = color.FontWeight ?? FontWeights.Normal;
		}
示例#6
0
        public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
        {
            int position = msg.Position;

            if (msg.GetByte() != (byte)IncomingPacketType.AnimatedText)
                return false;

            Destination = destination;
            Type = IncomingPacketType.AnimatedText;

            Location = msg.GetLocation();
            Color = (TextColor)msg.GetByte();
            Message = msg.GetString();

            return true;
        }
示例#7
0
 public static void changeColor(string number)
 {
     int xndx;
     lev = GameObject.Find ("Player").GetComponent<PlayerController> ().level;
     TextColor tc = new TextColor ();
     num = "n" + PlayerController.currentNum;
     xndx = PlayerController.currentNum % 10;
     xndx = (xndx == 0) ? 10 : xndx;
     if (number == num) {
         GameObject.Find("Player").GetComponent<AudioSource> ().Play ();
         gameOb = GameObject.Find("h" + xndx.ToString());
         gameOb.GetComponent<SpriteRenderer> ().sprite = (Sprite)Resources.Load(number, typeof(Sprite)) as Sprite;
         //Instantiate (colorPart, gameOb.transform.position, gameOb.transform.rotation);
         if (PlayerController.currentNum == PlayerController.target) {
             Congrats.score = PlayerController.lives * 2;
             tc.score();
             SceneManager.LoadScene ("congrats");
         }
         PlayerController.currentNum++;
     }
     else {
         if(PlayerController.lives > 1){
             GameObject.Find("heart1").GetComponent<AudioSource> ().Play ();
             gameOb = GameObject.Find("heart" + PlayerController.lives);
             spr = (Sprite)Resources.Load ("hud_heartEmpty", typeof(Sprite)) as Sprite;
             gameOb.GetComponent<SpriteRenderer> ().sprite = spr;
             //Instantiate (colorPart, gameOb.transform.position, gameOb.transform.rotation);
             PlayerController.lives--;
         }
         else {
             int lev2 = GameObject.Find ("Player").GetComponent<PlayerController> ().level;
             Congrats.score = PlayerController.lives * 2;
             tc.score();
             SceneManager.LoadScene ("congrats");
         }
     }
 }
示例#8
0
        /// <summary>
        /// Use a JSON Object to build the corresponding string
        /// </summary>
        /// <param name="data">JSON object to convert</param>
        /// <param name="colorcode">Allow parent color code to affect child elements (set to "" for function init)</param>
        /// <param name="links">Container for links from JSON serialized text</param>
        /// <returns>returns the Minecraft-formatted string</returns>
        private static string JSONData2String(Json.JSONData data, string colorcode, List <string> links)
        {
            string extra_result = "";

            switch (data.Type)
            {
            case Json.JSONData.DataType.Object:
                if (data.Properties.ContainsKey("color"))
                {
                    colorcode = TextColor.Color2tag(JSONData2String(data.Properties["color"], "", links));
                }
                if (data.Properties.ContainsKey("clickEvent") && links != null)
                {
                    Json.JSONData clickEvent = data.Properties["clickEvent"];
                    if (clickEvent.Properties.ContainsKey("action") &&
                        clickEvent.Properties.ContainsKey("value") &&
                        clickEvent.Properties["action"].StringValue == "open_url" &&
                        !String.IsNullOrEmpty(clickEvent.Properties["value"].StringValue))
                    {
                        links.Add(clickEvent.Properties["value"].StringValue);
                    }
                }
                if (data.Properties.ContainsKey("extra"))
                {
                    Json.JSONData[] extras = data.Properties["extra"].DataArray.ToArray();
                    foreach (Json.JSONData item in extras)
                    {
                        extra_result = extra_result + JSONData2String(item, colorcode, links) + "§r";
                    }
                }
                if (data.Properties.ContainsKey("text"))
                {
                    return(colorcode + JSONData2String(data.Properties["text"], colorcode, links) + extra_result);
                }
                else if (data.Properties.ContainsKey("translate"))
                {
                    List <string> using_data = new List <string>();
                    if (data.Properties.ContainsKey("using") && !data.Properties.ContainsKey("with"))
                    {
                        data.Properties["with"] = data.Properties["using"];
                    }
                    if (data.Properties.ContainsKey("with"))
                    {
                        Json.JSONData[] array = data.Properties["with"].DataArray.ToArray();
                        for (int i = 0; i < array.Length; i++)
                        {
                            using_data.Add(JSONData2String(array[i], colorcode, links));
                        }
                    }
                    return(colorcode + TranslateString(JSONData2String(data.Properties["translate"], "", links), using_data) + extra_result);
                }
                else
                {
                    return(extra_result);
                }

            case Json.JSONData.DataType.Array:
                string result = "";
                foreach (Json.JSONData item in data.DataArray)
                {
                    result += JSONData2String(item, colorcode, links);
                }
                return(result);

            case Json.JSONData.DataType.String:
                return(colorcode + data.StringValue);
            }

            return("");
        }
示例#9
0
 /// <summary>
 /// Writes the char at the position indicated.
 /// </summary>
 /// <param name="x">The x position.</param>
 /// <param name="y">The y position.</param>
 /// <param name="c">The character.</param>
 /// <param name="foreground">The foreground color.</param>
 /// <param name="background">The background color.</param>
 public void WriteChar(ushort x, ushort y, char c, TextColor foreground, TextColor background)
 {
     if (colorMode)
     {
         uint index = (ushort)(offset + (((y * width) + x) * 2));
         memory[index] = (byte)c;
         memory[index + 1] = (byte)((byte)foreground | ((byte)background << 4));
     }
     else
     {
         uint index = (ushort)(offset + (y * width) + x);
         index = index + x;
         memory[index] = (byte)c;
     }
 }
 public void Write(AssetWriter writer)
 {
     Background.Write(writer);
     //writer.WriteAssetArray(m_scaledBackgrounds);
     TextColor.Write(writer);
 }
示例#11
0
        private string ColorToCssClass(TextColor color)
        {
            switch (color)
            {
            case TextColor.Comment:
                return("d-comment");

            case TextColor.Keyword:
                return("d-keyword");

            case TextColor.String:
            case TextColor.VerbatimString:
                return("d-string");

            case TextColor.Char:
                return("d-char");

            case TextColor.Namespace:
                return("d-namespace");

            case TextColor.Type:
                return("d-type");

            case TextColor.SealedType:
                return("d-sealedtype");

            case TextColor.StaticType:
                return("d-statictype");

            case TextColor.Delegate:
                return("d-delegate");

            case TextColor.Enum:
                return("d-enum");

            case TextColor.Interface:
                return("d-interface");

            case TextColor.ValueType:
                return("d-valuetype");

            case TextColor.Module:
                return("d-module");

            case TextColor.TypeGenericParameter:
                return("d-typegenericparameter");

            case TextColor.MethodGenericParameter:
                return("d-methodgenericparameter");

            case TextColor.InstanceMethod:
                return("d-imethod");

            case TextColor.StaticMethod:
                return("d-smethod");

            case TextColor.ExtensionMethod:
                return("d-emethod");

            case TextColor.InstanceField:
                return("d-ifield");

            case TextColor.EnumField:
                return("d-efield");

            case TextColor.LiteralField:
                return("d-lfield");

            case TextColor.StaticField:
                return("d-sfield");

            case TextColor.InstanceEvent:
                return("d-ievent");

            case TextColor.StaticEvent:
                return("d-sevent");

            case TextColor.InstanceProperty:
                return("d-iproperty");

            case TextColor.StaticProperty:
                return("d-sproperty");

            case TextColor.Local:
                return("d-local");

            case TextColor.Parameter:
                return("d-parameter");

            case TextColor.Label:
                return("d-label");

            case TextColor.OpCode:
                return("d-opcode");

            case TextColor.Error:
                return("d-error");

            default:
                return(string.Empty);
            }
        }
示例#12
0
 public static void InBrackets(string message, TextColor outerColor, TextColor innerColor)
 {
     Console.Write("[");
     Console.Write(message);
     Console.Write("]");
 }
示例#13
0
 public void PrintLine(object value, TextColor color) => owner.PrintLine(this, color.Box(), printOptionsImpl, value);
示例#14
0
		public void PrintLine(Exception ex, TextColor color) => owner.PrintLine(this, ex, color);
示例#15
0
		public void Print(TextColor color, string text) => cachedList.Add(new ColorAndText(color, text));
		public IClassificationType GetClassificationType(TextColor color) {
			if (!(0 <= color && color < TextColor.Last))
				color = TextColor.Text;
			return classificationTypes[(int)color];
		}
		/// <summary>
		/// Writes text
		/// </summary>
		/// <param name="color">Color</param>
		/// <param name="text">Text</param>
		public void Write(TextColor color, string text) => sb.Append(text);
示例#18
0
		public void Write(TextColor color, string s) => TextPane.Write(color, s);
示例#19
0
        public static MvcHtmlString FontAwesome(this HtmlHelper htmlHelper, string link, string value, TextColor? color = null)
        {
            var builder = new TagBuilder("a");
            if (value != null)
            {
                builder.InnerHtml = HtmlHelpers.FontAwesome(htmlHelper, value, color).ToString();
            }
            builder.Attributes["href"] = link;

            return MvcHtmlString.Create(builder.ToString());
        }
示例#20
0
    public static string Limit(this string value, int count, TextColor color = TextColor.None, string addon = "")
    {
        int i = 0;

        switch (color)
        {
        case TextColor.Hexadecimal:
            while (i < value.Length)
            {
                int num;
                if (value.HasHexAt(i, out num))
                {
                    i += num;
                }
                else
                {
                    count--;
                    if (count <= 0)
                    {
                        return(value.Remove(i) + addon);
                    }
                    i++;
                }
            }
            return(value);

        case TextColor.RGBA:
            while (i < value.Length)
            {
                int num;
                if (value.HasRGBAAt(i, out num))
                {
                    i += num;
                }
                else
                {
                    count--;
                    if (count <= 0)
                    {
                        return(value.Remove(i) + addon);
                    }
                    i++;
                }
            }
            return(value);

        case TextColor.RGBAHex:
            while (i < value.Length)
            {
                int num;
                if (value.HasHexAt(i, out num))
                {
                    i += num;
                }
                else if (value.HasRGBAAt(i, out num))
                {
                    i += num;
                }
                else
                {
                    count--;
                    if (count <= 0)
                    {
                        return(value.Remove(i) + addon);
                    }
                    i++;
                }
            }
            return(value);

        default:
            if (count < value.Length)
            {
                return(value.Remove(count) + addon);
            }
            return(value);
        }
    }
示例#21
0
 public void Write(string text, TextColor color) => Write(text, color.Box());
示例#22
0
		public void PrintLine(object value, TextColor color) => owner.PrintLine(this, value, color);
示例#23
0
        public void build()
        {
            bf    = BaseFont.CreateFont(AppDomain.CurrentDomain.BaseDirectory + fontAdress, BaseFont.IDENTITY_H, true);
            f2    = new iTextSharp.text.Font(bf, TextSize, iTextSharp.text.Font.NORMAL, new BaseColor(int.Parse(TextColor.Replace("#", ""), System.Globalization.NumberStyles.HexNumber)));
            table = new PdfPTable(numColumns: 1);
            //------------------------
            Paragraph paragraphTables = new Paragraph();
            PdfPCell  pdfCells        = new PdfPCell(new Phrase(" ", f2));
            PdfPTable tables          = new PdfPTable(numColumns: 1);

            tables.AddCell(pdfCells);
            paragraphTables.Add("");
            document.Add(paragraphTables);
            //------------------------

            Paragraph paragraphTable = new Paragraph();

            paragraphTable.SpacingBefore = spacingBefor;
            paragraphTable.SpacingAfter  = spacingAfter;
            paragraphTable.Clear();
            Phrase phrase = new Phrase(stringText, f2);

            pdfCell = new PdfPCell(phrase);
            pdfCell.SetLeading(0, 2);
            if (isRTL)
            {
                table.RunDirection   = PdfWriter.RUN_DIRECTION_RTL;
                pdfCell.RunDirection = PdfWriter.RUN_DIRECTION_RTL;
            }
            else
            {
                table.RunDirection   = PdfWriter.RUN_DIRECTION_LTR;
                pdfCell.RunDirection = PdfWriter.RUN_DIRECTION_LTR;
            }
            if (borderEnable)
            {
                pdfCell.UseVariableBorders = borderEnable;
                pdfCell.BorderWidth        = borderWidth;
                pdfCell.BorderColor        = BorderColor;
            }
            else
            {
                pdfCell.BorderWidth = 0;
            }

            if (isTitle)
            {
            }

            pdfCell.PaddingTop    = paddingTop;
            pdfCell.PaddingRight  = paddingRight;
            pdfCell.PaddingBottom = paddingBottom;
            pdfCell.PaddingLeft   = paddingLeft;

            table.AddCell(pdfCell);
            paragraphTable.Add(table);
            document.Add(paragraphTable);



            //------------------------
            Paragraph paragraphTables2 = new Paragraph();
            PdfPCell  pdfCells2        = new PdfPCell(new Phrase(" ", f2));

            paragraphTables2.Add("");
            document.Add(paragraphTables2);
            //------------------------
        }
示例#24
0
		public void PrintLine(TextColor color, string fmt, params object[] args) => PrintLine(color, string.Format(fmt, args));
示例#25
0
 public void AddFreeString(XYPair position, string t,
                           TextColor tColor = TextColor.White, TextColor bColor = TextColor.Black)
 {
     freeStringBitmap.Add(new FreeString(position, t, tColor, bColor));
 }
示例#26
0
		public void Write(string text, TextColor color) => Print(color, text);
示例#27
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //DATEPICKER
            case nameof(Date):
                return(this.Date.ToString());

            case nameof(Format):
                return(this.Format);

            case nameof(MaximumDate):
                return(this.MaximumDate.ToString());

            case nameof(MinimumDate):
                return(this.MinimumDate.ToString());

            case nameof(TextColor):
                return(TextColor.ToHex());

            default:
                return(string.Empty);
            }
        }
示例#28
0
		public void PrintLine(TextColor color, string text) => PrintLine(color.Box(), text);
示例#29
0
 public void Print(TextColor color, string fmt, params object[] args) => Print(color, string.Format(fmt, args));
示例#30
0
		public void Write(string text, TextColor color) => OutputPrint(text, color.Box());
示例#31
0
		public void WriteLine(string text, TextColor color) => WriteLine(text, color.Box());
示例#32
0
 /// <summary>
 /// Sets the colors of the TextScreen for future writes.
 /// </summary>
 /// <param name="foreground">The text color.</param>
 /// <param name="background">The background color.</param>
 public void SetColor(TextColor foreground, TextColor background)
 {
     this.foreground = foreground;
     this.background = background;
 }
示例#33
0
        void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs args)
        {
            SKImageInfo info = args.Info;

            //determine find smallet axis length
            MinorAxisLength = info.Width > info.Height ? info.Height : info.Width;
            arcWidth        = MinorAxisLength / 30;
            arcPadding      = MinorAxisLength / 15;
            KnobRadius      = MinorAxisLength / 30;
            float radius = (MinorAxisLength / 2);

            //update center
            Center = new SKPoint(info.Width / 2, info.Height / 2);
            SKSurface surface = args.Surface;
            SKCanvas  canvas  = surface.Canvas;

            canvas.Clear();
            // canvas.Scale((float)(canvasView.CanvasSize.Width / canvasView.Width));


            //  SKPaint BackgroundPaint = new SKPaint
            //  {
            //      Style = SKPaintStyle.Fill,
            //      Shader = SKShader.CreateColor(BackgroundColor.ToSKColor()),
            //  };
            //
            //  canvas.DrawRect(new SKRect(Center.X-(MinorAxisLength/2), Center.Y - (MinorAxisLength / 2), Center.X + (MinorAxisLength / 2), Center.Y + (MinorAxisLength / 2)), BackgroundPaint);

            SKPaint arcPaint = new SKPaint
            {
                Style       = SKPaintStyle.Stroke,
                Shader      = SKShader.CreateColor(ArcColor.ToSKColor()),
                StrokeCap   = SKStrokeCap.Round,
                StrokeWidth = arcWidth + 1,
                IsAntialias = true,
            };
            SKPaint arcBackgroundPaint = new SKPaint
            {
                Style       = SKPaintStyle.Stroke,
                Shader      = SKShader.CreateColor(ArcBackgroundColor.ToSKColor()),
                StrokeCap   = SKStrokeCap.Round,
                StrokeWidth = arcWidth,
                IsAntialias = true,
                // ImageFilter = SKImageFilter.CreateDropShadow(0, 0, 2, 2, Color.Black.ToSKColor(), SKDropShadowImageFilterShadowMode.DrawShadowAndForeground)
            };
            SKPaint KnobPaint = new SKPaint
            {
                Style       = SKPaintStyle.Fill,
                Shader      = SKShader.CreateColor(KnobColor.ToSKColor()),
                IsAntialias = true,
                ImageFilter = SKImageFilter.CreateDropShadow(0, 0, 3, 3, ArcColor.MultiplyAlpha(.5).ToSKColor())
            };
            SKPaint TextPaint = new SKPaint
            {
                Style       = SKPaintStyle.Fill,
                Shader      = SKShader.CreateColor(TextColor.ToSKColor()),
                IsAntialias = true,
                TextSize    = 40f,
                IsStroke    = false,
                TextAlign   = SKTextAlign.Center,
            };

            //create the rectangle that contains the arc
            //SKRect rect = new SKRect(arcPadding, arcPadding, MinorAxisLength - arcPadding, MinorAxisLength - arcPadding);
            SKRect rect = new SKRect(arcPadding + Center.X - (MinorAxisLength / 2), arcPadding + Center.Y - (MinorAxisLength / 2), Center.X + (MinorAxisLength / 2) - arcPadding, Center.Y + (MinorAxisLength / 2) - arcPadding);


            //var point = LastTouchedPoint;

            //calcualte the angle of the last touched point realtive to the center of the arc



            var   sweepAngle = getsweepangle();
            float realAngle  = startAngle + sweepAngle;

            //Debug.WriteLine($"realAngle:{realAngle % 360}");



            float arcRadius = (MinorAxisLength / 2) - arcPadding;;

            //get x and y compoents o the point on ther arc
            float x = arcRadius * (float)Math.Cos(DegreeToRadian(realAngle));
            float y = arcRadius * (float)Math.Sin(DegreeToRadian(realAngle));

            //move the points realitve to the center of the chart
            // SKRect rect = new SKRect(arcPadding + Center.X - (MinorAxisLength / 2), arcPadding + Center.Y - (MinorAxisLength / 2), Center.X + (MinorAxisLength / 2) - arcPadding, Center.Y + (MinorAxisLength / 2) - arcPadding);

            float realtiveX = x + Center.X;
            float realtiveY = y + Center.Y;


            using (SKPath path = new SKPath())
            {
                //draw background arc
                path.AddArc(rect, startAngle, 300);
                canvas.DrawPath(path, arcBackgroundPaint);
            }
            using (SKPath path = new SKPath())
            {
                //draw arc showing value
                path.AddArc(rect, startAngle, sweepAngle);
                canvas.DrawPath(path, arcPaint);
            }
            //draw current postion
            var TextBounds  = new SKRect();
            var ValueString = String.Format("{0:F" + Precision + "}", Value);

            TextPaint.MeasureText(ValueString, ref TextBounds);

            canvas.DrawOval(new SKRect(realtiveX - KnobRadius, realtiveY - KnobRadius, realtiveX + KnobRadius, realtiveY + KnobRadius), KnobPaint);
            if (ShowValue)
            {
                canvas.DrawText(ValueString, Center.X, Center.Y + (TextBounds.Height / 2), TextPaint);
            }
        }
示例#34
0
		public void Write(TextColor color, string text) => Add(color.Box(), text);
示例#35
0
 private string StripColor(string text)
 {
     return(TextColor.StripColor(text));
 }
示例#36
0
        public void Apply(UISettings settings)
        {
            MethodInvoker mi = () =>
                                   {
                                       Color fg = settings.ForegroundColor.ToColor();
                                       Color bg = settings.BackgroundColor.ToColor();
                                       Font = new Font(settings.FontName, settings.FontSize,
                                                       FontStyle.Bold);
                                       ForeColor = Color.FromArgb(fg.R, fg.G, fg.B);
                                       BackColor = Color.FromArgb(bg.R, bg.G, bg.B);

                                       _errorColors = new TextColor(settings.ErrorForegroundColor.ToColor(),
                                                                    settings.ErrorBackgroundColor.ToColor());
                                       _warningColors = new TextColor(settings.WarningForegroundColor.ToColor(),
                                                                    settings.WarningBackgroundColor.ToColor());
                                       _debugColors = new TextColor(settings.DebugForegroundColor.ToColor(),
                                                                    settings.DebugBackgroundColor.ToColor());
                                       _verboseColors = new TextColor(settings.VerboseForegroundColor.ToColor(),
                                                                    settings.VerboseBackgroundColor.ToColor());
                                   };
            if (InvokeRequired)
            {
                Invoke(mi);
                return;
            }
            mi.Invoke();
        }
示例#37
0
 protected override void Initialize()
 {
     Effect.Parameters["TextColor"].SetValue(TextColor.ToVector4());
     Effect.Parameters["OutlineColor"].SetValue(OutlineColor.ToVector4());
     Effect.Parameters["AAColor"].SetValue(AAColor.ToVector4());
 }
示例#38
0
 private void WriteLine(string value, TextColor colors)
 {
     WriteLine( value, FontStyle.Bold, colors.ForeColor, colors.BackColor );
 }
示例#39
0
 public void PrintLine(TextColor color, string text) => owner.PrintLine(this, color.Box(), text);
示例#40
0
		void IReplEditor.OutputPrintLine(string text, TextColor color, bool startOnNewLine) =>
			((IReplEditor)this).OutputPrint(text + Environment.NewLine, color.Box(), startOnNewLine);
示例#41
0
 public void PrintLine(Exception ex, TextColor color) => owner.PrintLine(this, color.Box(), ex);
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="textColor">Color</param>
		protected ThemeClassificationFormatDefinition(TextColor textColor) {
			this.textColor = textColor;
		}
示例#43
0
 public static string GetName(this TextColor color)
 {
     return(ColorNames[(byte)color]);
 }
示例#44
0
 public static void InBrackets(string message, TextColor outerColor, TextColor innerColor)
 {
     Console.Write("[");
     Console.Write(message);
     Console.Write("]");
 }
示例#45
0
 public void AddFreeString(int row, string t,
                           TextColor tColor    = TextColor.White, TextColor bColor = TextColor.Black,
                           Alignment alignment = Alignment.Centered)
 {
     freeStringBitmap.Add(new FreeString(row, t, tColor, bColor, alignment));
 }
示例#46
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AnimatedTextPacket"/> class.
 /// </summary>
 /// <param name="location">The location of the animated text.</param>
 /// <param name="color">The text color.</param>
 /// <param name="text">The contents of the text.</param>
 public AnimatedTextPacket(Location location, TextColor color, string text)
 {
     this.Location = location;
     this.Color    = color;
     this.Text     = text;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="textColor">Color</param>
 protected ThemeClassificationFormatDefinition(TextColor textColor)
 {
     this.textColor = textColor;
 }
示例#48
0
 public void DrawString(Vector2 position, string text, IFont font, TextColor color, FontStyle style, Vector2?scale = null,
                        float rotation = 0f, Vector2?rotationOrigin = null, float opacity = 1f)
 {
     font?.DrawString(SpriteBatch, text, position, color, style, scale, opacity, rotation, rotationOrigin);
 }
 private void Awake()
 {
     _inputManager = FindObjectOfType <InputManager>();
     _coloredText  = GetComponentInChildren <TextColor>();
     _button       = GetComponent <Selectable>();
 }
示例#50
0
 //色
 public static string Coloring(this string str, TextColor color)
 {
     return(string.Format("<color={0}>{1}</color>", color, str));
 }
示例#51
0
 public void Write(TextColor color, string text) => Add(color.Box(), text);
示例#52
0
文件: PSTextBox.cs 项目: wangzq/bips
 private void WriteLine(string value, TextColor colors)
 {
     WriteLine(value, FontStyle.Bold, colors.ForeColor, colors.BackColor);
 }
示例#53
0
 public void Print(TextColor color, string?text) => cachedList.Add(new ColorAndText(color, text ?? string.Empty));
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="textColor">Color</param>
		protected ThemeMarkerFormatDefinition(TextColor textColor) {
			this.textColor = textColor;
		}
示例#55
0
 public void Print(Exception ex, TextColor color) => owner.Print(this, ex, color);
        private void drawRow(ChartControl chartControl, ChartScale chartScale, double value, int quantity)
        {
            //Calculate color of this row.
            Brush brushColor = NormalColor;

            if (value <= MaxId + ValueArea && value >= MaxId - ValueArea)
            {
                brushColor = ValueColor;
            }


            //Calculate cell properties
            double y1 = ((chartScale.GetYByValue(value) + chartScale.GetYByValue(value + 1)) / 2) + 1;
            double y2 = ((chartScale.GetYByValue(value) + chartScale.GetYByValue(value - 1)) / 2) - 1;

            SharpDX.RectangleF rect = new SharpDX.RectangleF();
            rect.X      = (float)chartControl.CanvasRight;
            rect.Y      = (float)y1;
            rect.Width  = (float)((chartControl.CanvasLeft - chartControl.CanvasRight) * Math.Log(quantity) / Math.Log(Max));
            rect.Height = (float)Math.Abs(y1 - y2);

            //Draw the row.
            using (SharpDX.Direct2D1.Brush rowBrush = brushColor.ToDxBrush(RenderTarget))
            {
                RenderTarget.FillRectangle(rect, rowBrush);
                //RenderTarget.FillRectangle(rect, rowBrush);
            }

            if (rect.Height > this.MinimumTextHeight)
            {
                RenderTarget.DrawText(string.Format("{0}", quantity), textFormat, rect, TextColor.ToDxBrush(RenderTarget));
            }
        }
示例#57
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="color">Color</param>
		/// <param name="text">Text</param>
		public ColorAndText(TextColor color, string text) {
			Color = color.Box();
			Text = text;
		}
示例#58
0
 public void AcceptAttributeTextColor(TextColor textColor, PrintContext parameter)
 {
     parameter.WriteLine("Text Color: {0}", textColor.Color);
 }
示例#59
0
 public void SetColor(TextColor color)
 {
     this.color    = color;
     coloredString = FormatColoredChar();
 }
示例#60
0
        public void SendAnimatedText(Location location, string text, TextColor color)
        {
            NetworkMessage outMessage = new NetworkMessage();

            AnimatedTextPacket.Add(
                outMessage,
                location,
                color,
                text
            );

            Send(outMessage);
        }