<Window x:Class="NetMonitor.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:NetMonitor"
mc:Ignorable="d"
BorderThickness="15"
Title="MainWindow" Height="450" Width="800" AllowsTransparency="True" WindowStyle="None"> <Window.Effect>
<DropShadowEffect BlurRadius="15" Color="Gray" Direction="100" ShadowDepth="0"/>
</Window.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="70" />
<RowDefinition Height="*" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="260"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<DockPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Background="#f1f1f1" MouseLeftButtonDown="OnWindowMouseMove" MouseDown="OnWindowMouseDown">
<Image DockPanel.Dock="Left" Width="80" Source="res/logo.ico" />
<Label DockPanel.Dock="Left" Width="160" Content="网络监控系统" FontFamily="微软雅黑" FontSize="24" VerticalAlignment="Center"/> <Button DockPanel.Dock="Right" Width="40" Background="Transparent" BorderBrush="Transparent" Click="OnClose">X</Button>
<Button DockPanel.Dock="Right" Width="40" Background="Transparent" BorderBrush="Transparent" Click="OnMax">口</Button>
<Button DockPanel.Dock="Right" Width="40" Background="Transparent" BorderBrush="Transparent" Click="OnMin">-</Button>
<Button DockPanel.Dock="Right" Width="40" Background="Transparent" BorderBrush="Transparent">三</Button>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Width="90" Background="Transparent" BorderBrush="Transparent">TreeView</Button>
<Button Width="90" Background="Transparent" BorderBrush="Transparent">事件列表</Button>
<Button Width="90" Background="Transparent" BorderBrush="Transparent">管理平台</Button>
<Button Width="90" Background="Transparent" BorderBrush="Transparent">逻辑视图</Button>
</StackPanel>
</DockPanel>
<StackPanel Grid.Row="1" Grid.Column="0">
<Label Content="Tree" />
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1">
<Label Content="Main" />
</StackPanel> <Border Background="#f1f1f1" BorderBrush="#f1f1f1" BorderThickness="0,3,0,0" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2">
</Border> <GridSplitter Grid.Row="1" Grid.Column="0" Width="3"/>
</Grid>
</Window>

  

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading; namespace NetMonitor
{
public partial class MainWindow : Window
{
public int nClickNum = ;
public long nLastTime; public MainWindow()
{
InitializeComponent();
WindowStartupLocation = WindowStartupLocation.CenterScreen;
} private void OnWindowMouseMove(object sender, MouseEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
{
this.DragMove();
}
} private void OnClose(object sender, RoutedEventArgs e)
{
this.Close();
} private void OnMax(object sender, RoutedEventArgs e)
{
if (this.WindowState == WindowState.Normal)
{
this.BorderThickness = new Thickness();
this.MaxWidth = SystemParameters.WorkArea.Width + ;
this.MaxHeight = SystemParameters.WorkArea.Height + ;
this.WindowState = WindowState.Maximized;
}
else
{
this.WindowState = WindowState.Normal;
this.BorderThickness = new Thickness();
}
} private void OnMin(object sender, RoutedEventArgs e)
{
this.WindowState = WindowState.Minimized;
} private void OnWindowMouseDown(object sender, MouseButtonEventArgs e)
{
nClickNum++;
if (nClickNum == )
{
nLastTime = DateTime.Now.Ticks;
}
else if (nClickNum == )
{
nClickNum = ; long nNow = DateTime.Now.Ticks;
long cha = nNow - nLastTime;
if (nNow - nLastTime < )
{
if (this.WindowState == WindowState.Normal)
{
this.BorderThickness = new Thickness();
this.MaxWidth = SystemParameters.WorkArea.Width + ;
this.MaxHeight = SystemParameters.WorkArea.Height + ;
this.WindowState = WindowState.Maximized;
}
else
{
this.WindowState = WindowState.Normal;
this.BorderThickness = new Thickness();
}
}
}
}
}
}

