Commit b1400c78 by liulongfei

1. 添加调试面板

2. 添加应用程序配置
parent 5b3bb857
...@@ -227,6 +227,7 @@ ...@@ -227,6 +227,7 @@
<Compile Include="VideoControl\Stream\VideoStreamOptionBase.cs" /> <Compile Include="VideoControl\Stream\VideoStreamOptionBase.cs" />
<Compile Include="VideoControl\Stream\VideoStreamTaskBase.cs" /> <Compile Include="VideoControl\Stream\VideoStreamTaskBase.cs" />
<Compile Include="Widgets\ColorPickButton\ColorPickButton.cs" /> <Compile Include="Widgets\ColorPickButton\ColorPickButton.cs" />
<Compile Include="Widgets\DebugBorder\DebugBorder.cs" />
<Compile Include="Widgets\DragWindowBar\DragWindowBar.cs" /> <Compile Include="Widgets\DragWindowBar\DragWindowBar.cs" />
<Compile Include="Widgets\NavigationControl\NavigationConfig.cs" /> <Compile Include="Widgets\NavigationControl\NavigationConfig.cs" />
<Compile Include="Widgets\NavigationControl\NavigationControl.cs" /> <Compile Include="Widgets\NavigationControl\NavigationControl.cs" />
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using VIZ.Framework.Core;
using VIZ.Framework.Domain;
namespace VIZ.Framework.Common
{
/// <summary>
/// 调试面板
/// </summary>
public class DebugBorder : Border
{
public DebugBorder()
{
this.Loaded += DebugBorder_Loaded;
}
/// <summary>
/// 是否已经完成加载
/// </summary>
private bool isAlreadyLoaded = false;
private void DebugBorder_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
if (WPFHelper.IsInDesignMode(this))
return;
if (this.isAlreadyLoaded)
return;
this.Visibility = ApplicationDomain.IS_DEBUG ? System.Windows.Visibility.Visible : System.Windows.Visibility.Hidden;
this.isAlreadyLoaded = true;
}
}
}
...@@ -44,5 +44,15 @@ namespace VIZ.Framework.Domain ...@@ -44,5 +44,15 @@ namespace VIZ.Framework.Domain
/// 监控管理器 /// 监控管理器
/// </summary> /// </summary>
public static IMonitorManager MonitorManager { get; private set; } = new MonitorManager(); public static IMonitorManager MonitorManager { get; private set; } = new MonitorManager();
/// <summary>
/// 是否是调试模式
/// </summary>
public static bool IS_DEBUG { get; private set; }
static ApplicationDomain()
{
IS_DEBUG = IniStorage.GetValue<ApplicationConfig, bool>(p => p.APPLICATION_IS_DEBUG);
}
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Framework.Storage
{
/// <summary>
/// 应用程序配置
/// </summary>
public class ApplicationConfig : IniConfigBase
{
/// <summary>
/// 是否是调试模式 (True | Flase)
/// </summary>
[Ini(Section = "Application", DefaultValue = "False", Type = typeof(bool))]
public string APPLICATION_IS_DEBUG { get; set; }
}
}
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Ini\Config\ApplicationConfig.cs" />
<Compile Include="Ini\Config\Navigation3DConfig.cs" /> <Compile Include="Ini\Config\Navigation3DConfig.cs" />
<Compile Include="Ini\Config\VideoConfig.cs" /> <Compile Include="Ini\Config\VideoConfig.cs" />
<Compile Include="Ini\IniAttribute.cs" /> <Compile Include="Ini\IniAttribute.cs" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment