language version degraded to 9.0

This commit is contained in:
Tsanie Lily 2022-02-25 13:38:42 +08:00
parent 9a6011c3d8
commit e012110b00
32 changed files with 1287 additions and 1262 deletions

View File

@ -3,8 +3,8 @@ using Billing.Themes;
using Xamarin.Essentials;
using Xamarin.Forms;
namespace Billing;
namespace Billing
{
public class App : Application
{
public static AppTheme CurrentTheme { get; private set; }
@ -59,3 +59,4 @@ public class App : Application
Resources = instance;
}
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace Billing;
namespace Billing
{
internal static class Helper
{
public static void Debug(string message)
@ -21,3 +21,4 @@ internal static class Helper
System.Diagnostics.Debug.Fail($"[{time}] - {category}", message);
}
}
}

View File

@ -36,7 +36,7 @@ namespace Billing.Languages
{
get
{
if (strings?.TryGetValue(key, out string val) == true)
if (strings != null && strings.TryGetValue(key, out string val))
{
return val;
}

View File

@ -1,7 +1,7 @@
using Xamarin.Forms;
namespace Billing;
namespace Billing
{
public partial class MainShell : Shell
{
public MainShell()
@ -9,3 +9,4 @@ public partial class MainShell : Shell
InitializeComponent();
}
}
}

View File

@ -1,7 +1,7 @@
using System.Xml.Linq;
namespace Billing.Models;
namespace Billing.Models
{
public class Account : BaseModel
{
public int Id { get; set; }
@ -39,3 +39,4 @@ public enum AccountCategory
DebitCard,
ElecAccount
}
}

View File

@ -5,8 +5,8 @@ using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Billing.Models;
namespace Billing.Models
{
public interface IModel
{
void OnXmlSerialize(XElement node);
@ -182,3 +182,4 @@ public abstract class BaseModel : IModel, IDisposable
}
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.Xml.Linq;
namespace Billing.Models;
namespace Billing.Models
{
public class Billing : BaseModel
{
public decimal Amount { get; set; }
@ -32,3 +32,4 @@ public class Billing : BaseModel
Write(node, nameof(CreateTime), CreateTime);
}
}
}

View File

@ -1,7 +1,7 @@
using System.Xml.Linq;
namespace Billing.Models;
namespace Billing.Models
{
public class Category : BaseModel
{
public int Id { get; set; }
@ -32,3 +32,4 @@ public class Category : BaseModel
}
}
}
}

View File

@ -1,8 +1,8 @@
using Billing.UI;
using Xamarin.Forms;
namespace Billing.Themes;
namespace Billing.Themes
{
public abstract class BaseTheme : ResourceDictionary
{
public const string CascadiaFontRegular = nameof(CascadiaFontRegular);
@ -74,3 +74,4 @@ public abstract class BaseTheme : ResourceDictionary
});
}
}
}

View File

@ -1,8 +1,7 @@
using Billing.UI;
using Xamarin.Forms;
namespace Billing.Themes;
using Xamarin.Forms;
namespace Billing.Themes
{
public class Dark : BaseTheme
{
private static Dark _instance;
@ -48,3 +47,4 @@ public class Dark : BaseTheme
});
}
}
}

View File

@ -1,8 +1,7 @@
using Billing.UI;
using Xamarin.Forms;
namespace Billing.Themes;
using Xamarin.Forms;
namespace Billing.Themes
{
public class Light : BaseTheme
{
private static Light _instance;
@ -48,3 +47,4 @@ public class Light : BaseTheme
});
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using Xamarin.Forms;
namespace Billing.UI;
namespace Billing.UI
{
public partial class BillingDate : ContentView
{
#region UI Properties
@ -287,3 +287,4 @@ public class BillingDay : BindableObject
}
}
}
}

View File

@ -1,8 +1,8 @@
using Billing.Themes;
using Xamarin.Forms;
namespace Billing.UI;
namespace Billing.UI
{
public abstract class BillingPage : ContentPage
{
public BillingPage()
@ -10,3 +10,4 @@ public abstract class BillingPage : ContentPage
SetDynamicResource(BackgroundColorProperty, BaseTheme.WindowBackgroundColor);
}
}
}

View File

@ -3,8 +3,8 @@ using System;
using System.Globalization;
using Xamarin.Forms;
namespace Billing.UI;
namespace Billing.UI
{
public class TitleDateConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
@ -38,3 +38,4 @@ public class MoneyConverter : IValueConverter
return value;
}
}
}

View File

@ -2,8 +2,8 @@
using System;
using Xamarin.Forms;
namespace Billing.UI;
namespace Billing.UI
{
public class TintImage : Image
{
public static readonly BindableProperty PrimaryColorProperty = BindableProperty.Create(nameof(PrimaryColor), typeof(Color?), typeof(TintImage));
@ -152,3 +152,4 @@ public class OptionEntryCell : OptionCell
.DynamicResource(Entry.PlaceholderColorProperty, BaseTheme.SecondaryTextColor)
.DynamicResource(VisualElement.BackgroundColorProperty, BaseTheme.OptionTintColor);
}
}

View File

@ -1,7 +1,7 @@
using Xamarin.Forms;
namespace Billing.UI;
namespace Billing.UI
{
public class ShadowEffect : RoutingEffect
{
public float Radius { get; set; }
@ -13,3 +13,4 @@ public class ShadowEffect : RoutingEffect
{
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using Xamarin.Forms;
namespace Billing.UI;
namespace Billing.UI
{
public static partial class Definition
{
public static partial string GetCascadiaRegularFontFamily();
@ -66,3 +66,4 @@ public class Tap : IDisposable
}
}
}
}

View File

@ -1,9 +1,8 @@
using Billing.UI;
using System;
using Xamarin.Forms;
namespace Billing.Views;
namespace Billing.Views
{
public partial class AccountPage : BillingPage
{
private static readonly BindableProperty BalanceProperty = BindableProperty.Create(nameof(Balance), typeof(decimal), typeof(AccountPage));
@ -42,3 +41,4 @@ public partial class AccountPage : BillingPage
Helper.Debug(e.Account.ToString());
}
}
}

