Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite app2 #183

Merged
merged 2 commits into from
Jul 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 146 additions & 0 deletions GoogleAnalyticsv4For.Net/GoogleAnalyticsv4For.Net.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{38DFD93A-70DD-4AD2-A363-724057303BE2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GoogleAnalyticsv4For.Net</RootNamespace>
<AssemblyName>GoogleAnalyticsv4For.Net</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.15063.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<PlatformTarget>x86</PlatformTarget>
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<PlatformTarget>ARM</PlatformTarget>
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
<PlatformTarget>ARM64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
<PlatformTarget>ARM64</PlatformTarget>
<OutputPath>bin\ARM64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Helper\GaTrackerType.cs" />
<Compile Include="Helper\GoogleAnalyticsEndpoints.cs" />
<Compile Include="Helper\GoogleAnalyticsRequestType.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\GoogleAnalyticsv4For.Net.rd.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.14</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- 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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
42 changes: 40 additions & 2 deletions appLauncher.sln
Original file line number Diff line number Diff line change
@@ -1,38 +1,76 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.10
# Visual Studio Version 17
VisualStudioVersion = 17.6.33815.320
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "appLauncher", "appLauncher\appLauncher.csproj", "{825249DF-2022-4222-96A1-69A32AA4E16C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GoogleAnalyticsv4SDK", "..\GoogleAnalyticsv4SDKFor.Net\GoogleAnalyticsv4SDK\GoogleAnalyticsv4SDK.csproj", "{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|Any CPU.ActiveCfg = Debug|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|Any CPU.Build.0 = Debug|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|Any CPU.Deploy.0 = Debug|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|ARM.ActiveCfg = Debug|ARM
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|ARM.Build.0 = Debug|ARM
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|ARM.Deploy.0 = Debug|ARM
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|ARM64.ActiveCfg = Debug|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|ARM64.Build.0 = Debug|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|ARM64.Deploy.0 = Debug|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|x64.ActiveCfg = Debug|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|x64.Build.0 = Debug|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|x64.Deploy.0 = Debug|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|x86.ActiveCfg = Debug|x86
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|x86.Build.0 = Debug|x86
{825249DF-2022-4222-96A1-69A32AA4E16C}.Debug|x86.Deploy.0 = Debug|x86
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|Any CPU.ActiveCfg = Release|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|Any CPU.Build.0 = Release|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|Any CPU.Deploy.0 = Release|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|ARM.ActiveCfg = Release|ARM
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|ARM.Build.0 = Release|ARM
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|ARM.Deploy.0 = Release|ARM
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|ARM64.ActiveCfg = Release|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|ARM64.Build.0 = Release|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|ARM64.Deploy.0 = Release|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|x64.ActiveCfg = Release|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|x64.Build.0 = Release|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|x64.Deploy.0 = Release|x64
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|x86.ActiveCfg = Release|x86
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|x86.Build.0 = Release|x86
{825249DF-2022-4222-96A1-69A32AA4E16C}.Release|x86.Deploy.0 = Release|x86
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Debug|ARM.ActiveCfg = Debug|ARM
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Debug|ARM.Build.0 = Debug|ARM
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Debug|ARM64.ActiveCfg = Debug|ARM64
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Debug|ARM64.Build.0 = Debug|ARM64
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Debug|x64.ActiveCfg = Debug|x64
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Debug|x64.Build.0 = Debug|x64
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Debug|x86.ActiveCfg = Debug|x86
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Debug|x86.Build.0 = Debug|x86
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Release|Any CPU.Build.0 = Release|Any CPU
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Release|ARM.ActiveCfg = Release|ARM
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Release|ARM.Build.0 = Release|ARM
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Release|ARM64.ActiveCfg = Release|ARM64
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Release|ARM64.Build.0 = Release|ARM64
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Release|x64.ActiveCfg = Release|x64
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Release|x64.Build.0 = Release|x64
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Release|x86.ActiveCfg = Release|x86
{80207DE7-F5EF-4B47-9C81-E65DEA1D4832}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
12 changes: 8 additions & 4 deletions appLauncher/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using appLauncher.Core.Helpers;
using appLauncher.Core.Pages;


using GoogleAnalyticsv4SDK.Validation;

using System;
using System.Threading.Tasks;
Expand All @@ -10,6 +10,7 @@
using Windows.ApplicationModel.Activation;
using Windows.ApplicationModel.Core;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Storage;
using Windows.UI;
using Windows.UI.ViewManagement;
Expand All @@ -27,7 +28,8 @@ namespace appLauncher
sealed partial class App : Application
{
public static ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;

public ExceptionEventCalls reportException;
public ScreenViewEventCalls reportScreenViews;

/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
Expand Down Expand Up @@ -79,10 +81,12 @@ protected override async void OnLaunched(LaunchActivatedEventArgs e)

//Extends view into status bar/title bar, depending on the device used.
await SettingsHelper.LoadAppSettingsAsync();
var appView = ApplicationView.GetForCurrentView();
reportScreenViews = new ScreenViewEventCalls(SettingsHelper.totalAppSettings.MeasurementID, SettingsHelper.totalAppSettings.APISecret, SettingsHelper.totalAppSettings.ClientID);
reportException = new ExceptionEventCalls(SettingsHelper.totalAppSettings.MeasurementID, SettingsHelper.totalAppSettings.APISecret, SettingsHelper.totalAppSettings.ClientID);
ApplicationView appView = ApplicationView.GetForCurrentView();
appView.SetPreferredMinSize(new Size(360, 360));
appView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);
var qualifiers = Windows.ApplicationModel.Resources.Core.ResourceContext.GetForCurrentView().QualifierValues;
IObservableMap<string, string> qualifiers = Windows.ApplicationModel.Resources.Core.ResourceContext.GetForCurrentView().QualifierValues;
SettingsHelper.SetApplicationResources();
if (qualifiers.ContainsKey("DeviceFamily") && qualifiers["DeviceFamily"] == "Desktop")
{
Expand Down
11 changes: 10 additions & 1 deletion appLauncher/Core/Helpers/imageHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Windows.System.Threading;
using Windows.UI;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;

namespace appLauncher.Core.Helpers
Expand Down Expand Up @@ -98,8 +99,12 @@ public static async Task LoadBackgroundImages()
List<PageBackgrounds> images = JsonConvert.DeserializeObject<List<PageBackgrounds>>(apps);
backgroundImage = new ObservableCollection<PageBackgrounds>(images);
}
catch (Exception e)
catch (Exception es)
{
if (SettingsHelper.totalAppSettings.Reporting)
{
await ((App)Application.Current).reportException.CollectException(es);
}
}
}
await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
Expand All @@ -123,6 +128,10 @@ public static async Task SaveImageOrder()
}
catch (Exception es)
{
if (SettingsHelper.totalAppSettings.Reporting)
{
await ((App)Application.Current).reportException.CollectException(es);
}
}
}
public static async Task<bool> IsFilePresent(string fileName, string folderPath = "")
Expand Down
32 changes: 31 additions & 1 deletion appLauncher/Core/Helpers/packageHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Windows.Storage;
using Windows.Storage.Streams;
using Windows.UI;
using Windows.UI.Xaml;

