mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 10:10:45 +08:00
84 lines
2.4 KiB
C#
84 lines
2.4 KiB
C#
// <copyright file="LogItemViewModel.cs" company="MaaAssistantArknights">
|
|
// MaaWpfGui - A part of the MaaCoreArknights project
|
|
// Copyright (C) 2021 MistEO and Contributors
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY
|
|
// </copyright>
|
|
|
|
using System;
|
|
using Stylet;
|
|
|
|
namespace MaaWpfGui
|
|
{
|
|
/// <summary>
|
|
/// The view model of log item.
|
|
/// </summary>
|
|
public class LogItemViewModel : PropertyChangedBase
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="LogItemViewModel"/> class.
|
|
/// </summary>
|
|
/// <param name="content">The content.</param>
|
|
/// <param name="color">The font color.</param>
|
|
/// <param name="weight">The font weight.</param>
|
|
/// <param name="timeColumnContent">The content in time column.</param>
|
|
public LogItemViewModel(string content, string color = UILogColor.Message, string weight = "Regular", string timeColumnContent = null)
|
|
{
|
|
Time = string.Concat(DateTime.Now.ToString("MM'-'dd' 'HH':'mm':'ss"), "\n", timeColumnContent);
|
|
Content = content;
|
|
Color = color;
|
|
Weight = weight;
|
|
}
|
|
|
|
private string _time;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the time.
|
|
/// </summary>
|
|
public string Time
|
|
{
|
|
get => _time;
|
|
set => SetAndNotify(ref _time, value);
|
|
}
|
|
|
|
private string _content;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the content.
|
|
/// </summary>
|
|
public string Content
|
|
{
|
|
get => _content;
|
|
set => SetAndNotify(ref _content, value);
|
|
}
|
|
|
|
private string _color;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the font color.
|
|
/// </summary>
|
|
public string Color
|
|
{
|
|
get => _color;
|
|
set => SetAndNotify(ref _color, value);
|
|
}
|
|
|
|
private string _weight;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the font weight.
|
|
/// </summary>
|
|
public string Weight
|
|
{
|
|
get => _weight;
|
|
set => SetAndNotify(ref _weight, value);
|
|
}
|
|
}
|
|
}
|