-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Demo code, SDK executables and a README
- Loading branch information
1 parent
bd1e746
commit 8e4749e
Showing
146 changed files
with
66,736 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
# BlueParrott-Updater-SDK | ||
# GNA Updater SDK Demo | ||
|
||
GNA Updater SDK Demo (Demo) is a sample application showcasing the GNA Updater SDK (SDK) functionality. | ||
It consists of Demo code located at "gna-updater-sdk-demo" folder and SDK files located at "gna-updater-sdk-..." folder. | ||
|
||
## Build and Use | ||
|
||
Build and usage instructions for Demo application as well as SDK documentation can be found at "gna-updater-sdk-demo\Documentation" folder. | ||
|
||
## Credits | ||
|
||
- [Newtonsoft.Json](https://www.newtonsoft.com/json) is used for JSON serialization/deserialization | ||
- [NLog](https://github.com/NLog/NLog) is used for logging | ||
- [GalaSoft MvvmLight](https://github.com/lbugnion/mvvmlight) is used for MVVM pattern implementation | ||
- [CommonServiceLocator](https://github.com/unitycontainer/commonservicelocator) is used for IoC pattern implementation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<configSections> | ||
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | ||
<section name="GNAUpdaterSDK_Demo.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> | ||
</sectionGroup> | ||
</configSections> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | ||
</startup> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="CommonServiceLocator" publicKeyToken="489b6accfaf20ef0" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-2.0.6.0" newVersion="2.0.6.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
<applicationSettings> | ||
<GNAUpdaterSDK_Demo.Properties.Settings> | ||
<setting name="SDKLoggingLevel" serializeAs="String"> | ||
<value>3</value> | ||
</setting> | ||
<setting name="DemoLoggingLevel" serializeAs="String"> | ||
<value>3</value> | ||
</setting> | ||
</GNAUpdaterSDK_Demo.Properties.Settings> | ||
</applicationSettings> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<Application x:Class="GNAUpdaterSDK_Demo.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:GNAUpdaterSDK_Demo" StartupUri="Views/MainWindow.xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" d1p1:Ignorable="d" xmlns:view="clr-namespace:GNAUpdaterSDK_Demo.Views" xmlns:vm="clr-namespace:GNAUpdaterSDK_Demo.ViewModels" xmlns:helpers="clr-namespace:GNAUpdaterSDK_Demo.Helpers" xmlns:converters="clr-namespace:GNAUpdaterSDK_Demo.Converters" xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006"> | ||
<Application.Resources> | ||
<ResourceDictionary> | ||
<vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /> | ||
<DataTemplate DataType="{x:Type vm:DefaultDeviceInformationViewModel}"> | ||
<view:DefaultDeviceInformationView /> | ||
</DataTemplate> | ||
<DataTemplate DataType="{x:Type vm:ConnectedDevicesControlViewModel}"> | ||
<view:ConnectedDevicesControlView /> | ||
</DataTemplate> | ||
<DataTemplate DataType="{x:Type vm:InfoWindowViewModel}"> | ||
<view:InfoWindowView /> | ||
</DataTemplate> | ||
<DataTemplate DataType="{x:Type vm:OtherFunctionsWindowViewModel}"> | ||
<view:OtherFunctionsWindowView /> | ||
</DataTemplate> | ||
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> | ||
<converters:EmptyStringConverter x:Key="EmptyStringConverter" /> | ||
<converters:CountToVisibilityInverterConverter x:Key="CountToVisibilityInverterConverter" /> | ||
<converters:CommandResultsToStringConverter x:Key="CommandResultsToStringConverter" /> | ||
<converters:InvertableBooleanToVisibilityConverter x:Key="InvertableBooleanToVisibilityConverter" /> | ||
<converters:FullPathToShortConverter x:Key="FullPathToShortConverter" /> | ||
<helpers:ColorHelper x:Key="ColorHelper" /> | ||
<helpers:GeneralHelper x:Key="GeneralHelper" /> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="Styles/Styles.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Windows; | ||
|
||
namespace GNAUpdaterSDK_Demo | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
//TODO: Update version numbers before release | ||
//Revision format is YYMMDD | ||
internal static readonly Version DemoVersion = new Version(1, 1, 3, 230526); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Windows.Input; | ||
|
||
namespace GNAUpdaterSDK_Demo.Commands | ||
{ | ||
public class CommandHandler : ICommand | ||
{ | ||
private Action _action; | ||
private bool _canExecute; | ||
public CommandHandler(Action action, bool canExecute) | ||
{ | ||
_action = action; | ||
_canExecute = canExecute; | ||
} | ||
|
||
public bool CanExecute(object parameter) | ||
{ | ||
return _canExecute; | ||
} | ||
|
||
|
||
#pragma warning disable CS0067 | ||
public event EventHandler CanExecuteChanged; | ||
|
||
public void Execute(object parameter) | ||
{ | ||
_action(); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
gna-updater-sdk-demo/Converters/BooleanToVisibilityConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
using System.Windows.Markup; | ||
|
||
namespace GNAUpdaterSDK_Demo.Converters | ||
{ | ||
public class BooleanToVisibilityConverter : MarkupExtension, IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
var val = System.Convert.ToBoolean(value); | ||
return val ? Visibility.Visible : Visibility.Hidden; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return value?.Equals(Visibility.Visible) ?? false; | ||
} | ||
|
||
public override object ProvideValue(IServiceProvider serviceProvider) | ||
{ | ||
return this; | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
gna-updater-sdk-demo/Converters/CommandResultsToStringConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using GNAUpdaterSDK_Demo.Models; | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using System.Windows.Markup; | ||
|
||
namespace GNAUpdaterSDK_Demo.Converters | ||
{ | ||
public class CommandResultsToStringConverter : MarkupExtension, IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is CommandResults val) | ||
{ | ||
return getCommandResultsString(val); | ||
} | ||
else | ||
{ | ||
return value.ToString(); | ||
} | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, | ||
object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public override object ProvideValue(IServiceProvider serviceProvider) | ||
{ | ||
return this; | ||
} | ||
|
||
public static string getCommandResultsString(CommandResults val) | ||
{ | ||
if (val == CommandResults.NA) | ||
{ | ||
return "N/A"; | ||
} | ||
|
||
return val.ToString(); | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
gna-updater-sdk-demo/Converters/CountToVisibilityInverterConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
using System.Windows.Markup; | ||
|
||
namespace GNAUpdaterSDK_Demo.Converters | ||
{ | ||
public class CountToVisibilityInverterConverter : MarkupExtension, IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, | ||
object parameter, CultureInfo culture) | ||
{ | ||
if (value is int val) | ||
{ | ||
return val > 0 ? Visibility.Collapsed : Visibility.Visible; | ||
} | ||
else | ||
{ | ||
return Visibility.Collapsed; | ||
} | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, | ||
object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public override object ProvideValue(IServiceProvider serviceProvider) | ||
{ | ||
return this; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using System.Windows.Markup; | ||
|
||
namespace GNAUpdaterSDK_Demo.Converters | ||
{ | ||
public class EmptyStringConverter : MarkupExtension, IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, | ||
object parameter, CultureInfo culture) | ||
{ | ||
string result; | ||
|
||
if (value is int) | ||
{ | ||
result = value.ToString(); | ||
} | ||
else | ||
{ | ||
result = value as string; | ||
} | ||
|
||
return string.IsNullOrEmpty(result) ? parameter : result; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, | ||
object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public override object ProvideValue(IServiceProvider serviceProvider) | ||
{ | ||
return this; | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
gna-updater-sdk-demo/Converters/FullPathToShortConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.IO; | ||
using System.Windows.Data; | ||
using System.Windows.Markup; | ||
|
||
namespace GNAUpdaterSDK_Demo.Converters | ||
{ | ||
public class FullPathToShortConverter : MarkupExtension, IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is string val) | ||
{ | ||
return Path.GetFileName(val); | ||
} | ||
else | ||
{ | ||
return value.ToString(); | ||
} | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, | ||
object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public override object ProvideValue(IServiceProvider serviceProvider) | ||
{ | ||
return this; | ||
} | ||
} | ||
} | ||
|
37 changes: 37 additions & 0 deletions
37
gna-updater-sdk-demo/Converters/InvertableBooleanToVisibilityConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
using System.Windows.Markup; | ||
|
||
namespace GNAUpdaterSDK_Demo.Converters | ||
{ | ||
[ValueConversion(typeof(bool), typeof(Visibility))] | ||
public class InvertableBooleanToVisibilityConverter : MarkupExtension, IValueConverter | ||
{ | ||
public InvertableBooleanToVisibilityConverter() | ||
{ | ||
TrueValue = Visibility.Collapsed; | ||
FalseValue = Visibility.Visible; | ||
} | ||
|
||
public Visibility TrueValue { get; set; } | ||
public Visibility FalseValue { get; set; } | ||
|
||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
bool val = System.Convert.ToBoolean(value); | ||
return val ? TrueValue : FalseValue; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return TrueValue.Equals(value) ? true : false; | ||
} | ||
|
||
public override object ProvideValue(IServiceProvider serviceProvider) | ||
{ | ||
return this; | ||
} | ||
} | ||
} |
Binary file added
BIN
+585 KB
gna-updater-sdk-demo/Documentation/GNA_Updater_SDK_documentation__v_1_1_0.docx
Binary file not shown.
Binary file added
BIN
+49.4 KB
gna-updater-sdk-demo/Documentation/How to build GNAUpdaterSDK Demo.docx
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+728 KB
gna-updater-sdk-demo/Documentation/pdf/GNA_Updater_SDK_documentation__v_1_0_0.pdf
Binary file not shown.
Binary file added
BIN
+120 KB
gna-updater-sdk-demo/Documentation/pdf/How to build GNAUpdaterSDK Demo.pdf
Binary file not shown.
Binary file added
BIN
+237 KB
gna-updater-sdk-demo/Documentation/pdf/How to use GNAUpdaterSDK Demo.pdf
Binary file not shown.
Oops, something went wrong.