diff options
-rw-r--r-- | WarframeClock.sln | 2 | ||||
-rw-r--r-- | WarframeClock/App.config | 6 | ||||
-rw-r--r-- | WarframeClock/App.xaml | 8 | ||||
-rw-r--r-- | WarframeClock/App.xaml.cs (renamed from WarframeClock/Program.cs) | 35 | ||||
-rw-r--r-- | WarframeClock/FodyWeavers.xml | 4 | ||||
-rw-r--r-- | WarframeClock/FodyWeavers.xsd | 111 | ||||
-rw-r--r-- | WarframeClock/OverlayWindow.xaml | 3 | ||||
-rw-r--r-- | WarframeClock/OverlayWindow.xaml.cs | 6 | ||||
-rw-r--r-- | WarframeClock/Properties/AssemblyInfo.cs | 23 | ||||
-rw-r--r-- | WarframeClock/Properties/Resources.Designer.cs (renamed from WarframeClock/Properties/Resources1.Designer.cs) | 0 | ||||
-rw-r--r-- | WarframeClock/WarframeClock.csproj | 87 | ||||
-rw-r--r-- | WarframeClock/packages.config | 5 |
12 files changed, 94 insertions, 196 deletions
diff --git a/WarframeClock.sln b/WarframeClock.sln index e94a933..26ab426 100644 --- a/WarframeClock.sln +++ b/WarframeClock.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.28307.271 +VisualStudioVersion = 15.0.28307.421 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WarframeClock", "WarframeClock\WarframeClock.csproj", "{B6F30BD0-5917-4C89-8C8D-DEF0029E08A3}" EndProject diff --git a/WarframeClock/App.config b/WarframeClock/App.config index ff3c507..ac126d3 100644 --- a/WarframeClock/App.config +++ b/WarframeClock/App.config @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <configuration> - <startup> - <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/> - </startup> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/> + </startup> </configuration> diff --git a/WarframeClock/App.xaml b/WarframeClock/App.xaml new file mode 100644 index 0000000..8a9ad4d --- /dev/null +++ b/WarframeClock/App.xaml @@ -0,0 +1,8 @@ +<Application x:Class="WarframeClock.App" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:WarframeClock" + StartupUri="OverlayWindow.xaml"> + <Application.Resources> + </Application.Resources> +</Application> diff --git a/WarframeClock/Program.cs b/WarframeClock/App.xaml.cs index e5aa189..4e6a437 100644 --- a/WarframeClock/Program.cs +++ b/WarframeClock/App.xaml.cs @@ -1,38 +1,41 @@ using System; using System.Linq; using System.Threading; +using System.Windows; namespace WarframeClock { - class Program + /// <summary> + /// Interaction logic for App.xaml + /// </summary> + public partial class App : Application { public static readonly string VersionString = "Warframe Clock Overlay 2019-01-22"; public static readonly bool UseWorldStatePhp = true; - private static Timer worldStateFetchTimer; - private static System.Windows.Forms.NotifyIcon notifyIcon; - private static OverlayWindow overlayWindow; + private Timer worldStateFetchTimer; + private System.Windows.Forms.NotifyIcon notifyIcon; - [STAThread] - static void Main(string[] args) + protected override void OnStartup(StartupEventArgs e) { + base.OnStartup(e); + try { if (UseWorldStatePhp) StartWorldStateFetch(); StartNotifyIcon(); - StartOverlay(); } catch (Exception ex) { Console.WriteLine($"Main: Uncaught exception: {ex.Message}"); Console.WriteLine(ex.StackTrace); - System.Windows.Forms.MessageBox.Show($"Main: Uncaught exception: {ex.Message}\n{ex.StackTrace}"); + MessageBox.Show($"Main: Uncaught exception: {ex.Message}\n{ex.StackTrace}"); Terminate(); } } - private static void StartWorldStateFetch() + private void StartWorldStateFetch() { worldStateFetchTimer = new Timer(state => { @@ -57,14 +60,14 @@ namespace WarframeClock }, null, 0, 10 * 60 * 1000 /* 10 minutes */); } - private static void StartNotifyIcon() + private void StartNotifyIcon() { var iconMenu = new System.Windows.Forms.ContextMenu(); notifyIcon = new System.Windows.Forms.NotifyIcon() { Text = "Warframe Clock", ContextMenu = iconMenu, - Icon = Properties.Resources.TrayIcon + Icon = WarframeClock.Properties.Resources.TrayIcon }; iconMenu.MenuItems.Add(new System.Windows.Forms.MenuItem(VersionString) { Enabled = false }); @@ -72,17 +75,11 @@ namespace WarframeClock notifyIcon.Visible = true; } - private static void StartOverlay() - { - overlayWindow = new OverlayWindow(); - overlayWindow.Start(); - } - - private static void Terminate() + private void Terminate() { notifyIcon.Dispose(); - overlayWindow.Close(); worldStateFetchTimer.Change(Timeout.Infinite, Timeout.Infinite); + MainWindow?.Close(); Environment.Exit(0); } } diff --git a/WarframeClock/FodyWeavers.xml b/WarframeClock/FodyWeavers.xml deleted file mode 100644 index 447fd4a..0000000 --- a/WarframeClock/FodyWeavers.xml +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> - <Costura /> -</Weavers> diff --git a/WarframeClock/FodyWeavers.xsd b/WarframeClock/FodyWeavers.xsd deleted file mode 100644 index 44a5374..0000000 --- a/WarframeClock/FodyWeavers.xsd +++ /dev/null @@ -1,111 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> - <xs:element name="Weavers"> - <xs:complexType> - <xs:all> - <xs:element name="Costura" minOccurs="0" maxOccurs="1"> - <xs:complexType> - <xs:all> - <xs:element minOccurs="0" maxOccurs="1" name="ExcludeAssemblies" type="xs:string"> - <xs:annotation> - <xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation> - </xs:annotation> - </xs:element> - <xs:element minOccurs="0" maxOccurs="1" name="IncludeAssemblies" type="xs:string"> - <xs:annotation> - <xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation> - </xs:annotation> - </xs:element> - <xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string"> - <xs:annotation> - <xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation> - </xs:annotation> - </xs:element> - <xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string"> - <xs:annotation> - <xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation> - </xs:annotation> - </xs:element> - <xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string"> - <xs:annotation> - <xs:documentation>The order of preloaded assemblies, delimited with line breaks.</xs:documentation> - </xs:annotation> - </xs:element> - </xs:all> - <xs:attribute name="CreateTemporaryAssemblies" type="xs:boolean"> - <xs:annotation> - <xs:documentation>This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="IncludeDebugSymbols" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="DisableCompression" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="DisableCleanup" type="xs:boolean"> - <xs:annotation> - <xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="LoadAtModuleInit" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="IgnoreSatelliteAssemblies" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="ExcludeAssemblies" type="xs:string"> - <xs:annotation> - <xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="IncludeAssemblies" type="xs:string"> - <xs:annotation> - <xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="Unmanaged32Assemblies" type="xs:string"> - <xs:annotation> - <xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="Unmanaged64Assemblies" type="xs:string"> - <xs:annotation> - <xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="PreloadOrder" type="xs:string"> - <xs:annotation> - <xs:documentation>The order of preloaded assemblies, delimited with |.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - </xs:element> - </xs:all> - <xs:attribute name="VerifyAssembly" type="xs:boolean"> - <xs:annotation> - <xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="VerifyIgnoreCodes" type="xs:string"> - <xs:annotation> - <xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="GenerateXsd" type="xs:boolean"> - <xs:annotation> - <xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - </xs:element> -</xs:schema>
\ No newline at end of file diff --git a/WarframeClock/OverlayWindow.xaml b/WarframeClock/OverlayWindow.xaml index 9a3750f..2888f7d 100644 --- a/WarframeClock/OverlayWindow.xaml +++ b/WarframeClock/OverlayWindow.xaml @@ -1,8 +1,9 @@ <Window x:Class="WarframeClock.OverlayWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:local="clr-namespace:WarframeClock" mc:Ignorable="d" Title="WarframeClock OverlayWindow" WindowStyle="None" diff --git a/WarframeClock/OverlayWindow.xaml.cs b/WarframeClock/OverlayWindow.xaml.cs index 7b71a6e..e019dde 100644 --- a/WarframeClock/OverlayWindow.xaml.cs +++ b/WarframeClock/OverlayWindow.xaml.cs @@ -6,6 +6,9 @@ using System.Windows.Interop; namespace WarframeClock { + /// <summary> + /// Interaction logic for OverlayWindow.xaml + /// </summary> public partial class OverlayWindow : Window { private IntPtr windowHandle; @@ -24,10 +27,7 @@ namespace WarframeClock InitializeComponent(); windowHandle = new WindowInteropHelper(this).EnsureHandle(); xTopmost = false; - } - public void Start() - { var updateLoop = Task.Factory.StartNew(() => { while (true) diff --git a/WarframeClock/Properties/AssemblyInfo.cs b/WarframeClock/Properties/AssemblyInfo.cs index b24e4b0..9dd057d 100644 --- a/WarframeClock/Properties/AssemblyInfo.cs +++ b/WarframeClock/Properties/AssemblyInfo.cs @@ -1,6 +1,8 @@ using System.Reflection; +using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -19,8 +21,25 @@ using System.Runtime.InteropServices; // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b6f30bd0-5917-4c89-8c8d-def0029e08a3")] +//In order to begin building localizable applications, set +//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file +//inside a <PropertyGroup>. For example, if you are using US english +//in your source files, set the <UICulture> to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + // Version information for an assembly consists of the following four values: // diff --git a/WarframeClock/Properties/Resources1.Designer.cs b/WarframeClock/Properties/Resources.Designer.cs index 4c6da81..4c6da81 100644 --- a/WarframeClock/Properties/Resources1.Designer.cs +++ b/WarframeClock/Properties/Resources.Designer.cs diff --git a/WarframeClock/WarframeClock.csproj b/WarframeClock/WarframeClock.csproj index 8bcf4e6..aa5f885 100644 --- a/WarframeClock/WarframeClock.csproj +++ b/WarframeClock/WarframeClock.csproj @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\packages\Costura.Fody.3.3.0\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.3.3.0\build\Costura.Fody.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -11,9 +10,10 @@ <AssemblyName>WarframeClock</AssemblyName> <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WarningLevel>4</WarningLevel> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <Deterministic>true</Deterministic> - <TargetFrameworkProfile /> <PublishUrl>publish\</PublishUrl> <Install>true</Install> <InstallFrom>Disk</InstallFrom> @@ -29,8 +29,7 @@ <IsWebBootstrapper>false</IsWebBootstrapper> <UseApplicationTrust>false</UseApplicationTrust> <BootstrapperEnabled>true</BootstrapperEnabled> - <NuGetPackageImportStamp> - </NuGetPackageImportStamp> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> @@ -52,65 +51,73 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup> - <StartupObject /> - </PropertyGroup> - <PropertyGroup /> - <PropertyGroup> - <SignAssembly>false</SignAssembly> + <ApplicationIcon>Resources\TrayIcon.ico</ApplicationIcon> </PropertyGroup> <ItemGroup> - <Reference Include="Costura, Version=3.3.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL"> - <HintPath>..\packages\Costura.Fody.3.3.0\lib\net40\Costura.dll</HintPath> - </Reference> - <Reference Include="PresentationCore" /> - <Reference Include="PresentationFramework" /> <Reference Include="System" /> - <Reference Include="System.Core" /> + <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Runtime.Serialization" /> <Reference Include="System.Windows.Forms" /> - <Reference Include="System.Xaml" /> + <Reference Include="System.Xml" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> - <Reference Include="Microsoft.CSharp" /> - <Reference Include="System.Data" /> <Reference Include="System.Net.Http" /> - <Reference Include="System.Xml" /> + <Reference Include="System.Xaml"> + <RequiredTargetFramework>4.0</RequiredTargetFramework> + </Reference> <Reference Include="WindowsBase" /> + <Reference Include="PresentationCore" /> + <Reference Include="PresentationFramework" /> </ItemGroup> <ItemGroup> + <ApplicationDefinition Include="App.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </ApplicationDefinition> + <Compile Include="WorldState.cs" /> + <Page Include="OverlayWindow.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Compile Include="App.xaml.cs"> + <DependentUpon>App.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> <Compile Include="Clock.cs" /> <Compile Include="Native.cs" /> <Compile Include="OverlayWindow.xaml.cs"> <DependentUpon>OverlayWindow.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs"> + <SubType>Code</SubType> </Compile> - <Compile Include="Program.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Properties\Resources1.Designer.cs"> + <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> <DependentUpon>Resources.resx</DependentUpon> </Compile> - <Compile Include="WorldState.cs" /> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + <SubType>Designer</SubType> + </EmbeddedResource> </ItemGroup> <ItemGroup> <None Include="App.config" /> - <None Include="packages.config" /> </ItemGroup> <ItemGroup> <None Include="Resources\TrayIcon.ico" /> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="Properties\Resources.resx"> - <Generator>ResXFileCodeGenerator</Generator> - <LastGenOutput>Resources1.Designer.cs</LastGenOutput> - <SubType>Designer</SubType> - </EmbeddedResource> - </ItemGroup> - <ItemGroup> - <BootstrapperPackage Include=".NETFramework,Version=v4.6.2"> + <BootstrapperPackage Include=".NETFramework,Version=v4.7.2"> <Visible>False</Visible> - <ProductName>Microsoft .NET Framework 4.6.2 %28x86 and x64%29</ProductName> + <ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName> <Install>true</Install> </BootstrapperPackage> <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> @@ -119,19 +126,5 @@ <Install>false</Install> </BootstrapperPackage> </ItemGroup> - <ItemGroup> - <Page Include="OverlayWindow.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - </Page> - </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <Import Project="..\packages\Fody.3.3.5\build\Fody.targets" Condition="Exists('..\packages\Fody.3.3.5\build\Fody.targets')" /> - <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> - <PropertyGroup> - <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> - </PropertyGroup> - <Error Condition="!Exists('..\packages\Fody.3.3.5\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.3.5\build\Fody.targets'))" /> - <Error Condition="!Exists('..\packages\Costura.Fody.3.3.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.3.0\build\Costura.Fody.props'))" /> - </Target> </Project>
\ No newline at end of file diff --git a/WarframeClock/packages.config b/WarframeClock/packages.config deleted file mode 100644 index 3d24229..0000000 --- a/WarframeClock/packages.config +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<packages> - <package id="Costura.Fody" version="3.3.0" targetFramework="net462" /> - <package id="Fody" version="3.3.5" targetFramework="net462" developmentDependency="true" /> -</packages>
\ No newline at end of file |