namespace appLauncher.Core.Helpers
{
Expand Down Expand Up @@ -50,12 +51,17 @@ public static async Task LoadCollectionAsync()
try
{


StorageFile item = (StorageFile)await ApplicationData.Current.LocalFolder.TryGetItemAsync("collection.json");
string apps = await Windows.Storage.FileIO.ReadTextAsync(item);
listApps = JsonConvert.DeserializeObject<List<AppTiles>>(apps);
}
catch (Exception es)
{
if (SettingsHelper.totalAppSettings.Reporting)
{
await ((App)Application.Current).reportException.CollectException(es);
}

}
}
Expand Down Expand Up @@ -88,6 +94,10 @@ public static async Task LoadCollectionAsync()
Apps.Tip = $"Name: {item.DisplayName}{Environment.NewLine}Developer: {item.PublisherDisplayName}{Environment.NewLine}Installed: {item.InstalledDate}";
Apps.Logo = new byte[1];
listApps.Add(Apps);
if (SettingsHelper.totalAppSettings.Reporting)
{
await ((App)Application.Current).reportException.CollectException(es);
}
es = null;
continue;
}
Expand Down Expand Up @@ -117,13 +127,21 @@ public static async Task LoadCollectionAsync()
Apps.Tip = $"Name: {item.DisplayName}{Environment.NewLine}Developer: {item.PublisherDisplayName}{Environment.NewLine}Installed: {item.InstalledDate}";
Apps.Logo = new byte[1];
listApps.Add(Apps);
if (SettingsHelper.totalAppSettings.Reporting)
{
await ((App)Application.Current).reportException.CollectException(es);
}
es = null;
continue;
}
}
}
catch (Exception es)
{
if (SettingsHelper.totalAppSettings.Reporting)
{
await ((App)Application.Current).reportException.CollectException(es);
}
}
}
}
Expand Down Expand Up @@ -159,7 +177,10 @@ public static async Task SaveCollectionAsync()
}
catch (Exception es)
{

if (SettingsHelper.totalAppSettings.Reporting)
{
await ((App)Application.Current).reportException.CollectException(es);
}
}
}
public static async Task<bool> LaunchApp(string fullname)
Expand Down Expand Up @@ -228,13 +249,22 @@ public static async Task RescanForNewApplications()
AppListed.Tip = $"Name: {item.DisplayName}{Environment.NewLine}Developer: {item.PublisherDisplayName}{Environment.NewLine}Installed: {item.InstalledDate}";
AppListed.Logo = new byte[1];
listApps.Add(AppListed);
if (SettingsHelper.totalAppSettings.Reporting)
{
await ((App)Application.Current).reportException.CollectException(es);
}
es = null;
continue;
}
}
}
catch (Exception es)
{
if (SettingsHelper.totalAppSettings.Reporting)
{
await ((App)Application.Current).reportException.CollectException(es);
}

}
}
List<AppTiles> listOfApps = Apps.GetOriginalCollection().ToList();
Expand Down
Loading