From 3492292c4f006945781714b731303a12b0f1dd3a Mon Sep 17 00:00:00 2001 From: czw <selecti@yeah.net> Date: 星期三, 02 七月 2025 11:15:40 +0800 Subject: [PATCH] 1 --- 2025年6月12日/AuxAllWCS/Views/View2.xaml | 5 2025年6月12日/AuxAllWCS/Build/Project/代码/VS自定义类/ConsoleInterceptor.cs | 32 ++++++++ 2025年6月12日/AuxAllWCS/Build/Project/代码/自定义类.cs | 8 +- 2025年6月12日/AuxAllWCS/Build/Project/AuxAllWCS.csproj | 1 2025年6月12日/AuxAllWCS/Build/Project/代码/界面事件.cs | 12 ++- 2025年6月12日/AuxAllWCS/Views/View1.xaml | 105 +------------------------- 2025年6月12日/AuxAllWCS/Views/View.json | 39 +++++++-- 7 files changed, 80 insertions(+), 122 deletions(-) diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/AuxAllWCS.csproj" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/AuxAllWCS.csproj" index 14f7acc..9defc6f 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/AuxAllWCS.csproj" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/AuxAllWCS.csproj" @@ -194,6 +194,7 @@ <DependentUpon>App.xaml</DependentUpon> <SubType>Code</SubType> </Compile> + <Compile Include="浠g爜\VS鑷畾涔夌被\ConsoleInterceptor.cs" /> <Compile Include="鐣岄潰\View2.xaml.cs"> <DependentUpon>View2.xaml</DependentUpon> </Compile> diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/ConsoleInterceptor.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/ConsoleInterceptor.cs" new file mode 100644 index 0000000..1e9ba84 --- /dev/null +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/ConsoleInterceptor.cs" @@ -0,0 +1,32 @@ +锘縰sing System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GZ.Projects.AuxAllWCS +{ + // 鍒涘缓鑷畾涔夌殑 TextWriter + public class ConsoleInterceptor : TextWriter + { + private readonly TextWriter _originalOut; + + public ConsoleInterceptor() + { + _originalOut = Console.Out; + } + + public override Encoding Encoding => Encoding.UTF8; + + public override void WriteLine(string value = "") + { + // 鍦ㄨ繖閲屾嫤鎴鐞嗚緭鍑�+ //string intercepted = $"[鎷︽埅鍒扮殑杈撳嚭] {value}"; + + //// 鍙互閫夋嫨缁х画杈撳嚭鍒板師鎺у埗鍙�+ //_originalOut.WriteLine(intercepted); + } + + } +} diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\347\225\214\351\235\242\344\272\213\344\273\266.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\347\225\214\351\235\242\344\272\213\344\273\266.cs" index 09da4a5..fb57599 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\347\225\214\351\235\242\344\272\213\344\273\266.cs" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\347\225\214\351\235\242\344\272\213\344\273\266.cs" @@ -62,10 +62,6 @@ } View1_Init(sender, e); - - LogHelper.Info($"<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>"); - LogHelper.Info($"<<<<<<<<<<<<<<<<<绋嬪簭路鍚姩>>>>>>>>>>>>>>"); - LogHelper.Info($"<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>"); /// <summary> /// 绋嬪簭鐗囨:鍒濆鍖栭厤缃� /// 鎻忚堪: @@ -1056,6 +1052,14 @@ /// <param name="e"></param> public void View1_Init(object sender, RoutedEventArgs e) { + LogHelper.Info($"<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>"); + LogHelper.Info($"<<<<<<<<<<<<<<<<<绋嬪簭路鍚姩>>>>>>>>>>>>>>"); + + // 浣跨敤鎷︽埅鍣�+ var interceptor = new ConsoleInterceptor(); + Console.SetOut(interceptor); + + LogHelper.Info($"<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>"); } #endregion diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" index ada40af..3427268 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/\350\207\252\345\256\232\344\271\211\347\261\273.cs" @@ -172,11 +172,11 @@ // 娣诲姞target-console - var consoleTarget = new ColoredConsoleTarget(); - consoleTarget.Layout = @"${longdate} | ${level:uppercase=false:padding=-5} | ${message} ${onexception:${exception:format=tostring} ${newline} ${stacktrace} ${newline}"; + //var consoleTarget = new ColoredConsoleTarget(); + //consoleTarget.Layout = @"${longdate} | ${level:uppercase=false:padding=-5} | ${message} ${onexception:${exception:format=tostring} ${newline} ${stacktrace} ${newline}"; - config.AddTarget("console", consoleTarget); - config.AddRule(LogLevel.Debug, LogLevel.Fatal, consoleTarget); + //config.AddTarget("console", consoleTarget); + //config.AddRule(LogLevel.Debug, LogLevel.Fatal, consoleTarget); //娣诲姞target-info var infoFileTarget = new FileTarget(); diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Views/View.json" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Views/View.json" index d110c1a..118b948 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Views/View.json" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Views/View.json" @@ -18,15 +18,7 @@ "Controls": [ { "Name": "", - "Type": "Canvas", - "FullType": "", - "Assembly": "", - "Events": [], - "Commands": [] - }, - { - "Name": "", - "Type": "Label", + "Type": "Grid", "FullType": "", "Assembly": "", "Events": [], @@ -44,9 +36,36 @@ "NamedControls": [], "Events": [], "Commands": [] + }, + { + "ID": "20250702102310624", + "Name": "View2", + "Desc": "", + "Directory": "/", + "FilePath": "/View2.xaml", + "FileName": "View2.xaml", + "Content": "", + "ParentID": "", + "Children": [], + "Type": "View", + "IsStartup": false, + "IsMainForm": false, + "Controls": [ + { + "Name": "", + "Type": "Canvas", + "FullType": "", + "Assembly": "", + "Events": [], + "Commands": [] + } + ], + "NamedControls": [], + "Events": [], + "Commands": [] } ], "Layouts": [], "CreationTime": "2025-02-26 15:31:21", - "LastWriteTime": "2025-07-02 10:11:01" + "LastWriteTime": "2025-07-02 10:54:40" } \ No newline at end of file diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Views/View1.xaml" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Views/View1.xaml" index 2b67554..1ed7f17 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Views/View1.xaml" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Views/View1.xaml" @@ -1,102 +1,5 @@ -<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="640" Height="480" x:Class="GZ.Projects.AuxAllWCS.View1" xmlns:local="clr-namespace:GZ.Projects.AuxAllWCS"> - <Grid> - <Grid> - <TabControl> - <TabControl.Resources> - <Style TargetType="TabItem"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="TabItem"> - <Border Name="Border" BorderThickness="1,1,1,0" BorderBrush="Gainsboro" CornerRadius="4,4,0,0" Margin="2,0"> - <ContentPresenter x:Name="ContentSite" - VerticalAlignment="Center" - HorizontalAlignment="Center" - ContentSource="Header" - Margin="10,2"/> - </Border> - <ControlTemplate.Triggers> - <Trigger Property="IsSelected" Value="True"> - <Setter TargetName="Border" Property="Background" Value="LightSkyBlue" /> - </Trigger> - <Trigger Property="IsSelected" Value="False"> - <Setter TargetName="Border" Property="Background" Value="GhostWhite" /> - </Trigger> - </ControlTemplate.Triggers> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - </TabControl.Resources> - <TabItem> - <TabItem.Header> - <StackPanel Orientation="Horizontal"> - <TextBlock Text="emmm" Foreground="Yellow" /> - </StackPanel> - </TabItem.Header> - <TextBlock HorizontalAlignment="Center" FontFamily="Courier New" Text="
 -////////////////////////////////////////////////////////////////////
 -// _ooOoo_ //
 -// o8888888o //
 -// 88' 銆�'88 //
 -// (| ^_^ |) //
 -// O\ = /O //
 -// ____/`---'\____ //
 -// .' \\| |// `. //
 -// / \\||| : |||// \ //
 -// / _||||| -:- |||||- \ //
 -// | | \\\ - /// | | //
 -// | \_| ''\---/'' | | //
 -// \ .-\__ `-` ___/-. / //
 -// ___`. .' /--.--\ `. . ___ //
 -// .'' '銆奰.___\_銆妡銆媉/___.' 銆�''. //
 -// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
 -// \ \ `-. \_ __\ /__ _/ .-` / / //
 -// ========`-.____`-.___\_____/___.-`____.-'======== //
 -// `=---=' //
 -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
 -// 浣涚淇濅綉 姘告棤BUG 姘镐笉淇敼 //
 -////////////////////////////////////////////////////////////////////" - TextWrapping="Wrap" /> - </TabItem> - <TabItem> - <TabItem.Header> - <StackPanel Orientation="Horizontal"> - <TextBlock Text="Rgv浠诲姟" Foreground="Purple" /> - </StackPanel> - </TabItem.Header> - <Label Content="Content goes here..." /> - </TabItem> - <TabItem> - <TabItem.Header> - <StackPanel Orientation="Horizontal"> - <TextBlock Text="AGV浠诲姟" Foreground="Black" /> - </StackPanel> - </TabItem.Header> - <Label Content="Content goes here..." /> - </TabItem> - <TabItem> - <TabItem.Header> - <StackPanel Orientation="Horizontal"> - <TextBlock Text="澹充綋涓嬫枡" Foreground="Blue" /> - </StackPanel> - </TabItem.Header> - <Label Content="Content goes here..." /> - </TabItem> - <TabItem> - <TabItem.Header> - <StackPanel Orientation="Horizontal"> - <TextBlock Text="鎬昏涓婃枡" Foreground="Red" /> - </StackPanel> - </TabItem.Header> - </TabItem> - <TabItem> - <TabItem.Header> - <StackPanel Orientation="Horizontal"> - <TextBlock Text="鎵爜澶� Foreground="Green" /> - </StackPanel> - </TabItem.Header> - </TabItem> - </TabControl> - </Grid> - </Grid> +<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="640" Height="480" x:Class="GZ.Projects.AuxAllWCS.View1" xmlns:local="clr-namespace:GZ.Projects.AuxAllWCS" xmlns:local1="clr-namespace:GZ.Projects.AuxAllWCS.鐣岄潰" Title="鍝堝搱wcs"> + <Grid> + <TextBlock HorizontalAlignment="Center" FontFamily="Courier New" Text="

////////////////////////////////////////////////////////////////////

// _ooOoo_ //

// o8888888o //

// 88' 銆�'88 //

// (| ^_^ |) //

// O\ = /O //

// ____/`---'\____ //

// .' \\| |// `. //

// / \\||| : |||// \ //

// / _||||| -:- |||||- \ //

// | | \\\ - /// | | //

// | \_| ''\---/'' | | //

// \ .-\__ `-` ___/-. / //

// ___`. .' /--.--\ `. . ___ //

// .'' '銆奰.___\_銆妡銆媉/___.' 銆�''. //

// | | : `- \`.;`\ _ /`;.`/ - ` : | | //

// \ \ `-. \_ __\ /__ _/ .-` / / //

// ========`-.____`-.___\_____/___.-`____.-'======== //

// `=---=' //

// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //

// 浣涚淇濅綉 姘告棤BUG 姘镐笉淇敼 //

////////////////////////////////////////////////////////////////////" TextWrapping="Wrap" /> + </Grid> </Window> \ No newline at end of file diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Views/View2.xaml" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Views/View2.xaml" index e5da1fe..6de97d7 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Views/View2.xaml" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Views/View2.xaml" @@ -1,4 +1,3 @@ -锘�Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="640" Height="480"> - <Canvas /> +<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="640" Height="480"> + <Canvas /> </Window> \ No newline at end of file -- Gitblit v1.9.1