最新NetMonitor代码的更多相关文章

  1. 下载最新Android代码的方法

    之前我是去Android官方网站下载最新Android代码,但是这种方法需要FQ,而且有时候FQ又不太方便,今天我发现一个不错的网站,是清华大学搞的,跟Android官方的代码基本保持同步,而且下载方 ...

  2. struts2最新s2-016代码执行漏洞CVE-2013-2251

    这是一个代码执行漏洞,利用java代码来执行系统命令.   影响版本:Struts 2.0.0 – Struts 2.3.15   漏洞说明: The Struts 2 DefaultActionMa ...

  3. 构建命令maven install 打包不是最新的代码

    问题: 之前一直用的是mvn install 命令来构建项目,但是最近发现最新的代码没有在war包中.之前看的说 mvn install 命令会执行之前的所有阶段,会被编译,测试,打包. 经查最后采用 ...

  4. 【IDEA】【Git】pull代码始终无法pull到最新的代码或者提示pull no items 【解决方式】

    最近pull代码老是提示pull no items,但是本地并不是最新的代码,看了各种博客始终无法解决,最后靠自己的方式解决.下面是解决方法. 方法:1.首先git --> repository ...

  5. 用控制台命令拉取git最新仓库代码

    C#利用Diagnostics  拉取最新代码  示例代码 static void DiagnosticTest() { Process p; ProcessStartInfo psi; psi = ...

  6. jenkins构建,拉取不到最新版本代码,报clock of the subversion server appears to be out of sync

    一.问题描述 今天遇到个问题,我这边提交了代码后,一般会马上去jenkins上点一下,构建到开发环境上. 但是发现修改没生效,后来发现,提交的版本假设是3250,但是jenkins构建使用的版本为32 ...

  7. Git使用手册/Git教程:git fetch 将远程仓库的分支及分支最新版本代码拉取到本地

    相关文章: 关于验证是否存在ssh配置以及生成SSH Key的方法可以参照文章:Git使用手册:生成SSH Key 关于SSH Key的使用和公钥在gitHub.gitLab的配置等,请参考文章:Gi ...

  8. iOS 设备推断 最新统计代码

    - (NSString*) deviceName {     struct utsname systemInfo;          uname(&systemInfo);          ...

  9. github如何pull最新代码

      github现在已经经常用了,但是经常遇到下面的问题 比如:从一个项目A中fork了一个分支B,并且在分支B有了改动.过了几天后,项目A中的代码应该会有很多人提交修改了,现在想将最新的代码pull ...

随机推荐

  1. RSA非对称式加解密笔记

    1.服务器生成[公钥]和[私钥],成对生成: 2.客户端生成证书信息,使用[公钥]进行加密,前提是有公钥,并生成证书信息: 3.客户端发送自身的计算机名.MAC.用户名.证书内容给服务器: 4.服务器 ...

  2. Python Number(数字)

    Python Number 数据类型用于存储数值. 数据类型是不允许改变的,这就意味着如果改变 Number 数据类型的值,将重新分配内存空间. 以下实例在变量赋值时 Number 对象将被创建: A ...

  3. PHP对二维数组进行排序

    /** * 获取最近的店铺 * @param $lng * @param $lat * @return array */ protected function getClosestShop($lng, ...

  4. 030 SSM综合练习06--数据后台管理系统--SSM权限操作及Spring Security入门

    1.权限操作涉及的三张表 (1)用户表信息描述users sql语句: CREATE TABLE users ( id ) DEFAULT SYS_GUID () PRIMARY KEY, email ...

  5. 图解分布式一致性协议Paxos

    Paxos协议/算法是分布式系统中比较重要的协议,它有多重要呢? <分布式系统的事务处理>: Google Chubby的作者Mike Burrows说过这个世界上只有一种一致性算法,那就 ...

  6. c++11多线程记录4:死锁

    简单示例 举个例子,桌上有一支笔和一张纸,小A和小B都要拿到纸笔写字 小A拿了笔,小B拿了纸,这时就形成了死锁(两人都不愿意让出纸笔). 其实只要稍加控制就可以避免这种情况:规定必须先拿到纸再能去尝试 ...

  7. rancher部署kubernets集群

    docker的安装 先添加docker源 sudo apt update sudo apt install docker.io docker更换国内镜像 1.配置脚本如下: #!/bin/bashca ...

  8. kafka学习笔记(一)——概述

    1.kafka是什么? 官方说明是: Kafka是一个分布式的基于发布/订阅模式的消息队列,主要应用于大数据实时处理领域. 提到了两个概念: 发布/订阅模式 消息队列 下边来理解一下这两个名词. 2. ...

  9. Redis Cluster: (error) MOVED

      I have a Redis cluster with the following nodes: 192.168.0.14:6379 master (slots from 0 to 16383) ...

  10. asp.net core 之中间件

    Http请求资源的过程可以看成一个管道:“Pipe”,并不是所有的请求都是合法的.安全的,其于功能.性能或安全方面的考虑,通常需要在这管道中装配一些处理程序来筛选和加工这些请求.这些处理程序就是中间件 ...