View File

@ -3,8 +3,8 @@ using Billing.UI;
using System;
using Xamarin.Forms;
namespace Billing.Views;
namespace Billing.Views
{
public partial class AddAccountPage : BillingPage
{
private static readonly BindableProperty AccountNameProperty = BindableProperty.Create(nameof(AccountName), typeof(string), typeof(AddAccountPage));
@ -84,3 +84,4 @@ public class AccountEventArgs : EventArgs
{
public Account Account { get; set; }
}
}

View File

@ -1,7 +1,7 @@
using Billing.UI;
namespace Billing.Views;
namespace Billing.Views
{
public partial class AddBillPage : BillingPage
{
public AddBillPage()
@ -9,3 +9,4 @@ public partial class AddBillPage : BillingPage
InitializeComponent();
}
}
}

View File

@ -2,8 +2,8 @@ using Billing.UI;
using System;
using Xamarin.Forms;
namespace Billing.Views;
namespace Billing.Views
{
public partial class BillPage : BillingPage
{
private static readonly BindableProperty SelectedDateProperty = BindableProperty.Create(nameof(SelectedDate), typeof(DateTime), typeof(BillPage));
@ -42,3 +42,4 @@ public partial class BillPage : BillingPage
await Navigation.PushAsync(new AddBillPage());
}
}
}

View File

@ -1,7 +1,7 @@
using Billing.UI;
namespace Billing.Views;
namespace Billing.Views
{
public partial class SettingPage : BillingPage
{
public SettingPage()
@ -9,3 +9,4 @@ public partial class SettingPage : BillingPage
InitializeComponent();
}
}
}

View File

@ -16,14 +16,13 @@
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v12.0</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<LangVersion>10.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -65,8 +64,8 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2337" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.1" />
</ItemGroup>
<ItemGroup>
<Compile Include="Definition.cs" />

View File

@ -1,8 +1,8 @@
using Foundation;
using UIKit;
namespace Billing.iOS;
namespace Billing.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
@ -24,3 +24,4 @@ public partial class AppDelegate : Xamarin.Forms.Platform.iOS.FormsApplicationDe
return base.FinishedLaunching(app, options);
}
}
}

View File

@ -15,7 +15,7 @@
<MtouchEnableSGenConc>true</MtouchEnableSGenConc>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<ProvisioningType>automatic</ProvisioningType>
<LangVersion>10.0</LangVersion>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
@ -138,8 +138,8 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2337" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.1" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\bars.png" />

View File

@ -1,5 +1,5 @@
namespace Billing.UI;
namespace Billing.UI
{
public static partial class Definition
{
public static partial string GetCascadiaRegularFontFamily() => "CascadiaCode-Regular";
@ -7,3 +7,4 @@ public static partial class Definition
public static partial string GetRobotoCondensedRegularFontFamily() => "RobotoCondensed-Regular";
public static partial string GetRobotoCondensedBoldFontFamily() => "RobotoCondensed-Bold";
}
}

View File

@ -7,8 +7,8 @@ using Xamarin.Forms.Platform.iOS;
[assembly: ResolutionGroupName("Org.Tsanie")]
[assembly: ExportEffect(typeof(ShadowEffectPlatform), nameof(ShadowEffect))]
namespace Billing.iOS.Effects;
namespace Billing.iOS.Effects
{
public class ShadowEffectPlatform : PlatformEffect
{
protected override void OnAttached()
@ -41,3 +41,4 @@ public class ShadowEffectPlatform : PlatformEffect
}
}
}
}

View File

@ -1,7 +1,7 @@
using UIKit;
namespace Billing.iOS;
namespace Billing.iOS
{
public class Application
{
// This is the main entry point of the application.
@ -12,3 +12,4 @@ public class Application
UIApplication.Main(args, null, typeof(AppDelegate));
}
}
}

View File

@ -4,8 +4,8 @@ using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Threading;
namespace Billing.Languages;
namespace Billing.Languages
{
public partial class PlatformCulture
{
public partial string GetNamespace()
@ -73,3 +73,4 @@ public partial class PlatformCulture
return netLanguage;
}
}
}

View File

@ -5,8 +5,8 @@ using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(LongPressButton), typeof(LongPressButtonRenderer))]
namespace Billing.iOS.Renderers;
namespace Billing.iOS.Renderers
{
public class LongPressButtonRenderer : ButtonRenderer
{
private UILongPressGestureRecognizer longGesture;
@ -41,3 +41,4 @@ public class LongPressButtonRenderer : ButtonRenderer
}
}
}
}

View File

@ -5,8 +5,8 @@ using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(OptionEntry), typeof(OptionEntryRenderer))]
namespace Billing.iOS.Renderers;
namespace Billing.iOS.Renderers
{
public class OptionEntryRenderer : EntryRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
@ -20,3 +20,4 @@ public class OptionEntryRenderer : EntryRenderer
}
}
}
}

View File

@ -5,8 +5,8 @@ using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(TintImage), typeof(TintImageRenderer))]
namespace Billing.iOS.Renderers;
namespace Billing.iOS.Renderers
{
public class TintImageRenderer : ImageRenderer
{
@ -29,3 +29,4 @@ public class TintImageRenderer : ImageRenderer
}
}
}
}