mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-21 00:38:37 +00:00
Work on GUI
There is still a long way till it's done...
This commit is contained in:
@@ -47,6 +47,8 @@ namespace ArchiSteamFarm {
|
|||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
internal byte CardsRemaining { get; set; }
|
internal byte CardsRemaining { get; set; }
|
||||||
|
|
||||||
|
internal string HeaderURL => "https://steamcdn-a.akamaihd.net/steam/apps/" + AppID + "/header.jpg";
|
||||||
|
|
||||||
internal Game(uint appID, string gameName, float hoursPlayed, byte cardsRemaining) {
|
internal Game(uint appID, string gameName, float hoursPlayed, byte cardsRemaining) {
|
||||||
if ((appID == 0) || string.IsNullOrEmpty(gameName) || (hoursPlayed < 0) || (cardsRemaining == 0)) {
|
if ((appID == 0) || string.IsNullOrEmpty(gameName) || (hoursPlayed < 0) || (cardsRemaining == 0)) {
|
||||||
throw new ArgumentOutOfRangeException(nameof(appID) + " || " + nameof(gameName) + " || " + nameof(hoursPlayed) + " || " + nameof(cardsRemaining));
|
throw new ArgumentOutOfRangeException(nameof(appID) + " || " + nameof(gameName) + " || " + nameof(hoursPlayed) + " || " + nameof(cardsRemaining));
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ namespace ArchiSteamFarm {
|
|||||||
internal const string EventLogSource = EventLog + "Logger";
|
internal const string EventLogSource = EventLog + "Logger";
|
||||||
|
|
||||||
internal const string ASF = "ASF";
|
internal const string ASF = "ASF";
|
||||||
|
internal const string ASFDirectory = "ArchiSteamFarm";
|
||||||
internal const string ConfigDirectory = "config";
|
internal const string ConfigDirectory = "config";
|
||||||
internal const string DebugDirectory = "debug";
|
internal const string DebugDirectory = "debug";
|
||||||
internal const string LogFile = "log.txt";
|
internal const string LogFile = "log.txt";
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ using ArchiSteamFarm;
|
|||||||
|
|
||||||
namespace ConfigGenerator {
|
namespace ConfigGenerator {
|
||||||
internal static class Program {
|
internal static class Program {
|
||||||
private const string ASFDirectory = "ArchiSteamFarm";
|
|
||||||
private const string ASFExecutableFile = SharedInfo.ASF + ".exe";
|
private const string ASFExecutableFile = SharedInfo.ASF + ".exe";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -60,11 +59,11 @@ namespace ConfigGenerator {
|
|||||||
// Common structure is bin/(x64/)Debug/ArchiSteamFarm.exe, so we allow up to 4 directories up
|
// Common structure is bin/(x64/)Debug/ArchiSteamFarm.exe, so we allow up to 4 directories up
|
||||||
for (byte i = 0; i < 4; i++) {
|
for (byte i = 0; i < 4; i++) {
|
||||||
Directory.SetCurrentDirectory("..");
|
Directory.SetCurrentDirectory("..");
|
||||||
if (!Directory.Exists(ASFDirectory)) {
|
if (!Directory.Exists(SharedInfo.ASFDirectory)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Directory.SetCurrentDirectory(ASFDirectory);
|
Directory.SetCurrentDirectory(SharedInfo.ASFDirectory);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
34
GUI/Form1.Designer.cs
generated
34
GUI/Form1.Designer.cs
generated
@@ -1,34 +0,0 @@
|
|||||||
namespace GUI {
|
|
||||||
partial class Form1 {
|
|
||||||
/// <summary>
|
|
||||||
/// Required designer variable.
|
|
||||||
/// </summary>
|
|
||||||
private System.ComponentModel.IContainer components = null;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clean up any resources being used.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
|
||||||
protected override void Dispose(bool disposing) {
|
|
||||||
if (disposing && (components != null)) {
|
|
||||||
components.Dispose();
|
|
||||||
}
|
|
||||||
base.Dispose(disposing);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Required method for Designer support - do not modify
|
|
||||||
/// the contents of this method with the code editor.
|
|
||||||
/// </summary>
|
|
||||||
private void InitializeComponent() {
|
|
||||||
this.components = new System.ComponentModel.Container();
|
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
|
||||||
this.Text = "Form1";
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
17
GUI/Form1.cs
17
GUI/Form1.cs
@@ -1,17 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace GUI {
|
|
||||||
public partial class Form1 : Form {
|
|
||||||
public Form1() {
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -48,6 +48,10 @@
|
|||||||
<HintPath>..\packages\NLog.4.4.0-betaV15\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.4.4.0-betaV15\lib\net45\NLog.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="NLog.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\NLog.Windows.Forms.4.2.3\lib\net35\NLog.Windows.Forms.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="protobuf-net, Version=2.0.0.668, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
|
<Reference Include="protobuf-net, Version=2.0.0.668, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\protobuf-net.2.0.0.668\lib\net40\protobuf-net.dll</HintPath>
|
<HintPath>..\packages\protobuf-net.2.0.0.668\lib\net40\protobuf-net.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@@ -129,9 +133,6 @@
|
|||||||
<Compile Include="..\ArchiSteamFarm\JSON\Steam.cs">
|
<Compile Include="..\ArchiSteamFarm\JSON\Steam.cs">
|
||||||
<Link>JSON\Steam.cs</Link>
|
<Link>JSON\Steam.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="..\ArchiSteamFarm\Logging.cs">
|
|
||||||
<Link>Logging.cs</Link>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="..\ArchiSteamFarm\MobileAuthenticator.cs">
|
<Compile Include="..\ArchiSteamFarm\MobileAuthenticator.cs">
|
||||||
<Link>MobileAuthenticator.cs</Link>
|
<Link>MobileAuthenticator.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -147,20 +148,21 @@
|
|||||||
<Compile Include="..\ArchiSteamFarm\Utilities.cs">
|
<Compile Include="..\ArchiSteamFarm\Utilities.cs">
|
||||||
<Link>Utilities.cs</Link>
|
<Link>Utilities.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="..\ArchiSteamFarm\WCF.cs">
|
|
||||||
<Link>WCF.cs</Link>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="..\ArchiSteamFarm\WebBrowser.cs">
|
<Compile Include="..\ArchiSteamFarm\WebBrowser.cs">
|
||||||
<Link>WebBrowser.cs</Link>
|
<Link>WebBrowser.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Form1.cs">
|
<Compile Include="MainForm.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Form1.Designer.cs">
|
<Compile Include="MainForm.Designer.cs">
|
||||||
<DependentUpon>Form1.cs</DependentUpon>
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Logging.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<EmbeddedResource Include="MainForm.resx">
|
||||||
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
|||||||
187
GUI/Logging.cs
Normal file
187
GUI/Logging.cs
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
/*
|
||||||
|
_ _ _ ____ _ _____
|
||||||
|
/ \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
|
||||||
|
/ _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
|
||||||
|
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||||
|
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||||
|
|
||||||
|
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||||
|
Contact: JustArchi@JustArchi.net
|
||||||
|
|
||||||
|
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.Diagnostics;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using NLog;
|
||||||
|
using NLog.Config;
|
||||||
|
using NLog.Targets;
|
||||||
|
using NLog.Windows.Forms;
|
||||||
|
|
||||||
|
// ReSharper disable once CheckNamespace
|
||||||
|
namespace ArchiSteamFarm {
|
||||||
|
internal static class Logging {
|
||||||
|
private const string LayoutMessage = @"${message}${onexception:inner= ${exception:format=toString,Data}}";
|
||||||
|
private const string GeneralLayout = @"${date:format=yyyy-MM-dd HH\:mm\:ss}|${level:uppercase=true}|" + LayoutMessage;
|
||||||
|
|
||||||
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
private static bool IsUsingCustomConfiguration;
|
||||||
|
|
||||||
|
internal static void InitCoreLoggers() {
|
||||||
|
if (LogManager.Configuration == null) {
|
||||||
|
LogManager.Configuration = new LoggingConfiguration();
|
||||||
|
} else {
|
||||||
|
// User provided custom NLog config, but we still need to define our own logger
|
||||||
|
IsUsingCustomConfiguration = true;
|
||||||
|
if (LogManager.Configuration.AllTargets.Any(target => target is MessageBoxTarget)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageBoxTarget messageBoxTarget = new MessageBoxTarget {
|
||||||
|
Name = "MessageBox",
|
||||||
|
Layout = GeneralLayout
|
||||||
|
};
|
||||||
|
|
||||||
|
LogManager.Configuration.AddTarget(messageBoxTarget);
|
||||||
|
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Fatal, messageBoxTarget));
|
||||||
|
LogManager.ReconfigExistingLoggers();
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void InitEnhancedLoggers() {
|
||||||
|
if (IsUsingCustomConfiguration) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileTarget fileTarget = new FileTarget("File") {
|
||||||
|
DeleteOldFileOnStartup = true,
|
||||||
|
FileName = SharedInfo.LogFile,
|
||||||
|
Layout = GeneralLayout
|
||||||
|
};
|
||||||
|
|
||||||
|
LogManager.Configuration.AddTarget(fileTarget);
|
||||||
|
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, fileTarget));
|
||||||
|
|
||||||
|
LogManager.ReconfigExistingLoggers();
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void InitFormLogger() {
|
||||||
|
RichTextBoxTarget formControlTarget = new RichTextBoxTarget {
|
||||||
|
AutoScroll = true,
|
||||||
|
ControlName = "LogTextBox",
|
||||||
|
FormName = "MainForm",
|
||||||
|
Layout = GeneralLayout,
|
||||||
|
MaxLines = byte.MaxValue,
|
||||||
|
Name = "RichTextBox"
|
||||||
|
};
|
||||||
|
|
||||||
|
formControlTarget.RowColoringRules.Add(new RichTextBoxRowColoringRule("level >= LogLevel.Error", "Red", "Black"));
|
||||||
|
formControlTarget.RowColoringRules.Add(new RichTextBoxRowColoringRule("level >= LogLevel.Warn", "Yellow", "Black"));
|
||||||
|
|
||||||
|
|
||||||
|
LogManager.Configuration.AddTarget(formControlTarget);
|
||||||
|
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, formControlTarget));
|
||||||
|
|
||||||
|
LogManager.ReconfigExistingLoggers();
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void LogGenericError(string message, string botName = SharedInfo.ASF, [CallerMemberName] string previousMethodName = null) {
|
||||||
|
if (string.IsNullOrEmpty(message)) {
|
||||||
|
LogNullError(nameof(message), botName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Error($"{botName}|{previousMethodName}() {message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void LogGenericException(Exception exception, string botName = SharedInfo.ASF, [CallerMemberName] string previousMethodName = null) {
|
||||||
|
if (exception == null) {
|
||||||
|
LogNullError(nameof(exception), botName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Error(exception, $"{botName}|{previousMethodName}()");
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void LogFatalException(Exception exception, string botName = SharedInfo.ASF, [CallerMemberName] string previousMethodName = null) {
|
||||||
|
if (exception == null) {
|
||||||
|
LogNullError(nameof(exception), botName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Fatal(exception, $"{botName}|{previousMethodName}()");
|
||||||
|
|
||||||
|
// If LogManager has been initialized already, don't do anything else
|
||||||
|
if (LogManager.Configuration != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, if we run into fatal exception before logging module is even initialized, write exception to classic log file
|
||||||
|
File.WriteAllText(SharedInfo.LogFile, DateTime.Now + " ASF V" + SharedInfo.Version + " has run into fatal exception before core logging module was even able to initialize!" + Environment.NewLine);
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
File.AppendAllText(SharedInfo.LogFile, "[!] EXCEPTION: " + previousMethodName + "() " + exception.Message + Environment.NewLine + "StackTrace:" + Environment.NewLine + exception.StackTrace);
|
||||||
|
if (exception.InnerException != null) {
|
||||||
|
exception = exception.InnerException;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void LogGenericWarning(string message, string botName = SharedInfo.ASF, [CallerMemberName] string previousMethodName = null) {
|
||||||
|
if (string.IsNullOrEmpty(message)) {
|
||||||
|
LogNullError(nameof(message), botName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Warn($"{botName}|{previousMethodName}() {message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static void LogGenericInfo(string message, string botName = SharedInfo.ASF, [CallerMemberName] string previousMethodName = null) {
|
||||||
|
if (string.IsNullOrEmpty(message)) {
|
||||||
|
LogNullError(nameof(message), botName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Info($"{botName}|{previousMethodName}() {message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "ExplicitCallerInfoArgument")]
|
||||||
|
internal static void LogNullError(string nullObjectName, string botName = SharedInfo.ASF, [CallerMemberName] string previousMethodName = null) {
|
||||||
|
if (string.IsNullOrEmpty(nullObjectName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogGenericError(nullObjectName + " is null!", botName, previousMethodName);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Conditional("DEBUG")]
|
||||||
|
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||||
|
internal static void LogGenericDebug(string message, string botName = SharedInfo.ASF, [CallerMemberName] string previousMethodName = null) {
|
||||||
|
if (string.IsNullOrEmpty(message)) {
|
||||||
|
LogNullError(nameof(message), botName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Debug($"{botName}|{previousMethodName}() {message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
106
GUI/MainForm.Designer.cs
generated
Normal file
106
GUI/MainForm.Designer.cs
generated
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
namespace GUI {
|
||||||
|
internal sealed partial class MainForm {
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing) {
|
||||||
|
if (disposing && (components != null)) {
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent() {
|
||||||
|
this.components = new System.ComponentModel.Container();
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
|
||||||
|
this.BotListView = new System.Windows.Forms.ListView();
|
||||||
|
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||||
|
this.MinimizeIcon = new System.Windows.Forms.NotifyIcon(this.components);
|
||||||
|
this.LogTextBox = new System.Windows.Forms.RichTextBox();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// BotListView
|
||||||
|
//
|
||||||
|
this.BotListView.Dock = System.Windows.Forms.DockStyle.Left;
|
||||||
|
this.BotListView.GridLines = true;
|
||||||
|
this.BotListView.Location = new System.Drawing.Point(0, 24);
|
||||||
|
this.BotListView.MultiSelect = false;
|
||||||
|
this.BotListView.Name = "BotListView";
|
||||||
|
this.BotListView.ShowGroups = false;
|
||||||
|
this.BotListView.Size = new System.Drawing.Size(150, 705);
|
||||||
|
this.BotListView.TabIndex = 0;
|
||||||
|
this.BotListView.UseCompatibleStateImageBehavior = false;
|
||||||
|
//
|
||||||
|
// menuStrip1
|
||||||
|
//
|
||||||
|
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.menuStrip1.Name = "menuStrip1";
|
||||||
|
this.menuStrip1.Size = new System.Drawing.Size(1008, 24);
|
||||||
|
this.menuStrip1.TabIndex = 1;
|
||||||
|
this.menuStrip1.Text = "menuStrip1";
|
||||||
|
//
|
||||||
|
// MinimizeIcon
|
||||||
|
//
|
||||||
|
this.MinimizeIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
|
||||||
|
this.MinimizeIcon.BalloonTipText = "ASF will keep working in the background...";
|
||||||
|
this.MinimizeIcon.BalloonTipTitle = "ASF";
|
||||||
|
this.MinimizeIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("MinimizeIcon.Icon")));
|
||||||
|
this.MinimizeIcon.Text = "MinimizeIcon";
|
||||||
|
this.MinimizeIcon.Visible = true;
|
||||||
|
this.MinimizeIcon.DoubleClick += new System.EventHandler(this.MinimizeIcon_DoubleClick);
|
||||||
|
//
|
||||||
|
// LogTextBox
|
||||||
|
//
|
||||||
|
this.LogTextBox.BackColor = System.Drawing.Color.Black;
|
||||||
|
this.LogTextBox.CausesValidation = false;
|
||||||
|
this.LogTextBox.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||||
|
this.LogTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||||
|
this.LogTextBox.ForeColor = System.Drawing.Color.White;
|
||||||
|
this.LogTextBox.Location = new System.Drawing.Point(150, 529);
|
||||||
|
this.LogTextBox.Name = "LogTextBox";
|
||||||
|
this.LogTextBox.ReadOnly = true;
|
||||||
|
this.LogTextBox.Size = new System.Drawing.Size(858, 200);
|
||||||
|
this.LogTextBox.TabIndex = 2;
|
||||||
|
this.LogTextBox.Text = "";
|
||||||
|
//
|
||||||
|
// MainForm
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(1008, 729);
|
||||||
|
this.Controls.Add(this.LogTextBox);
|
||||||
|
this.Controls.Add(this.BotListView);
|
||||||
|
this.Controls.Add(this.menuStrip1);
|
||||||
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
|
this.MainMenuStrip = this.menuStrip1;
|
||||||
|
this.Name = "MainForm";
|
||||||
|
this.Text = "ArchiSteamFarm";
|
||||||
|
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
|
||||||
|
this.Load += new System.EventHandler(this.MainForm_Load);
|
||||||
|
this.Resize += new System.EventHandler(this.MainForm_Resize);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.ListView BotListView;
|
||||||
|
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||||
|
private System.Windows.Forms.NotifyIcon MinimizeIcon;
|
||||||
|
private System.Windows.Forms.RichTextBox LogTextBox;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
57
GUI/MainForm.cs
Normal file
57
GUI/MainForm.cs
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using ArchiSteamFarm;
|
||||||
|
|
||||||
|
namespace GUI {
|
||||||
|
internal sealed partial class MainForm : Form {
|
||||||
|
internal MainForm() {
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MainForm_Resize(object sender, EventArgs e) {
|
||||||
|
switch (WindowState) {
|
||||||
|
case FormWindowState.Minimized:
|
||||||
|
MinimizeIcon.Visible = true;
|
||||||
|
MinimizeIcon.ShowBalloonTip(5000);
|
||||||
|
break;
|
||||||
|
case FormWindowState.Normal:
|
||||||
|
MinimizeIcon.Visible = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MainForm_Load(object sender, EventArgs e) {
|
||||||
|
Logging.InitFormLogger();
|
||||||
|
|
||||||
|
if (!Directory.Exists(SharedInfo.ConfigDirectory)) {
|
||||||
|
Logging.LogGenericError("Config directory could not be found!");
|
||||||
|
Environment.Exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ASF.CheckForUpdate().Wait();
|
||||||
|
|
||||||
|
// Before attempting to connect, initialize our list of CMs
|
||||||
|
Bot.InitializeCMs(Program.GlobalDatabase.CellID, Program.GlobalDatabase.ServerListProvider);
|
||||||
|
|
||||||
|
foreach (string botName in Directory.EnumerateFiles(SharedInfo.ConfigDirectory, "*.json").Select(Path.GetFileNameWithoutExtension)) {
|
||||||
|
switch (botName) {
|
||||||
|
case SharedInfo.ASF:
|
||||||
|
case "example":
|
||||||
|
case "minimal":
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bot bot = new Bot(botName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MinimizeIcon_DoubleClick(object sender, EventArgs e) {
|
||||||
|
Show();
|
||||||
|
WindowState = FormWindowState.Normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MainForm_FormClosed(object sender, FormClosedEventArgs e) => Program.InitShutdownSequence();
|
||||||
|
}
|
||||||
|
}
|
||||||
12474
GUI/MainForm.resx
Normal file
12474
GUI/MainForm.resx
Normal file
File diff suppressed because it is too large
Load Diff
121
GUI/Program.cs
121
GUI/Program.cs
@@ -1,4 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using GUI;
|
using GUI;
|
||||||
|
|
||||||
@@ -15,26 +21,135 @@ namespace ArchiSteamFarm {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void Exit() {
|
internal static void Exit(int exitCode = 0) {
|
||||||
|
InitShutdownSequence();
|
||||||
|
Environment.Exit(exitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void Restart() {
|
internal static void Restart() {
|
||||||
|
InitShutdownSequence();
|
||||||
|
|
||||||
|
try {
|
||||||
|
Process.Start(Assembly.GetEntryAssembly().Location, string.Join(" ", Environment.GetCommandLineArgs().Skip(1)));
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logging.LogGenericException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void OnBotShutdown() {
|
internal static void OnBotShutdown() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static void InitShutdownSequence() {
|
||||||
|
foreach (Bot bot in Bot.Bots.Values.Where(bot => bot.KeepRunning)) {
|
||||||
|
bot.Stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs args) {
|
||||||
|
if (args?.ExceptionObject == null) {
|
||||||
|
Logging.LogNullError(nameof(args) + " || " + nameof(args.ExceptionObject));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logging.LogFatalException((Exception) args.ExceptionObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void UnobservedTaskExceptionHandler(object sender, UnobservedTaskExceptionEventArgs args) {
|
||||||
|
if (args?.Exception == null) {
|
||||||
|
Logging.LogNullError(nameof(args) + " || " + nameof(args.Exception));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logging.LogFatalException(args.Exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void InitServices() {
|
||||||
|
string globalConfigFile = Path.Combine(SharedInfo.ConfigDirectory, SharedInfo.GlobalConfigFileName);
|
||||||
|
|
||||||
|
GlobalConfig = GlobalConfig.Load(globalConfigFile);
|
||||||
|
if (GlobalConfig == null) {
|
||||||
|
Logging.LogGenericError("Global config could not be loaded, please make sure that " + globalConfigFile + " exists and is valid!");
|
||||||
|
Exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
string globalDatabaseFile = Path.Combine(SharedInfo.ConfigDirectory, SharedInfo.GlobalDatabaseFileName);
|
||||||
|
|
||||||
|
GlobalDatabase = GlobalDatabase.Load(globalDatabaseFile);
|
||||||
|
if (GlobalDatabase == null) {
|
||||||
|
Logging.LogGenericError("Global database could not be loaded, if issue persists, please remove " + globalDatabaseFile + " in order to recreate database!");
|
||||||
|
Exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ArchiWebHandler.Init();
|
||||||
|
WebBrowser.Init();
|
||||||
|
|
||||||
|
WebBrowser = new WebBrowser(SharedInfo.ASF);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void Init() {
|
||||||
|
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
|
||||||
|
TaskScheduler.UnobservedTaskException += UnobservedTaskExceptionHandler;
|
||||||
|
|
||||||
|
Logging.InitCoreLoggers();
|
||||||
|
|
||||||
|
if (!Runtime.IsRuntimeSupported()) {
|
||||||
|
Logging.LogGenericError("ASF detected unsupported runtime version, program might NOT run correctly in current environment. You're running it at your own risk!");
|
||||||
|
}
|
||||||
|
|
||||||
|
string homeDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||||
|
if (!string.IsNullOrEmpty(homeDirectory)) {
|
||||||
|
Directory.SetCurrentDirectory(homeDirectory);
|
||||||
|
|
||||||
|
// Allow loading configs from source tree if it's a debug build
|
||||||
|
if (Debugging.IsDebugBuild) {
|
||||||
|
|
||||||
|
// Common structure is bin/(x64/)Debug/ArchiSteamFarm.exe, so we allow up to 4 directories up
|
||||||
|
for (byte i = 0; i < 4; i++) {
|
||||||
|
Directory.SetCurrentDirectory("..");
|
||||||
|
if (!Directory.Exists(SharedInfo.ASFDirectory)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Directory.SetCurrentDirectory(SharedInfo.ASFDirectory);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If config directory doesn't exist after our adjustment, abort all of that
|
||||||
|
if (!Directory.Exists(SharedInfo.ConfigDirectory)) {
|
||||||
|
Directory.SetCurrentDirectory(homeDirectory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
InitServices();
|
||||||
|
|
||||||
|
// If debugging is on, we prepare debug directory prior to running
|
||||||
|
if (GlobalConfig.Debug) {
|
||||||
|
if (Directory.Exists(SharedInfo.DebugDirectory)) {
|
||||||
|
Directory.Delete(SharedInfo.DebugDirectory, true);
|
||||||
|
Thread.Sleep(1000); // Dirty workaround giving Windows some time to sync
|
||||||
|
}
|
||||||
|
Directory.CreateDirectory(SharedInfo.DebugDirectory);
|
||||||
|
|
||||||
|
SteamKit2.DebugLog.AddListener(new Debugging.DebugListener(Path.Combine(SharedInfo.DebugDirectory, "debug.txt")));
|
||||||
|
SteamKit2.DebugLog.Enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logging.InitEnhancedLoggers();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The main entry point for the application.
|
/// The main entry point for the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[STAThread]
|
[STAThread]
|
||||||
private static void Main() {
|
private static void Main() {
|
||||||
|
Init();
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
Application.Run(new Form1());
|
Application.Run(new MainForm());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<package id="HtmlAgilityPack" version="1.4.9.5" targetFramework="net461" />
|
<package id="HtmlAgilityPack" version="1.4.9.5" targetFramework="net461" />
|
||||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
|
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
|
||||||
<package id="NLog" version="4.4.0-betaV15" targetFramework="net461" />
|
<package id="NLog" version="4.4.0-betaV15" targetFramework="net461" />
|
||||||
|
<package id="NLog.Windows.Forms" version="4.2.3" targetFramework="net461" />
|
||||||
<package id="protobuf-net" version="2.0.0.668" targetFramework="net461" />
|
<package id="protobuf-net" version="2.0.0.668" targetFramework="net461" />
|
||||||
<package id="SteamKit2" version="1.8.0" targetFramework="net461" />
|
<package id="SteamKit2" version="1.8.0" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
||||||
BIN
packages/NLog.Windows.Forms.4.2.3/NLog.Windows.Forms.4.2.3.nupkg
vendored
Normal file
BIN
packages/NLog.Windows.Forms.4.2.3/NLog.Windows.Forms.4.2.3.nupkg
vendored
Normal file
Binary file not shown.
768
packages/NLog.Windows.Forms.4.2.3/lib/net35/NLog.Windows.Forms.XML
vendored
Normal file
768
packages/NLog.Windows.Forms.4.2.3/lib/net35/NLog.Windows.Forms.XML
vendored
Normal file
@@ -0,0 +1,768 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<doc>
|
||||||
|
<assembly>
|
||||||
|
<name>NLog.Windows.Forms</name>
|
||||||
|
</assembly>
|
||||||
|
<members>
|
||||||
|
<member name="T:NLog.Windows.Forms.RichTextBoxLinkLayoutRenderer">
|
||||||
|
<summary>
|
||||||
|
Strings rendered with this rendrer would convert to links in the control. <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.SupportLinks"/>
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
Internally this renderer replaces the rendered text with a GUID and stores the info in <see cref="P:NLog.LogEventInfo.Properties"/> by <see cref="F:NLog.Windows.Forms.RichTextBoxLinkLayoutRenderer.LinkInfo.PropertyName"/> as a key
|
||||||
|
Actual rendering is done in <see cref="M:NLog.Windows.Forms.RichTextBoxTarget.SendTheMessageToRichTextBox(System.String,NLog.Windows.Forms.RichTextBoxRowColoringRule,NLog.LogEventInfo)"/>
|
||||||
|
</remarks>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxLinkLayoutRenderer.Append(System.Text.StringBuilder,NLog.LogEventInfo)">
|
||||||
|
<summary>
|
||||||
|
Implementation of a <see cref="M:NLog.LayoutRenderers.LayoutRenderer.Append(System.Text.StringBuilder,NLog.LogEventInfo)"/>
|
||||||
|
</summary>
|
||||||
|
<param name="builder"></param>
|
||||||
|
<param name="logEvent"></param>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxLinkLayoutRenderer.Inner">
|
||||||
|
<summary>
|
||||||
|
Inner layout that actually provides text
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:NLog.Windows.Forms.RichTextBoxLinkLayoutRenderer.LinkInfo">
|
||||||
|
<summary>
|
||||||
|
Inernal class storing the captured link info, used by <see cref="M:NLog.Windows.Forms.RichTextBoxTarget.SendTheMessageToRichTextBox(System.String,NLog.Windows.Forms.RichTextBoxRowColoringRule,NLog.LogEventInfo)"/> to convert the text to link and then identify the logEvent
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxLinkLayoutRenderer.LinkInfo.PropertyName">
|
||||||
|
<summary>
|
||||||
|
Used as a key in <see cref="P:NLog.LogEventInfo.Properties"/>
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:NLog.Windows.Forms.RichTextBoxWordColoringRule">
|
||||||
|
<summary>
|
||||||
|
Highlighting rule for Win32 colorful console.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxWordColoringRule.#ctor">
|
||||||
|
<summary>
|
||||||
|
Initializes a new instance of the <see cref="T:NLog.Targets.RichTextBoxWordColoringRule"/> class.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxWordColoringRule.#ctor(System.String,System.String,System.String)">
|
||||||
|
<summary>
|
||||||
|
Initializes a new instance of the <see cref="T:NLog.Targets.RichTextBoxWordColoringRule"/> class.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<param name="text">The text to be matched..</param><param name="fontColor">Color of the text.</param><param name="backgroundColor">Color of the background.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxWordColoringRule.#ctor(System.String,System.String,System.String,System.Drawing.FontStyle)">
|
||||||
|
<summary>
|
||||||
|
Initializes a new instance of the <see cref="T:NLog.Targets.RichTextBoxWordColoringRule"/> class.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<param name="text">The text to be matched..</param><param name="textColor">Color of the text.</param><param name="backgroundColor">Color of the background.</param><param name="fontStyle">The font style.</param>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxWordColoringRule.Regex">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the regular expression to be matched. You must specify either <c>text</c> or <c>regex</c>.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<docgen category="Rule Matching Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxWordColoringRule.Text">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the text to be matched. You must specify either <c>text</c> or <c>regex</c>.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<docgen category="Rule Matching Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxWordColoringRule.WholeWords">
|
||||||
|
<summary>
|
||||||
|
Gets or sets a value indicating whether to match whole words only.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<docgen category="Rule Matching Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxWordColoringRule.IgnoreCase">
|
||||||
|
<summary>
|
||||||
|
Gets or sets a value indicating whether to ignore case when comparing texts.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<docgen category="Rule Matching Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxWordColoringRule.Style">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the font style of matched text.
|
||||||
|
Possible values are the same as in <c>FontStyle</c> enum in <c>System.Drawing</c>.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<docgen category="Formatting Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxWordColoringRule.CompiledRegex">
|
||||||
|
<summary>
|
||||||
|
Gets the compiled regular expression that matches either Text or Regex property.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxWordColoringRule.FontColor">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the font color.
|
||||||
|
Names are identical with KnownColor enum extended with Empty value which means that font color won't be changed.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<docgen category="Formatting Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxWordColoringRule.BackgroundColor">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the background color.
|
||||||
|
Names are identical with KnownColor enum extended with Empty value which means that background color won't be changed.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<docgen category="Formatting Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="T:NLog.Windows.Forms.RichTextBoxRowColoringRule">
|
||||||
|
<summary>
|
||||||
|
The row-coloring condition.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxRowColoringRule.#cctor">
|
||||||
|
<summary>
|
||||||
|
Initializes static members of the RichTextBoxRowColoringRule class.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxRowColoringRule.#ctor">
|
||||||
|
<summary>
|
||||||
|
Initializes a new instance of the <see cref="T:NLog.Targets.RichTextBoxRowColoringRule"/> class.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxRowColoringRule.#ctor(System.String,System.String,System.String,System.Drawing.FontStyle)">
|
||||||
|
<summary>
|
||||||
|
Initializes a new instance of the <see cref="T:NLog.Targets.RichTextBoxRowColoringRule"/> class.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<param name="condition">The condition.</param><param name="fontColor">Color of the foreground text.</param><param name="backColor">Color of the background text.</param><param name="fontStyle">The font style.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxRowColoringRule.#ctor(System.String,System.String,System.String)">
|
||||||
|
<summary>
|
||||||
|
Initializes a new instance of the <see cref="T:NLog.Targets.RichTextBoxRowColoringRule"/> class.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<param name="condition">The condition.</param><param name="fontColor">Color of the text.</param><param name="backColor">Color of the background.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxRowColoringRule.CheckCondition(NLog.LogEventInfo)">
|
||||||
|
<summary>
|
||||||
|
Checks whether the specified log event matches the condition (if any).
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<param name="logEvent">Log event.
|
||||||
|
</param>
|
||||||
|
<returns>
|
||||||
|
A value of <see langword="true"/> if the condition is not defined or
|
||||||
|
if it matches, <see langword="false"/> otherwise.
|
||||||
|
|
||||||
|
</returns>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxRowColoringRule.Default">
|
||||||
|
<summary>
|
||||||
|
Gets the default highlighting rule. Doesn't change the color.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<docgen category="Rule Matching Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxRowColoringRule.Condition">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the condition that must be met in order to set the specified font color.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
<docgen category="Rule Matching Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxRowColoringRule.FontColor">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the font color.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
|
||||||
|
<remarks>
|
||||||
|
Names are identical with KnownColor enum extended with Empty value which means that background color won't be changed.
|
||||||
|
|
||||||
|
</remarks>
|
||||||
|
<docgen category="Formatting Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxRowColoringRule.BackgroundColor">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the background color.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
|
||||||
|
<remarks>
|
||||||
|
Names are identical with KnownColor enum extended with Empty value which means that background color won't be changed.
|
||||||
|
|
||||||
|
</remarks>
|
||||||
|
<docgen category="Formatting Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxRowColoringRule.Style">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the font style of matched text.
|
||||||
|
|
||||||
|
</summary>
|
||||||
|
|
||||||
|
<remarks>
|
||||||
|
Possible values are the same as in <c>FontStyle</c> enum in <c>System.Drawing</c>
|
||||||
|
</remarks>
|
||||||
|
<docgen category="Formatting Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="T:NLog.Windows.Forms.FormControlTarget">
|
||||||
|
<summary>
|
||||||
|
Logs text to Windows.Forms.Control.Text property control of specified Name.
|
||||||
|
</summary>
|
||||||
|
<example>
|
||||||
|
<p>
|
||||||
|
To set up the target in the <a href="config.html">configuration file</a>,
|
||||||
|
use the following syntax:
|
||||||
|
</p>
|
||||||
|
<code lang="XML" source="examples/targets/Configuration File/FormControl/NLog.config" />
|
||||||
|
<p>
|
||||||
|
The result is:
|
||||||
|
</p>
|
||||||
|
<img src="examples/targets/Screenshots/FormControl/FormControl.gif" />
|
||||||
|
<p>
|
||||||
|
To set up the log target programmatically similar to above use code like this:
|
||||||
|
</p>
|
||||||
|
<code lang="C#" source="examples/targets/Configuration API/FormControl/Form1.cs" />,
|
||||||
|
</example>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.FormControlTarget.#ctor">
|
||||||
|
<summary>
|
||||||
|
Initializes a new instance of the <see cref="T:NLog.Windows.Forms.FormControlTarget"/> class.
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
The default value of the layout is: <code>${longdate}|${level:uppercase=true}|${logger}|${message}</code>
|
||||||
|
</remarks>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.FormControlTarget.Write(NLog.LogEventInfo)">
|
||||||
|
<summary>
|
||||||
|
Log message to control.
|
||||||
|
</summary>
|
||||||
|
<param name="logEvent">
|
||||||
|
The logging event.
|
||||||
|
</param>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.FormControlTarget.ControlName">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the name of control to which NLog will log write log text.
|
||||||
|
</summary>
|
||||||
|
<docgen category='Form Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.FormControlTarget.Append">
|
||||||
|
<summary>
|
||||||
|
Gets or sets a value indicating whether log text should be appended to the text of the control instead of overwriting it. </summary>
|
||||||
|
<docgen category='Form Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.FormControlTarget.FormName">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the name of the Form on which the control is located.
|
||||||
|
</summary>
|
||||||
|
<docgen category='Form Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.FormControlTarget.ReverseOrder">
|
||||||
|
<summary>
|
||||||
|
Gets or sets whether new log entry are added to the start or the end of the control
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:NLog.Windows.Forms.FormHelper">
|
||||||
|
<summary>
|
||||||
|
Form helper methods.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.FormHelper.CreateRichTextBox(System.String,System.Windows.Forms.Form)">
|
||||||
|
<summary>
|
||||||
|
Creates RichTextBox and docks in parentForm.
|
||||||
|
</summary>
|
||||||
|
<param name="name">Name of RichTextBox.</param>
|
||||||
|
<param name="parentForm">Form to dock RichTextBox.</param>
|
||||||
|
<returns>Created RichTextBox.</returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.FormHelper.FindControl(System.String,System.Windows.Forms.Control)">
|
||||||
|
<summary>
|
||||||
|
Finds control embedded on searchControl.
|
||||||
|
</summary>
|
||||||
|
<param name="name">Name of the control.</param>
|
||||||
|
<param name="searchControl">Control in which we're searching for control.</param>
|
||||||
|
<returns>A value of null if no control has been found.</returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.FormHelper.FindControl``1(System.String,System.Windows.Forms.Control)">
|
||||||
|
<summary>
|
||||||
|
Finds control of specified type embended on searchControl.
|
||||||
|
</summary>
|
||||||
|
<typeparam name="TControl">The type of the control.</typeparam>
|
||||||
|
<param name="name">Name of the control.</param>
|
||||||
|
<param name="searchControl">Control in which we're searching for control.</param>
|
||||||
|
<returns>
|
||||||
|
A value of null if no control has been found.
|
||||||
|
</returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.FormHelper.CreateForm(System.String,System.Int32,System.Int32,System.Boolean,System.Boolean,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
Creates a form.
|
||||||
|
</summary>
|
||||||
|
<param name="name">Name of form.</param>
|
||||||
|
<param name="width">Width of form.</param>
|
||||||
|
<param name="height">Height of form.</param>
|
||||||
|
<param name="show">Auto show form.</param>
|
||||||
|
<param name="showMinimized">If set to <c>true</c> the form will be minimized.</param>
|
||||||
|
<param name="toolWindow">If set to <c>true</c> the form will be created as tool window.</param>
|
||||||
|
<returns>Created form.</returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.FormHelper.ChangeSelectionToLink(System.Windows.Forms.RichTextBox,System.String,System.String)">
|
||||||
|
<summary>
|
||||||
|
Replaces currently selected text in the RTB control with a link
|
||||||
|
</summary>
|
||||||
|
<param name="textBox">target control</param>
|
||||||
|
<param name="text">visible text of the new link</param>
|
||||||
|
<param name="hyperlink">hidden part of the new link</param>
|
||||||
|
<remarks>
|
||||||
|
Based on http://www.codeproject.com/info/cpol10.aspx
|
||||||
|
</remarks>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.FormHelper.SetSelectionStyle(System.Windows.Forms.RichTextBox,System.UInt32,System.UInt32)">
|
||||||
|
<summary>
|
||||||
|
Sets selection style for RichTextBox
|
||||||
|
https://msdn.microsoft.com/en-us/library/windows/desktop/bb787883(v=vs.85).aspx
|
||||||
|
</summary>
|
||||||
|
<param name="textBox">target control</param>
|
||||||
|
<param name="mask">Specifies the parts of the CHARFORMAT2 structure that contain valid information.</param>
|
||||||
|
<param name="effect">A set of bit flags that specify character effects.</param>
|
||||||
|
<remarks>
|
||||||
|
Based on http://www.codeproject.com/info/cpol10.aspx
|
||||||
|
</remarks>
|
||||||
|
</member>
|
||||||
|
<member name="T:NLog.Windows.Forms.FormHelper.CHARFORMAT2_STRUCT">
|
||||||
|
<summary>
|
||||||
|
CHARFORMAT2 structure, contains information about character formatting in a rich edit control.
|
||||||
|
</summary>
|
||||||
|
see https://msdn.microsoft.com/en-us/library/windows/desktop/bb787883(v=vs.85).aspx
|
||||||
|
</member>
|
||||||
|
<member name="T:NLog.Windows.Forms.MessageBoxTarget">
|
||||||
|
<summary>
|
||||||
|
Pops up log messages as message boxes.
|
||||||
|
</summary>
|
||||||
|
<seealso href="https://github.com/nlog/nlog/wiki/MessageBox-target">Documentation on NLog Wiki</seealso>
|
||||||
|
<example>
|
||||||
|
<p>
|
||||||
|
To set up the target in the <a href="config.html">configuration file</a>,
|
||||||
|
use the following syntax:
|
||||||
|
</p>
|
||||||
|
<code lang="XML" source="examples/targets/Configuration File/MessageBox/NLog.config" />
|
||||||
|
<p>
|
||||||
|
This assumes just one target and a single rule. More configuration
|
||||||
|
options are described <a href="config.html">here</a>.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The result is a message box:
|
||||||
|
</p>
|
||||||
|
<img src="examples/targets/Screenshots/MessageBox/MessageBoxTarget.gif" />
|
||||||
|
<p>
|
||||||
|
To set up the log target programmatically use code like this:
|
||||||
|
</p>
|
||||||
|
<code lang="C#" source="examples/targets/Configuration API/MessageBox/Simple/Example.cs" />
|
||||||
|
</example>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.MessageBoxTarget.#ctor">
|
||||||
|
<summary>
|
||||||
|
Initializes a new instance of the <see cref="T:NLog.Windows.Forms.MessageBoxTarget"/> class.
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
The default value of the layout is: <code>${longdate}|${level:uppercase=true}|${logger}|${message}</code>
|
||||||
|
</remarks>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.MessageBoxTarget.Write(NLog.LogEventInfo)">
|
||||||
|
<summary>
|
||||||
|
Displays the message box with the log message and caption specified in the Caption
|
||||||
|
parameter.
|
||||||
|
</summary>
|
||||||
|
<param name="logEvent">The logging event.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.MessageBoxTarget.Write(NLog.Common.AsyncLogEventInfo[])">
|
||||||
|
<summary>
|
||||||
|
Displays the message box with the array of rendered logs messages and caption specified in the Caption
|
||||||
|
parameter.
|
||||||
|
</summary>
|
||||||
|
<param name="logEvents">The array of logging events.</param>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.MessageBoxTarget.Caption">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the message box title.
|
||||||
|
</summary>
|
||||||
|
<docgen category='UI Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="T:NLog.Windows.Forms.RichTextBoxTarget">
|
||||||
|
<summary>
|
||||||
|
Log text a Rich Text Box control in an existing or new form.
|
||||||
|
</summary>
|
||||||
|
<seealso href="https://github.com/nlog/nlog/wiki/RichTextBox-target">Documentation on NLog Wiki</seealso>
|
||||||
|
<example>
|
||||||
|
<p>
|
||||||
|
To set up the target in the <a href="config.html">configuration file</a>,
|
||||||
|
use the following syntax:
|
||||||
|
</p><code lang="XML" source="examples/targets/Configuration File/RichTextBox/Simple/NLog.config">
|
||||||
|
</code>
|
||||||
|
<p>
|
||||||
|
The result is:
|
||||||
|
</p><img src="examples/targets/Screenshots/RichTextBox/Simple.gif"/><p>
|
||||||
|
To set up the target with coloring rules in the <a href="config.html">configuration file</a>,
|
||||||
|
use the following syntax:
|
||||||
|
</p><code lang="XML" source="examples/targets/Configuration File/RichTextBox/RowColoring/NLog.config">
|
||||||
|
</code>
|
||||||
|
<code lang="XML" source="examples/targets/Configuration File/RichTextBox/WordColoring/NLog.config">
|
||||||
|
</code>
|
||||||
|
<p>
|
||||||
|
The result is:
|
||||||
|
</p><img src="examples/targets/Screenshots/RichTextBox/RowColoring.gif"/><img src="examples/targets/Screenshots/RichTextBox/WordColoring.gif"/><p>
|
||||||
|
To set up the log target programmatically similar to above use code like this:
|
||||||
|
</p><code lang="C#" source="examples/targets/Configuration API/RichTextBox/Simple/Form1.cs">
|
||||||
|
</code>
|
||||||
|
,
|
||||||
|
<code lang="C#" source="examples/targets/Configuration API/RichTextBox/RowColoring/Form1.cs">
|
||||||
|
</code>
|
||||||
|
for RowColoring,
|
||||||
|
<code lang="C#" source="examples/targets/Configuration API/RichTextBox/WordColoring/Form1.cs">
|
||||||
|
</code>
|
||||||
|
for WordColoring
|
||||||
|
</example>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTarget.LinkPrefix">
|
||||||
|
<summary>
|
||||||
|
Internal prefix that is added to the link id in RTF
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.#cctor">
|
||||||
|
<summary>
|
||||||
|
Initializes static members of the RichTextBoxTarget class.
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
The default value of the layout is: <code>${longdate}|${level:uppercase=true}|${logger}|${message}</code>
|
||||||
|
</remarks>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.ReInitializeAllTextboxes(System.Windows.Forms.Form)">
|
||||||
|
<summary>
|
||||||
|
Attempts to attach existing targets that have yet no textboxes to controls that exist on specified form if appropriate
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
Setting <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.AllowAccessoryFormCreation"/> to true (default) actually causes target to always have a textbox
|
||||||
|
(after having <see cref="M:NLog.Windows.Forms.RichTextBoxTarget.InitializeTarget"/> called), so such targets are not affected by this method.
|
||||||
|
</remarks>
|
||||||
|
<param name="form">a Form to check for RichTextBoxes</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.GetTargetByControl(System.Windows.Forms.RichTextBox)">
|
||||||
|
<summary>
|
||||||
|
Returns a target attached to a given RichTextBox control
|
||||||
|
</summary>
|
||||||
|
<param name="control">a RichTextBox control for which the target is to be returned</param>
|
||||||
|
<returns>A RichTextBoxTarget attached to a given control or <code>null</code> if no target is attached</returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.#ctor">
|
||||||
|
<summary>
|
||||||
|
Initializes a new instance of the <see cref="T:NLog.Windows.Forms.RichTextBoxTarget"/> class.
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
The default value of the layout is: <code>${longdate}|${level:uppercase=true}|${logger}|${message}</code>
|
||||||
|
</remarks>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTarget.messageRetention">
|
||||||
|
<summary>
|
||||||
|
Actual value of the <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.MessageRetention"/>.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTarget.lastLoggedTextBoxControl">
|
||||||
|
<summary>
|
||||||
|
A textbox to which we have logged last time. Used to prevent duplicating messages in the same textbox in case of config reload and RichTextBoxTargetMessageRetentionStrategy.All
|
||||||
|
see https://github.com/NLog/NLog.Windows.Forms/pull/22
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTarget.messageQueueLock">
|
||||||
|
<summary>
|
||||||
|
a lock object used to synchronize access to <see cref="F:NLog.Windows.Forms.RichTextBoxTarget.messageQueue"/>
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTarget.messageQueue">
|
||||||
|
<summary>
|
||||||
|
A queue used to store messages based on <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.MessageRetention"/>.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTarget.supportLinks">
|
||||||
|
<summary>
|
||||||
|
Actual value of the <see cref="E:NLog.Windows.Forms.RichTextBoxTarget.LinkClicked"/> property
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTarget.linkedEventsLock">
|
||||||
|
<summary>
|
||||||
|
Lock for <see cref="F:NLog.Windows.Forms.RichTextBoxTarget.linkedEvents"/> dictionary access
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTarget.linkedEvents">
|
||||||
|
<summary>
|
||||||
|
A map from link id to a corresponding log event
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTarget.linkRegexLock">
|
||||||
|
<summary>
|
||||||
|
Used to synchronize lazy initialization of <see cref="F:NLog.Windows.Forms.RichTextBoxTarget.linkAddRegex"/> and <see cref="F:NLog.Windows.Forms.RichTextBoxTarget.linkRemoveRtfRegex"/> in <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.SupportLinks"/>.set
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTarget.linkAddRegex">
|
||||||
|
<summary>
|
||||||
|
Used to capture link placeholders in <see cref="M:NLog.Windows.Forms.RichTextBoxTarget.SendTheMessageToRichTextBox(System.String,NLog.Windows.Forms.RichTextBoxRowColoringRule,NLog.LogEventInfo)"/>
|
||||||
|
Lazily initialized in <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.SupportLinks"/>.set(true). Assure checking <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.SupportLinks"/> before accessing the field
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTarget.linkRemoveRtfRegex">
|
||||||
|
<summary>
|
||||||
|
Used to parse RTF with links when removing excess lines in <see cref="M:NLog.Windows.Forms.RichTextBoxTarget.SendTheMessageToRichTextBox(System.String,NLog.Windows.Forms.RichTextBoxRowColoringRule,NLog.LogEventInfo)"/>
|
||||||
|
Lazily initialized in <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.SupportLinks"/>.set(true). Assure checking <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.SupportLinks"/> before accessing the field
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.InitializeTarget">
|
||||||
|
<summary>
|
||||||
|
Initializes the target. Can be used by inheriting classes
|
||||||
|
to initialize logging.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.HandleError(System.String,System.Object[])">
|
||||||
|
<summary>
|
||||||
|
Called from constructor when error is detected. In case LogManager.ThrowExceptions is enabled, throws the exception, otherwise - logs the problem message
|
||||||
|
</summary>
|
||||||
|
<param name="message">exception/log message format</param>
|
||||||
|
<param name="args">message format arguments</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.CreateAccessoryForm">
|
||||||
|
<summary>
|
||||||
|
Used to create accessory form with textbox in case specified form or control were not found during InitializeTarget() and AllowAccessoryFormCreation==true
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.AttachToControl(System.Windows.Forms.Form,System.Windows.Forms.RichTextBox)">
|
||||||
|
<summary>
|
||||||
|
Used to (re)initialize target when attaching it to another RTB control
|
||||||
|
</summary>
|
||||||
|
<param name="form">form owning textboxControl</param>
|
||||||
|
<param name="textboxControl">a new control to attach to</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.TargetRichTextBox_LinkClicked(System.Object,System.Windows.Forms.LinkClickedEventArgs)">
|
||||||
|
<summary>
|
||||||
|
Attached to RTB-control's LinkClicked event to convert link text to logEvent
|
||||||
|
</summary>
|
||||||
|
<param name="sender"></param>
|
||||||
|
<param name="e"></param>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.DetachFromControl">
|
||||||
|
<summary>
|
||||||
|
if <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.CreatedForm"/> is true, then destroys created form. Resets <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.CreatedForm"/>, <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.TargetForm"/> and <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.TargetRichTextBox"/> to default values
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.CloseTarget">
|
||||||
|
<summary>
|
||||||
|
Closes the target and releases any unmanaged resources.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.Write(NLog.LogEventInfo)">
|
||||||
|
<summary>
|
||||||
|
Log message to RichTextBox.
|
||||||
|
</summary>
|
||||||
|
<param name="logEvent">The logging event.</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.DoSendMessageToTextbox(System.String,NLog.Windows.Forms.RichTextBoxRowColoringRule,NLog.LogEventInfo)">
|
||||||
|
<summary>
|
||||||
|
Actually sends log message to <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.TargetRichTextBox"/>
|
||||||
|
</summary>
|
||||||
|
<param name="logMessage">a message to send</param>
|
||||||
|
<param name="rule">matching coloring rule</param>
|
||||||
|
<param name="logEvent">original logEvent</param>
|
||||||
|
<returns>true if the message was actually sent (i.e. <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.TargetRichTextBox"/> is not null and not disposed, and no exception happened during message send)</returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.FindMatchingRule(NLog.LogEventInfo)">
|
||||||
|
<summary>
|
||||||
|
Find first matching rule
|
||||||
|
</summary>
|
||||||
|
<param name="logEvent"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:NLog.Windows.Forms.RichTextBoxTarget.StoreMessage(System.String,NLog.Windows.Forms.RichTextBoxRowColoringRule,NLog.LogEventInfo)">
|
||||||
|
<summary>
|
||||||
|
Stores a new message in internal queue, if it exists. Removes overflowing messages.
|
||||||
|
</summary>
|
||||||
|
<param name="logMessage">a message to store</param>
|
||||||
|
<param name="rule">a corresponding coloring rule</param>
|
||||||
|
<param name="logEvent">original LogEvent</param>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.DefaultRowColoringRules">
|
||||||
|
<summary>
|
||||||
|
Gets the default set of row coloring rules which applies when <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.UseDefaultRowColoringRules"/> is set to true.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.ControlName">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the Name of RichTextBox to which Nlog will write.
|
||||||
|
</summary>
|
||||||
|
<docgen category='Form Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.FormName">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the name of the Form on which the control is located.
|
||||||
|
If there is no open form of a specified name than NLog will create a new one.
|
||||||
|
</summary>
|
||||||
|
<docgen category='Form Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.UseDefaultRowColoringRules">
|
||||||
|
<summary>
|
||||||
|
Gets or sets a value indicating whether to use default coloring rules.
|
||||||
|
</summary>
|
||||||
|
<docgen category='Highlighting Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.RowColoringRules">
|
||||||
|
<summary>
|
||||||
|
Gets the row coloring rules.
|
||||||
|
</summary>
|
||||||
|
<docgen category='Highlighting Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.WordColoringRules">
|
||||||
|
<summary>
|
||||||
|
Gets the word highlighting rules.
|
||||||
|
</summary>
|
||||||
|
<docgen category='Highlighting Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.ToolWindow">
|
||||||
|
<summary>
|
||||||
|
Gets or sets a value indicating whether the created window will be a tool window.
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
This parameter is ignored when logging to existing form control.
|
||||||
|
Tool windows have thin border, and do not show up in the task bar.
|
||||||
|
</remarks>
|
||||||
|
<docgen category='Form Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.ShowMinimized">
|
||||||
|
<summary>
|
||||||
|
Gets or sets a value indicating whether the created form will be initially minimized.
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
This parameter is ignored when logging to existing form control.
|
||||||
|
</remarks>
|
||||||
|
<docgen category='Form Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.Width">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the initial width of the form with rich text box.
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
This parameter is ignored when logging to existing form control.
|
||||||
|
</remarks>
|
||||||
|
<docgen category='Form Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.Height">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the initial height of the form with rich text box.
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
This parameter is ignored when logging to existing form control.
|
||||||
|
</remarks>
|
||||||
|
<docgen category='Form Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.AutoScroll">
|
||||||
|
<summary>
|
||||||
|
Gets or sets a value indicating whether scroll bar will be moved automatically to show most recent log entries.
|
||||||
|
</summary>
|
||||||
|
<docgen category='Form Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.MaxLines">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the maximum number of lines the rich text box will store (or 0 to disable this feature).
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
After exceeding the maximum number, first line will be deleted.
|
||||||
|
</remarks>
|
||||||
|
<docgen category='Form Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.TargetForm">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the form to log to.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.TargetRichTextBox">
|
||||||
|
<summary>
|
||||||
|
Gets or sets the rich text box to log to.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.CreatedForm">
|
||||||
|
<summary>
|
||||||
|
Form created (true) or used an existing (false). Set after <see cref="M:NLog.Windows.Forms.RichTextBoxTarget.InitializeTarget"/>. Can be true only if <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.AllowAccessoryFormCreation"/> is set to true (default).
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.AllowAccessoryFormCreation">
|
||||||
|
<summary>
|
||||||
|
Gets or sets a value indicating whether to create accessory form if the specified form/control combination was not found during target initialization.
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
If set to false and the control was not found during target initialiation, the target would skip events until the control is found during <see cref="M:NLog.Windows.Forms.RichTextBoxTarget.ReInitializeAllTextboxes(System.Windows.Forms.Form)"/> call
|
||||||
|
</remarks>
|
||||||
|
<docgen category="Form Options" order="10"/>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.MessageRetention">
|
||||||
|
<summary>
|
||||||
|
gets or sets the message retention strategy which determines how the target handles messages when there's no control attached, or when switching between controls
|
||||||
|
</summary>
|
||||||
|
<remarks>
|
||||||
|
</remarks>
|
||||||
|
<docgen category='Form Options' order='10' />
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.SupportLinks">
|
||||||
|
<summary>
|
||||||
|
If set to true, using "rtb-link" renderer (<see cref="T:NLog.Windows.Forms.RichTextBoxLinkLayoutRenderer"/>) would create clickable links in the control.
|
||||||
|
<seealso cref="E:NLog.Windows.Forms.RichTextBoxTarget.LinkClicked"/>
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="E:NLog.Windows.Forms.RichTextBoxTarget.LinkClicked">
|
||||||
|
<summary>
|
||||||
|
Event fired when the user clicks on a link in the control created by the "rtb-link" renderer (<see cref="T:NLog.Windows.Forms.RichTextBoxLinkLayoutRenderer"/>).
|
||||||
|
<seealso cref="T:NLog.Windows.Forms.RichTextBoxTarget.DelLinkClicked"/>
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:NLog.Windows.Forms.RichTextBoxTarget.LinkedEventsCount">
|
||||||
|
<summary>
|
||||||
|
Returns number of events stored for active links in the control.
|
||||||
|
Used only in tests to check that non needed events are removed.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:NLog.Windows.Forms.RichTextBoxTarget.DelLinkClicked">
|
||||||
|
<summary>
|
||||||
|
Type of delegate for <see cref="E:NLog.Windows.Forms.RichTextBoxTarget.LinkClicked"/> event.
|
||||||
|
</summary>
|
||||||
|
<param name="sender">The target that caused the event</param>
|
||||||
|
<param name="linkText">Visible text of the link being clicked</param>
|
||||||
|
<param name="logEvent">Original log event that caused a line with the link</param>
|
||||||
|
</member>
|
||||||
|
<member name="T:NLog.Windows.Forms.RichTextBoxTargetMessageRetentionStrategy">
|
||||||
|
<summary>
|
||||||
|
How to handle messages when switching between target controls or no control is attached at all
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTargetMessageRetentionStrategy.None">
|
||||||
|
<summary>
|
||||||
|
Just skip logging events when no target control attached. Only new messages would be sent to rich text box after attachement.
|
||||||
|
No additional resources spent on this.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTargetMessageRetentionStrategy.OnlyMissed">
|
||||||
|
<summary>
|
||||||
|
Store logging events only during periods when no target control attached. Only these messages would be sent to rich text box after attachment. Messages that were sent to previous textbox are not stored and would not be shown.
|
||||||
|
Number of events stored is limited by <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.MaxLines"/>.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:NLog.Windows.Forms.RichTextBoxTargetMessageRetentionStrategy.All">
|
||||||
|
<summary>
|
||||||
|
Store all events in internal queue. After attaching to a new control all the stored messages would be repeated in it, including messages that were sent to previous textbox.
|
||||||
|
Number of messages stored is limited by <see cref="P:NLog.Windows.Forms.RichTextBoxTarget.MaxLines"/>.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
</members>
|
||||||
|
</doc>
|
||||||
BIN
packages/NLog.Windows.Forms.4.2.3/lib/net35/NLog.Windows.Forms.dll
vendored
Normal file
BIN
packages/NLog.Windows.Forms.4.2.3/lib/net35/NLog.Windows.Forms.dll
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user