From 7ca5acd47166e77612eec33060b83925d6410d40 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sat, 9 Jan 2021 22:30:23 -0500 Subject: [PATCH] implement InstallationStatus from MBS Framework for Android --- MBS.Framework/Application.cs | 6 ++++ MBS.Framework/InstallationStatus.cs | 47 +++++++++++++++++++++++++++++ MBS.Framework/MBS.Framework.csproj | 1 + 3 files changed, 54 insertions(+) create mode 100644 MBS.Framework/InstallationStatus.cs diff --git a/MBS.Framework/Application.cs b/MBS.Framework/Application.cs index fd7c649..9020686 100644 --- a/MBS.Framework/Application.cs +++ b/MBS.Framework/Application.cs @@ -33,6 +33,12 @@ namespace MBS.Framework public string Title { get; set; } = String.Empty; public int ExitCode { get; protected set; } = 0; + protected virtual InstallationStatus GetInstallationStatusInternal() + { + return InstallationStatus.Unknown; + } + public InstallationStatus InstallationStatus { get { return GetInstallationStatusInternal(); } } + public CommandLine CommandLine { get; protected set; } = null; public Application() diff --git a/MBS.Framework/InstallationStatus.cs b/MBS.Framework/InstallationStatus.cs new file mode 100644 index 0000000..ca227b4 --- /dev/null +++ b/MBS.Framework/InstallationStatus.cs @@ -0,0 +1,47 @@ +// +// InstallationStatus.cs +// +// Author: +// Michael Becker +// +// Copyright (c) 2021 Mike Becker's Software +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +using System; +namespace MBS.Framework +{ + public enum InstallationStatus + { + /// + /// The application installation status cannot be determined. + /// + Unknown, + /// + /// Indicates that the application has been launched before. + /// + Installed, + /// + /// Indicates that the application is launching for the first time, or the user has cleared the shared application data. + /// + New, + /// + /// Indicates that the application has been upgraded since it was last run. + /// + Upgraded, + /// + /// On Microsoft Windows, indicates an application that has been advertised by the Windows Installer system but has not actually been installed on the user's computer. + /// + Advertised + } +} diff --git a/MBS.Framework/MBS.Framework.csproj b/MBS.Framework/MBS.Framework.csproj index ca7a53c..41355ba 100644 --- a/MBS.Framework/MBS.Framework.csproj +++ b/MBS.Framework/MBS.Framework.csproj @@ -95,6 +95,7 @@ +