mirror of
https://github.com/fadden/6502bench.git
synced 2024-11-26 21:49:45 +00:00
83fe70535b
I haven't figured out how to make the AppendText(text, color) extension work right with the WPF version of RichTextBox, but I was able to work around the issue, and it's not really worth sinking time into.
37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
/*
|
|
* Copyright 2019 faddenSoft
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
using System;
|
|
using System.Windows.Media;
|
|
|
|
namespace SourceGenWPF.Tests {
|
|
/// <summary>
|
|
/// Progress message, with colorful text. This is generated by the worker thread and
|
|
/// passed to the UI thread.
|
|
/// </summary>
|
|
public class ProgressMessage {
|
|
public string Text { get; private set; }
|
|
public Color Color { get; private set; }
|
|
public bool HasColor { get { return Color.A != 0; } }
|
|
|
|
public ProgressMessage(string msg) : this(msg, Color.FromArgb(0, 0, 0, 0)) { }
|
|
|
|
public ProgressMessage(string msg, Color color) {
|
|
Text = msg;
|
|
Color = color;
|
|
}
|
|
}
|
|
}
|