Skip to content

Commit

Permalink
Merge pull request #20 from Zenderable/default
Browse files Browse the repository at this point in the history
Release 1.0 Beta
  • Loading branch information
Zenderable authored Jan 7, 2021
2 parents 2ba956a + 0370e6a commit 635c7e5
Show file tree
Hide file tree
Showing 13 changed files with 563 additions and 10 deletions.
34 changes: 34 additions & 0 deletions DataAccessLibrary/DataAccess.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Data.Sqlite;
using Windows.Storage;
using System.IO;

namespace DataAccessLibrary
{
public static class DataAccess
{
public async static void InitializeDatabase()
{
await ApplicationData.Current.LocalFolder.CreateFileAsync("sqliteData.db", CreationCollisionOption.OpenIfExists);
string dbpath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "sqliteData.db");
using (SqliteConnection db =
new SqliteConnection($"Filename={dbpath}"))
{
db.Open();

String tableCommand = "CREATE TABLE IF NOT " +
"EXISTS QRCodes (Primary_Key INTEGER PRIMARY KEY, " +
"Title NVARCHAR(2048) NULL,"+
"Url NVARCHAR(2048) NULL)";

SqliteCommand createTable = new SqliteCommand(tableCommand, db);

createTable.ExecuteReader();
}
}
}
}
146 changes: 146 additions & 0 deletions DataAccessLibrary/DataAccessLibrary.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>{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DataAccessLibrary</RootNamespace>
<AssemblyName>DataAccessLibrary</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.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="DataAccess.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\DataAccessLibrary.rd.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite.Core">
<Version>5.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.10</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>
29 changes: 29 additions & 0 deletions DataAccessLibrary/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DataAccessLibrary")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DataAccessLibrary")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
33 changes: 33 additions & 0 deletions DataAccessLibrary/Properties/DataAccessLibrary.rd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains Runtime Directives, specifications about types your application accesses
through reflection and other dynamic code patterns. Runtime Directives are used to control the
.NET Native optimizer and ensure that it does not remove code accessed by your library. If your
library does not do any reflection, then you generally do not need to edit this file. However,
if your library reflects over types, especially types passed to it or derived from its types,
then you should write Runtime Directives.
The most common use of reflection in libraries is to discover information about types passed
to the library. Runtime Directives have three ways to express requirements on types passed to
your library.
1. Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter
Use these directives to reflect over types passed as a parameter.
2. SubTypes
Use a SubTypes directive to reflect over types derived from another type.
3. AttributeImplies
Use an AttributeImplies directive to indicate that your library needs to reflect over
types or methods decorated with an attribute.
For more information on writing Runtime Directives for libraries, please visit
https://go.microsoft.com/fwlink/?LinkID=391919
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Library Name="DataAccessLibrary">

<!-- add directives for your library here -->

</Library>
</Directives>
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Adam Pszczoła, Karol Stumski, Michał Siuda

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
26 changes: 26 additions & 0 deletions QRCodeGenerator.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@ VisualStudioVersion = 16.0.30002.166
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QRCodeGenerator", "QRCodeGenerator\QRCodeGenerator.csproj", "{CD73B69E-A354-4591-BD4D-60C6876B6FB2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataAccessLibrary", "DataAccessLibrary\DataAccessLibrary.csproj", "{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}"
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
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Debug|Any CPU.ActiveCfg = Debug|x86
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Debug|ARM.ActiveCfg = Debug|ARM
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Debug|ARM.Build.0 = Debug|ARM
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Debug|ARM.Deploy.0 = Debug|ARM
Expand All @@ -29,6 +34,7 @@ Global
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Debug|x86.ActiveCfg = Debug|x86
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Debug|x86.Build.0 = Debug|x86
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Debug|x86.Deploy.0 = Debug|x86
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Release|Any CPU.ActiveCfg = Release|x86
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Release|ARM.ActiveCfg = Release|ARM
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Release|ARM.Build.0 = Release|ARM
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Release|ARM.Deploy.0 = Release|ARM
Expand All @@ -41,6 +47,26 @@ Global
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Release|x86.ActiveCfg = Release|x86
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Release|x86.Build.0 = Release|x86
{CD73B69E-A354-4591-BD4D-60C6876B6FB2}.Release|x86.Deploy.0 = Release|x86
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Debug|ARM.ActiveCfg = Debug|ARM
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Debug|ARM.Build.0 = Debug|ARM
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Debug|ARM64.ActiveCfg = Debug|ARM64
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Debug|ARM64.Build.0 = Debug|ARM64
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Debug|x64.ActiveCfg = Debug|x64
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Debug|x64.Build.0 = Debug|x64
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Debug|x86.ActiveCfg = Debug|x86
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Debug|x86.Build.0 = Debug|x86
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Release|Any CPU.Build.0 = Release|Any CPU
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Release|ARM.ActiveCfg = Release|ARM
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Release|ARM.Build.0 = Release|ARM
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Release|ARM64.ActiveCfg = Release|ARM64
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Release|ARM64.Build.0 = Release|ARM64
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Release|x64.ActiveCfg = Release|x64
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Release|x64.Build.0 = Release|x64
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Release|x86.ActiveCfg = Release|x86
{CE909BF9-3634-4F0E-A99D-5D3E7310E2B5}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
3 changes: 3 additions & 0 deletions QRCodeGenerator/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using DataAccessLibrary;

namespace QRCodeGenerator
{
Expand All @@ -30,6 +31,8 @@ public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;

DataAccess.InitializeDatabase();
}

/// <summary>
Expand Down
34 changes: 34 additions & 0 deletions QRCodeGenerator/EditPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Page
x:Class="QRCodeGenerator.EditPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:qrCodeGenerator="using:QRCodeGenerator"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="700*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<ScrollViewer VerticalScrollBarVisibility="Visible" >
<GridView Grid.Row="0" ItemsSource="{x:Bind ViewModel.ExampleItems}" ContainerContentChanging="GridView_ContainerContentChanging">
<GridView.ItemTemplate>
<DataTemplate x:DataType="qrCodeGenerator:ExampleItem">
<StackPanel Margin="20,20,20,20" Tapped="StackPanel_Tapped" Name="{x:Bind Title}" Tag="{x:Bind Url}" >
<TextBlock Text="{x:Bind Title}" Margin="0,0,0,5" FontWeight="Bold"/>
<Image Source="{x:Bind Url}" x:Phase="1" Height="250" Width="250"/>
</StackPanel>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
</ScrollViewer>

<CommandBar Grid.Row="1">
<AppBarButton Label="Back" Icon="Back" Click="Back_Click"></AppBarButton>
</CommandBar>
</Grid>
</Page>
Loading

0 comments on commit 635c7e5

Please sign in to comment.