Skip to content

Commit 853936e

Browse files
authored
Merge pull request #1 from LeanZo/System-Tray
System Tray
2 parents d0f3f3e + e327195 commit 853936e

11 files changed

Lines changed: 63 additions & 265 deletions

File tree

CSYT.Setup/CSYT.Setup.wixproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ProductVersion>3.10</ProductVersion>
77
<ProjectGuid>75270705-c572-41d8-a88e-1398be06132c</ProjectGuid>
88
<SchemaVersion>2.0</SchemaVersion>
9-
<OutputName>CSYT 2.0 Setup</OutputName>
9+
<OutputName>CSYT 2.1 Setup</OutputName>
1010
<OutputType>Package</OutputType>
1111
</PropertyGroup>
1212
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
@@ -19,6 +19,9 @@
1919
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
2020
</PropertyGroup>
2121
<ItemGroup>
22+
<Compile Include="..\CSYT\Output.wxs">
23+
<Link>Output.wxs</Link>
24+
</Compile>
2225
<Compile Include="Product.wxs" />
2326
</ItemGroup>
2427
<ItemGroup>
@@ -37,6 +40,10 @@
3740
</ProjectReference>
3841
</ItemGroup>
3942
<ItemGroup>
43+
<WixExtension Include="WixNetFxExtension">
44+
<HintPath>$(WixExtDir)\WixNetFxExtension.dll</HintPath>
45+
<Name>WixNetFxExtension</Name>
46+
</WixExtension>
4047
<WixExtension Include="WixUIExtension">
4148
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
4249
<Name>WixUIExtension</Name>

CSYT.Setup/Product.wxs

Lines changed: 14 additions & 249 deletions
Large diffs are not rendered by default.

CSYT/CSYT.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@
6161
<PropertyGroup>
6262
<ApplicationIcon>video.ico</ApplicationIcon>
6363
</PropertyGroup>
64+
<PropertyGroup>
65+
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
66+
</PropertyGroup>
6467
<ItemGroup>
68+
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
69+
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
70+
</Reference>
6571
<Reference Include="System" />
6672
<Reference Include="System.Data" />
6773
<Reference Include="System.Xml" />
@@ -169,4 +175,7 @@
169175
<PreBuildEvent>
170176
</PreBuildEvent>
171177
</PropertyGroup>
178+
<PropertyGroup>
179+
<PostBuildEvent>call "%25wix%25\bin\heat.exe" dir "$(SolutionDir)CSYT\bin\x86\Release\ " -var "var.CSYT.TargetDir" -ag -srd -dr INSTALLFOLDER -cg ProductComponents -template fragment -out "$(ProjectDir)Output.wxs" -v -t "$(ProjectDir)Filter.xslt"</PostBuildEvent>
180+
</PropertyGroup>
172181
</Project>

CSYT/ChangeUrl.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:CSYT"
77
mc:Ignorable="d"
8-
Title="Change Video" Height="78.896" Width="393.214" ResizeMode="NoResize" ShowInTaskbar="False">
8+
Title="Change Video" Height="78.896" Width="393.214" ResizeMode="NoResize" ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
99

1010
<Grid FocusManager.FocusedElement="{Binding ElementName=TextBox_Url}">
1111
<TextBlock x:Name="TextBlock_Url" Margin="15,12" Foreground="Gray" Text="Insert Video Url..."/>

CSYT/Filter.xslt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
1111
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, '.pdb')]" use="@Id" />
1212
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, '.xml')]" use="@Id" />
1313
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, 'app.config')]" use="@Id" />
14+
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, 'CSYT.exe')]" use="@Id" />
15+
<xsl:key name="service-search" match="wix:Component[contains(wix:File/@Source, 'CSYT.exe.config')]" use="@Id" />
1416
<xsl:template match="wix:Component[key('service-search', @Id)]" />
1517
<xsl:template match="wix:ComponentRef[key('service-search', @Id)]" />
1618
</xsl:stylesheet>

CSYT/MainWindow.xaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,22 @@
66
xmlns:local="clr-namespace:CSYT"
77
xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
88
xmlns:shell="http://schemas.microsoft.com/netfx/2009/xaml/presentation"
9+
xmlns:tb="http://www.hardcodet.net/taskbar"
910
mc:Ignorable="d"
10-
Title="CSYT" AllowsTransparency="True" Background="Transparent" DataContext="{RelativeSource Self}" Width="683" Height="384" Topmost="True" Closing="Window_Closing" WindowStyle="None" KeyDown="Window_KeyDown" StateChanged="Window_StateChanged" MouseWheel="Window_MouseWheel" ResizeMode="NoResize" PreviewMouseRightButtonDown="Window_PreviewMouseRightButtonDown" PreviewMouseMove="Window_PreviewMouseMove" >
11+
Title="CSYT" AllowsTransparency="True" Background="Transparent" DataContext="{RelativeSource Self}" Width="683" Height="384" Topmost="True" Closing="Window_Closing" WindowStyle="None" KeyDown="Window_KeyDown" StateChanged="Window_StateChanged" MouseWheel="Window_MouseWheel" ResizeMode="NoResize" PreviewMouseRightButtonDown="Window_PreviewMouseRightButtonDown" PreviewMouseMove="Window_PreviewMouseMove" ShowInTaskbar="False" >
1112

1213
<Grid x:Name="Grid">
14+
15+
<tb:TaskbarIcon x:Name="TaskBar" IconSource="video.ico" ToolTipText="CSYT" MenuActivation="All" >
16+
<tb:TaskbarIcon.ContextMenu>
17+
<ContextMenu>
18+
<MenuItem x:Name="TaskBarChangeUrl" Header="_Change Video..."></MenuItem>
19+
<MenuItem x:Name="TaskBarSettings" Header="_Settings..."></MenuItem>
20+
<MenuItem x:Name="TaskBarExit" Header="_Exit"></MenuItem>
21+
</ContextMenu>
22+
</tb:TaskbarIcon.ContextMenu>
23+
</tb:TaskbarIcon>
24+
1325
<shell:Image x:Name="IMG_BG" Source="shortcuts.png" />
1426
<cefSharp:ChromiumWebBrowser x:Name="WebBrowser" Margin="0,0,0,0" PreviewMouseRightButtonDown="WebBrowser_RightClickOff" PreviewMouseRightButtonUp="WebBrowser_RightClickOff" />
1527
</Grid>

CSYT/MainWindow.xaml.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ public MainWindow()
2020

2121
DataContext = this;
2222

23-
Title = VersionInfo.AppNameAndVersion;
23+
TaskBar.ToolTipText = Title = VersionInfo.AppNameAndVersion;
2424

2525
WebBrowser.RequestHandler = new RequestHandler();
2626

2727
WebBrowser.LifeSpanHandler = new LifeSpanHandler(this);
28+
29+
TaskBarChangeUrl.Click += (sender, e) => new ChangeUrl(this).ShowDialog();
30+
TaskBarSettings.Click += (sender, e) => new Settings(this).ShowDialog();
31+
TaskBarExit.Click += (sender, e) => this.Close();
2832
}
2933

3034
// Prevents browser's right-click.
@@ -57,9 +61,6 @@ private void Window_KeyDown(object sender, KeyEventArgs e)
5761
if ((Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) && Keyboard.IsKeyDown(Key.N))
5862
new ChangeUrl(this).ShowDialog();
5963

60-
if ((Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) && Keyboard.IsKeyDown(Key.Z) && window.WindowState == WindowState.Maximized)
61-
window.WindowState = WindowState.Normal;
62-
6364
if ((Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) && Keyboard.IsKeyDown(Key.S))
6465
new Settings(this).ShowDialog();
6566
}

CSYT/Output.wxs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,20 @@
5050
<Component Id="cmpE22DA677162A8EC71F9715EF76272D57" Directory="INSTALLFOLDER" Guid="*">
5151
<File Id="fil386E4B08ECCD30ABCD6DB37ED139B277" KeyPath="yes" Source="$(var.CSYT.TargetDir)\chrome_elf.dll" />
5252
</Component>
53-
<Component Id="cmpDBC7495734D4AC6A71C70314470BEE14" Directory="INSTALLFOLDER" Guid="*">
54-
<File Id="filF76D133378BE988C2CBD90FF74376157" KeyPath="yes" Source="$(var.CSYT.TargetDir)\CSYT.exe" />
55-
</Component>
56-
<Component Id="cmpB6D72246277189B30517FD98222AF155" Directory="INSTALLFOLDER" Guid="*">
57-
<File Id="fil40F5DF92CBF66CF29A0A6915EBE3AE98" KeyPath="yes" Source="$(var.CSYT.TargetDir)\CSYT.exe.config" />
58-
</Component>
53+
54+
5955

6056
<Component Id="cmp41DC9741013CA4AD62A4A5FF421F08BC" Directory="INSTALLFOLDER" Guid="*">
6157
<File Id="fil84B847A9F8DABE6B95AF875695C9E6D1" KeyPath="yes" Source="$(var.CSYT.TargetDir)\d3dcompiler_47.dll" />
6258
</Component>
6359
<Component Id="cmp953E935EFD854363EA5BE90BEB265A15" Directory="INSTALLFOLDER" Guid="*">
6460
<File Id="fil1663242DBF722C40CBAF8839CC52B5ED" KeyPath="yes" Source="$(var.CSYT.TargetDir)\devtools_resources.pak" />
6561
</Component>
62+
<Component Id="cmpBE3C1D05C7C90455322C9F819A57A07A" Directory="INSTALLFOLDER" Guid="*">
63+
<File Id="filE7C602A91344AD969255F20A2CA7411A" KeyPath="yes" Source="$(var.CSYT.TargetDir)\Hardcodet.Wpf.TaskbarNotification.dll" />
64+
</Component>
65+
66+
6667
<Component Id="cmpBDBA16CBEE531189F4ADEB44F36FA9CA" Directory="INSTALLFOLDER" Guid="*">
6768
<File Id="fil22B9AE685C747A265E9A4BC34E90558B" KeyPath="yes" Source="$(var.CSYT.TargetDir)\icudtl.dat" />
6869
</Component>

CSYT/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("2.0.0.0")]
55-
[assembly: AssemblyFileVersion("2.0.0.0")]
54+
[assembly: AssemblyVersion("2.1.0.0")]
55+
[assembly: AssemblyFileVersion("2.1.0.0")]

CSYT/Settings.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:CSYT"
77
mc:Ignorable="d"
8-
Title="Settings" Height="192.783" Width="311.34" ResizeMode="NoResize">
8+
Title="Settings" Height="192.783" Width="311.34" ResizeMode="NoResize" WindowStartupLocation="CenterOwner">
99
<Grid>
1010
<GroupBox Header="Settings" HorizontalAlignment="Left" Height="100" Margin="10,10,0,0" VerticalAlignment="Top" Width="274">
1111
<Grid>

0 commit comments

Comments
 (0)