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

refactor by adding CoreServices project #3

Open
wants to merge 1 commit into
base: NewStructure
Choose a base branch
from
Open
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
18 changes: 16 additions & 2 deletions BaseTemplate.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseTemplate.Android", "Bas
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseTemplate.iOS", "BaseTemplate\BaseTemplate.iOS\BaseTemplate.iOS.csproj", "{F1E21F2E-4A53-4DDA-A198-1B778CAD73C8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseTemplate", "BaseTemplate\BaseTemplate\BaseTemplate.csproj", "{C632F893-3A9D-419A-B680-3CF5940D6921}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseTemplate", "BaseTemplate\BaseTemplate\BaseTemplate.csproj", "{C632F893-3A9D-419A-B680-3CF5940D6921}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TemplateFoundation", "TemplateFoundation\TemplateFoundation.csproj", "{902D1E2F-17A1-40E9-9B68-99C6D1D5DE6B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TemplateFoundationUnitTest", "TemplateFoundationUnitTest\TemplateFoundationUnitTest.csproj", "{0FBF1B04-403E-4330-892D-2A6E547F4B3A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TemplateFoundationUnitTest", "TemplateFoundationUnitTest\TemplateFoundationUnitTest.csproj", "{0FBF1B04-403E-4330-892D-2A6E547F4B3A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreServices", "CoreServices\CoreServices.csproj", "{F7937D67-C44C-4305-B645-C0C4F67F8B88}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -101,6 +103,18 @@ Global
{0FBF1B04-403E-4330-892D-2A6E547F4B3A}.Release|iPhone.Build.0 = Release|Any CPU
{0FBF1B04-403E-4330-892D-2A6E547F4B3A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{0FBF1B04-403E-4330-892D-2A6E547F4B3A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{F7937D67-C44C-4305-B645-C0C4F67F8B88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F7937D67-C44C-4305-B645-C0C4F67F8B88}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7937D67-C44C-4305-B645-C0C4F67F8B88}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{F7937D67-C44C-4305-B645-C0C4F67F8B88}.Debug|iPhone.Build.0 = Debug|Any CPU
{F7937D67-C44C-4305-B645-C0C4F67F8B88}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{F7937D67-C44C-4305-B645-C0C4F67F8B88}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{F7937D67-C44C-4305-B645-C0C4F67F8B88}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7937D67-C44C-4305-B645-C0C4F67F8B88}.Release|Any CPU.Build.0 = Release|Any CPU
{F7937D67-C44C-4305-B645-C0C4F67F8B88}.Release|iPhone.ActiveCfg = Release|Any CPU
{F7937D67-C44C-4305-B645-C0C4F67F8B88}.Release|iPhone.Build.0 = Release|Any CPU
{F7937D67-C44C-4305-B645-C0C4F67F8B88}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{F7937D67-C44C-4305-B645-C0C4F67F8B88}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
7 changes: 4 additions & 3 deletions BaseTemplate/BaseTemplate.Android/BaseTemplate.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@
<PackageReference Include="Xamarin.Forms.PancakeView">
<Version>2.3.0.759</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms.StateSquid">
<Version>1.1.3</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand Down Expand Up @@ -121,6 +118,10 @@
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\..\CoreServices\CoreServices.csproj">
<Project>{F7937D67-C44C-4305-B645-C0C4F67F8B88}</Project>
<Name>CoreServices</Name>
</ProjectReference>
<ProjectReference Include="..\BaseTemplate\BaseTemplate.csproj">
<Project>{C632F893-3A9D-419A-B680-3CF5940D6921}</Project>
<Name>BaseTemplate</Name>
Expand Down
2 changes: 1 addition & 1 deletion BaseTemplate/BaseTemplate.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
using Android.OS;
using System;
using System.Threading.Tasks;
using BaseTemplate.Constants;
using System.Diagnostics;
using CoreServices.Constants;

namespace BaseTemplate.Droid
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Android.OS;
using Android.Support.V4.App;
using BaseTemplate.Droid.Services.LocalNotificationService;
using BaseTemplate.Services.LocalNotificationService;
using CoreServices.LocalNotificationsServices;
using Xamarin.Forms;
using AndroidApp = Android.App.Application;
using TaskStackBuilder = Android.Support.V4.App.TaskStackBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.IO;
using System.Xml.Serialization;
using Android.Content;
using BaseTemplate.Services.LocalNotificationService;
using CoreServices.LocalNotificationsServices;
using Xamarin.Forms;

namespace BaseTemplate.Droid.Services.LocalNotificationService
Expand Down
5 changes: 1 addition & 4 deletions BaseTemplate/BaseTemplate.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;

using BaseTemplate.Constants;

using CoreServices.Constants;
using Foundation;

using UIKit;

namespace BaseTemplate.iOS
Expand Down
7 changes: 4 additions & 3 deletions BaseTemplate/BaseTemplate.iOS/BaseTemplate.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,13 @@
<PackageReference Include="Xamarin.Forms.PancakeView">
<Version>2.3.0.759</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms.StateSquid">
<Version>1.1.3</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\..\CoreServices\CoreServices.csproj">
<Project>{F7937D67-C44C-4305-B645-C0C4F67F8B88}</Project>
<Name>CoreServices</Name>
</ProjectReference>
<ProjectReference Include="..\BaseTemplate\BaseTemplate.csproj">
<Project>{C632F893-3A9D-419A-B680-3CF5940D6921}</Project>
<Name>BaseTemplate</Name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Diagnostics;
using BaseTemplate.iOS.Services.LocalNotificationService;
using BaseTemplate.Services.LocalNotificationService;
using CoreServices.LocalNotificationsServices;
using Foundation;
using UserNotifications;
using Xamarin.Forms;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using BaseTemplate.Services.LocalNotificationService;
using CoreServices.LocalNotificationsServices;
using UserNotifications;
using Xamarin.Forms;

Expand Down
88 changes: 44 additions & 44 deletions BaseTemplate/BaseTemplate/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
using System.Globalization;
using BaseTemplate.ViewModels;
using CoreServices.DataServices.LocalDatabaseService;
using CoreServices.FileService;
using CoreServices.TranslationService;
using System.Globalization;
using System.Threading;
using BaseTemplate.Resources;
using BaseTemplate.Services.FileSystemService;
using BaseTemplate.Services.LocalDatabaseService;
using BaseTemplate.ViewModels;
using TemplateFoundation.IOCFoundation;
using TemplateFoundation.Navigation.NavigationContainers;
using Xamarin.Forms;

namespace BaseTemplate
{
public partial class App : Application
{
public App()
{
InitializeComponent();
public partial class App : Application
{
public App()
{
InitializeComponent();

SetupDependencyInjection();
CreateDataBaseTables();
SetDefaultLanguage();
SetStartPage();
}
SetupDependencyInjection();
CreateDataBaseTables();
SetDefaultLanguage();
SetStartPage();
}

private void SetupDependencyInjection()
{
Ioc.Container.Register<ILocalDatabaseService, LocalDatabaseService>().AsSingleton();
Ioc.Container.Register<IFileSystemService, FileSystemService>().AsSingleton();
}
/// <summary>
/// Create your database tables that you need
/// </summary>
private void CreateDataBaseTables()
{
// Ioc.Container.Resolve<LocalDatabaseService>().CreateDatabaseTables(Send List of tabels);
}
/// <summary>
/// Set your default language for the entire app
/// Just change culture info ar,en,fr,es
/// </summary>
private void SetDefaultLanguage()
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
private void SetupDependencyInjection()
{
Ioc.Container.Register<ILocalDatabaseService, LocalDatabaseService>().AsSingleton();
Ioc.Container.Register<IFileSystemService, FileSystemService>().AsSingleton();
}
/// <summary>
/// Create your database tables that you need
/// </summary>
private void CreateDataBaseTables()
{
// Ioc.Container.Resolve<LocalDatabaseService>().CreateDatabaseTables(Send List of tabels);
}
/// <summary>
/// Set your default language for the entire app
/// Just change culture info ar,en,fr,es
/// </summary>
private void SetDefaultLanguage()
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");

AppResources.Culture = new CultureInfo("en");
}
AppResources.Culture = new CultureInfo("en");
}

private void SetStartPage()
{
var masterDetailNav = new MasterDetailNavigationContainer();
masterDetailNav.Init("Fawakeh");
masterDetailNav.AddPage<MainViewModel>();
MainPage = masterDetailNav;
}
}
private void SetStartPage()
{
MasterDetailNavigationContainer masterDetailNav = new MasterDetailNavigationContainer();
masterDetailNav.Init("Fawakeh");
masterDetailNav.AddPage<MainViewModel>();
MainPage = masterDetailNav;
}
}
}
11 changes: 0 additions & 11 deletions BaseTemplate/BaseTemplate/BaseTemplate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,14 @@
<ProjectReference Include="..\..\TemplateFoundation\TemplateFoundation.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Constants\" />
<Folder Include="ViewModels\" />
<Folder Include="Pages\" />
<Folder Include="Resources\" />
<Folder Include="Behaviors\" />
<Folder Include="Behaviors\Entries\" />
</ItemGroup>
<ItemGroup>
<Compile Update="Pages\MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Update="Resources\AppResources.Designer.cs">
<DependentUpon>AppResources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources\AppResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>
12 changes: 0 additions & 12 deletions BaseTemplate/BaseTemplate/Constants/AppConstants.cs

This file was deleted.

50 changes: 0 additions & 50 deletions BaseTemplate/BaseTemplate/Resources/AppResources.Designer.cs

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading