Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Package
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.Package
Commits
bfc47cfa
Commit
bfc47cfa
authored
Jan 16, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Viz 命令日志窗口
异常日志窗口
parent
e9a78921
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
360 additions
and
0 deletions
+360
-0
VIZ.Package.Common/Log/ErrorMessageAppender.cs
+41
-0
VIZ.Package.Domain/Message/Log/ErrorLogMessaeg.cs
+12
-0
VIZ.Package.Domain/Message/Log/ErrorLogMessage.cs
+19
-0
VIZ.Package.Domain/Message/Log/VizCommandLogMessage.cs
+19
-0
VIZ.Package.Module/Log/View/ErrorLogWindow.xaml
+22
-0
VIZ.Package.Module/Log/View/ErrorLogWindow.xaml.cs
+39
-0
VIZ.Package.Module/Log/View/ErrorWindow.xaml
+12
-0
VIZ.Package.Module/Log/View/ErrorWindow.xaml.cs
+28
-0
VIZ.Package.Module/Log/View/VizCommandWindow.xaml
+12
-0
VIZ.Package.Module/Log/View/VizCommandWindow.xaml.cs
+28
-0
VIZ.Package.Module/Log/ViewModel/ErrorLogWindowModel.cs
+104
-0
VIZ.Package.Module/Log/ViewModel/ErrorWindowModel.cs
+12
-0
VIZ.Package.Module/Log/ViewModel/VizCommandWindowModel.cs
+12
-0
No files found.
VIZ.Package.Common/Log/ErrorMessageAppender.cs
0 → 100644
View file @
bfc47cfa
using
log4net.Appender
;
using
log4net.Core
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Common
{
/// <summary>
/// 错误消息附加
/// </summary>
public
class
ErrorMessageAppender
:
IAppender
{
/// <summary>
/// 名称
/// </summary>
public
string
Name
{
get
;
set
;
}
=
"ErrorMessageAppender"
;
/// <summary>
/// 关闭
/// </summary>
public
void
Close
()
{
// nothing to do.
}
/// <summary>
/// 执行
/// </summary>
/// <param name="loggingEvent">日志事件</param>
public
void
DoAppend
(
LoggingEvent
loggingEvent
)
{
if
(
loggingEvent
.
Level
!=
Level
.
Error
)
return
;
}
}
}
VIZ.Package.Domain/Message/Log/ErrorLogMessaeg.cs
0 → 100644
View file @
bfc47cfa
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Domain.Message.Log
{
internal
class
ErrorLogMessaeg
{
}
}
VIZ.Package.Domain/Message/Log/ErrorLogMessage.cs
0 → 100644
View file @
bfc47cfa
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 错误日志消息
/// </summary>
public
class
ErrorLogMessage
{
/// <summary>
/// 错误
/// </summary>
public
string
Error
{
get
;
set
;
}
}
}
VIZ.Package.Domain/Message/Log/VizCommandLogMessage.cs
0 → 100644
View file @
bfc47cfa
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// Viz命令日志消息
/// </summary>
public
class
VizCommandLogMessage
{
/// <summary>
/// 日志信息
/// </summary>
public
string
Log
{
get
;
set
;
}
}
}
VIZ.Package.Module/Log/View/ErrorLogWindow.xaml
0 → 100644
View file @
bfc47cfa
<dx:ThemedWindow x:Class="VIZ.Package.Module.ErrorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.Package.Module"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:ErrorWindowModel}"
Title="Viz命令窗口" Height="800" Width="1200"
WindowStartupLocation="CenterScreen">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Button Width="80" Height="20" Content="清除" Command="{Binding Path=ClearCommand}" HorizontalAlignment="Left"></Button>
<TextBox x:Name="tb" IsReadOnly="True" AcceptsReturn="False" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
Grid.Row="1"></TextBox>
</Grid>
</dx:ThemedWindow>
VIZ.Package.Module/Log/View/ErrorLogWindow.xaml.cs
0 → 100644
View file @
bfc47cfa
using
DevExpress.Xpf.Core
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Shapes
;
using
VIZ.Framework.Core
;
namespace
VIZ.Package.Module
{
/// <summary>
/// Interaction logic for ErrorWindow.xaml
/// </summary>
public
partial
class
ErrorWindow
:
ThemedWindow
{
public
ErrorWindow
()
{
InitializeComponent
();
WPFHelper
.
BindingViewModel
(
this
,
new
ErrorWindowModel
());
this
.
Closing
+=
VizCommandWindow_Closing
;
}
private
void
VizCommandWindow_Closing
(
object
sender
,
System
.
ComponentModel
.
CancelEventArgs
e
)
{
e
.
Cancel
=
true
;
this
.
Visibility
=
Visibility
.
Collapsed
;
}
}
}
VIZ.Package.Module/Log/View/ErrorWindow.xaml
0 → 100644
View file @
bfc47cfa
<dx:ThemedWindow
x:Class="VIZ.Package.Module.ErrorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
Title="ErrorWindow" Height="800" Width="1000"
>
<Grid>
</Grid>
</dx:ThemedWindow>
VIZ.Package.Module/Log/View/ErrorWindow.xaml.cs
0 → 100644
View file @
bfc47cfa
using
DevExpress.Xpf.Core
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Shapes
;
namespace
VIZ.Package.Module
{
/// <summary>
/// Interaction logic for ErrorWindow.xaml
/// </summary>
public
partial
class
ErrorWindow
:
ThemedWindow
{
public
ErrorWindow
()
{
InitializeComponent
();
}
}
}
VIZ.Package.Module/Log/View/VizCommandWindow.xaml
0 → 100644
View file @
bfc47cfa
<dx:ThemedWindow
x:Class="VIZ.Package.Module.VizCommandWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
Title="VizCommandWindow" Height="800" Width="1000"
>
<Grid>
</Grid>
</dx:ThemedWindow>
VIZ.Package.Module/Log/View/VizCommandWindow.xaml.cs
0 → 100644
View file @
bfc47cfa
using
DevExpress.Xpf.Core
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Data
;
using
System.Windows.Documents
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Media.Imaging
;
using
System.Windows.Shapes
;
namespace
VIZ.Package.Module
{
/// <summary>
/// Interaction logic for VizCommandWindow.xaml
/// </summary>
public
partial
class
VizCommandWindow
:
ThemedWindow
{
public
VizCommandWindow
()
{
InitializeComponent
();
}
}
}
VIZ.Package.Module/Log/ViewModel/ErrorLogWindowModel.cs
0 → 100644
View file @
bfc47cfa
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Framework.Core
;
using
VIZ.Package.Domain
;
namespace
VIZ.Package.Module
{
/// <summary>
/// 错误窗口模型
/// </summary>
public
class
ErrorWindowModel
:
ViewModelBase
{
/// <summary>
/// 日志
/// </summary>
private
static
readonly
ILog
log
=
LogManager
.
GetLogger
(
typeof
(
ErrorWindowModel
));
/// <summary>
/// 错误窗口模型
/// </summary>
public
ErrorWindowModel
()
{
// 初始化命令
this
.
InitCommand
();
// 初始化消息
this
.
InitMessage
();
}
/// <summary>
/// 初始化命令
/// </summary>
private
void
InitCommand
()
{
this
.
ClearCommand
=
new
VCommand
(
this
.
Clear
);
}
/// <summary>
/// 初始化消息
/// </summary>
private
void
InitMessage
()
{
ApplicationDomainEx
.
MessageManager
.
Register
<
VizCommandLogMessage
>(
this
,
this
.
OnVizCommandLogMessage
);
}
// ==================================================================================
// Command
// ==================================================================================
#
region
ClearCommand
--
清除消息
/// <summary>
/// 清除消息
/// </summary>
public
VCommand
ClearCommand
{
get
;
set
;
}
/// <summary>
/// 清除
/// </summary>
private
void
Clear
()
{
VizCommandWindow
view
=
this
.
GetView
<
VizCommandWindow
>();
if
(
view
==
null
)
return
;
view
.
tb
.
Clear
();
}
#
endregion
// ==================================================================================
// Message
// ==================================================================================
/// <summary>
/// Viz命令日志
/// </summary>
/// <param name="msg">消息</param>
private
void
OnVizCommandLogMessage
(
VizCommandLogMessage
msg
)
{
WPFHelper
.
BeginInvoke
(()
=>
{
VizCommandWindow
view
=
this
.
GetView
<
VizCommandWindow
>();
if
(
view
==
null
)
return
;
string
log
=
$"
{
DateTime
.
Now
.
ToString
(
"HH:mm:ss"
)}
{
msg
.
Log
}
"
;
view
.
tb
.
AppendText
(
$"
{
log
}
\r\n"
);
view
.
tb
.
ScrollToEnd
();
});
}
// ==================================================================================
// Public Function
// ==================================================================================
}
}
\ No newline at end of file
VIZ.Package.Module/Log/ViewModel/ErrorWindowModel.cs
0 → 100644
View file @
bfc47cfa
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Module.Log.ViewModel
{
internal
class
ErrorWindowModel
{
}
}
VIZ.Package.Module/Log/ViewModel/VizCommandWindowModel.cs
0 → 100644
View file @
bfc47cfa
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Module.Log.ViewModel
{
internal
class
VizCommandWindowModel
{
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment