Skip to content
Snippets Groups Projects
Commit 1e08b5c3 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Include icons for systray as resources.

Refers to #2
parent c956a42a
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
...@@ -68,9 +69,10 @@ ...@@ -68,9 +69,10 @@
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" /> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
...@@ -85,9 +87,10 @@ ...@@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
...@@ -109,9 +112,25 @@ ...@@ -109,9 +112,25 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="IconDefault" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\IconDefault.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IconStopped" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\IconStopped.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IconSuspended" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\IconSuspended.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IconTx0" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\IconTx0.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IconTx1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\IconTx1.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>
\ No newline at end of file
ATXTray/icon-default.ico

894 B

...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ApplicationIcon>AutoTx.ico</ApplicationIcon> <ApplicationIcon>Resources\IconDefault.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
...@@ -91,7 +91,11 @@ ...@@ -91,7 +91,11 @@
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="AutoTx.ico" /> <None Include="Resources\IconTx1.ico" />
<None Include="Resources\IconTx0.ico" />
<None Include="Resources\IconSuspended.ico" />
<None Include="Resources\IconStopped.ico" />
<None Include="Resources\IconDefault.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ATxCommon\ATxCommon.csproj"> <ProjectReference Include="..\ATxCommon\ATxCommon.csproj">
...@@ -99,6 +103,9 @@ ...@@ -99,6 +103,9 @@
<Name>ATxCommon</Name> <Name>ATxCommon</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="IconDefault.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
......
...@@ -39,11 +39,11 @@ namespace ATxTray ...@@ -39,11 +39,11 @@ namespace ATxTray
private static int _txProgressPct; private static int _txProgressPct;
private readonly NotifyIcon _notifyIcon = new NotifyIcon(); private readonly NotifyIcon _notifyIcon = new NotifyIcon();
private readonly Icon _tiDefault = new Icon("icon-default.ico"); private readonly Icon _tiDefault = Properties.Resources.IconDefault;
private readonly Icon _tiStopped = new Icon("icon-stopped.ico"); private readonly Icon _tiStopped = Properties.Resources.IconStopped;
private readonly Icon _tiSuspended = new Icon("icon-suspended.ico"); private readonly Icon _tiSuspended = Properties.Resources.IconSuspended;
private readonly Icon _tiTx0 = new Icon("icon-tx-0.ico"); private readonly Icon _tiTx0 = Properties.Resources.IconTx0;
private readonly Icon _tiTx1 = new Icon("icon-tx-1.ico"); private readonly Icon _tiTx1 = Properties.Resources.IconTx1;
private readonly ContextMenuStrip _cmStrip = new ContextMenuStrip(); private readonly ContextMenuStrip _cmStrip = new ContextMenuStrip();
private readonly ToolStripMenuItem _miExit = new ToolStripMenuItem(); private readonly ToolStripMenuItem _miExit = new ToolStripMenuItem();
private readonly ToolStripMenuItem _miTitle = new ToolStripMenuItem(); private readonly ToolStripMenuItem _miTitle = new ToolStripMenuItem();
...@@ -115,7 +115,7 @@ namespace ATxTray ...@@ -115,7 +115,7 @@ namespace ATxTray
_miTitle.Font = new Font(_cmStrip.Font, FontStyle.Bold); _miTitle.Font = new Font(_cmStrip.Font, FontStyle.Bold);
_miTitle.Text = AppTitle; _miTitle.Text = AppTitle;
_miTitle.Image = Image.FromFile("icon-default.ico"); _miTitle.Image = _tiDefault.ToBitmap();
_miTitle.BackColor = Color.LightCoral; _miTitle.BackColor = Color.LightCoral;
_miTitle.Click += ShowContextMenu; _miTitle.Click += ShowContextMenu;
......
...@@ -19,7 +19,7 @@ namespace ATxTray.Properties { ...@@ -19,7 +19,7 @@ namespace ATxTray.Properties {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
...@@ -59,5 +59,55 @@ namespace ATxTray.Properties { ...@@ -59,5 +59,55 @@ namespace ATxTray.Properties {
resourceCulture = value; resourceCulture = value;
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon IconDefault {
get {
object obj = ResourceManager.GetObject("IconDefault", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon IconStopped {
get {
object obj = ResourceManager.GetObject("IconStopped", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon IconSuspended {
get {
object obj = ResourceManager.GetObject("IconSuspended", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon IconTx0 {
get {
object obj = ResourceManager.GetObject("IconTx0", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon IconTx1 {
get {
object obj = ResourceManager.GetObject("IconTx1", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
} }
} }
File moved
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment