Skip to content

Commit

Permalink
upload project
Browse files Browse the repository at this point in the history
  • Loading branch information
zw3639 committed Nov 16, 2017
1 parent 1fbfee9 commit 673486f
Show file tree
Hide file tree
Showing 27 changed files with 31,970 additions and 0 deletions.
19 changes: 19 additions & 0 deletions AboutWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Window x:Class="Cracker.AboutWindow"
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:Cracker"
xmlns:props="clr-namespace:Cracker.Properties"
mc:Ignorable="d"
Title="{x:Static props:Resources.About}" Height="300" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded">
<Grid>
<Grid Height="150">
<Image Source="xiaonh.ico" Width="64" Height="64" VerticalAlignment="Top" />
<Label Name="lbName" Margin="0,70,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Center" />
<TextBlock Margin="0,100,0,0" VerticalAlignment="Top" HorizontalAlignment="Center">
<Hyperlink Name="hlCompany" Click="hlCompany_Click" />
</TextBlock>
</Grid>
</Grid>
</Window>
54 changes: 54 additions & 0 deletions AboutWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
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.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Cracker
{
/// <summary>
/// AboutWindow.xaml 的交互逻辑
/// </summary>
public partial class AboutWindow : Window
{
public AboutWindow()
{
InitializeComponent();
}

private void Window_Loaded(object sender, RoutedEventArgs e)
{
AssemblyTitleAttribute title = (AssemblyTitleAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyTitleAttribute));
string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
lbName.Content = title.Title + " " + version;

AssemblyCompanyAttribute company = (AssemblyCompanyAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyCompanyAttribute));
AssemblyCopyrightAttribute copyright = (AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyCopyrightAttribute));
hlCompany.Inlines.Add(company.Company);
hlCompany.Tag = company.Company;
}

private void hlCompany_Click(object sender, RoutedEventArgs e)
{
Hyperlink hl = (Hyperlink)sender;
try
{
Process.Start((string)hl.Tag);
}
catch
{

}
}
}
}
Loading

0 comments on commit 673486f

Please sign in to comment.