├── .gitignore
├── .vscode
├── launch.json
└── tasks.json
├── AppBase.sln
├── Application.Android.Tests
├── AndroidManifest.xml
├── App.cs
├── Application.Android.Tests.csproj
├── MainActivity.cs
└── Resources
│ ├── AboutResources.txt
│ ├── layout
│ └── activity_main.xml
│ ├── mipmap-anydpi-v26
│ ├── appicon.xml
│ └── appicon_round.xml
│ ├── mipmap-hdpi
│ ├── appicon.png
│ ├── appicon_background.png
│ └── appicon_foreground.png
│ ├── mipmap-mdpi
│ ├── appicon.png
│ ├── appicon_background.png
│ └── appicon_foreground.png
│ ├── mipmap-xhdpi
│ ├── appicon.png
│ ├── appicon_background.png
│ └── appicon_foreground.png
│ ├── mipmap-xxhdpi
│ ├── appicon.png
│ ├── appicon_background.png
│ └── appicon_foreground.png
│ ├── mipmap-xxxhdpi
│ ├── appicon.png
│ ├── appicon_background.png
│ └── appicon_foreground.png
│ └── values
│ ├── ic_launcher_background.xml
│ ├── strings.xml
│ └── themes.xml
├── Application.Android
├── Activity.cs
├── AndroidLogger.cs
├── AppCompatActivity.cs
├── Application.Android.csproj
├── Application.cs
├── Configuration
│ └── SharedPreferencesSettings.cs
├── IAndroidApplication.cs
├── IContextObject.cs
└── Threading
│ └── LooperSynchronizationContext.cs
├── Application.Avalonia.Tests
├── App.axaml
├── App.axaml.cs
├── AppIcon.ico
├── Application.Avalonia.Tests.csproj
├── IApp.cs
├── MainWindow.axaml
├── MainWindow.axaml.cs
├── TestDialog.axaml
├── TestDialog.axaml.cs
├── TestUpdatingSession.cs
└── nuget.config
├── Application.Avalonia
├── Animation
│ ├── CornerRadiusAnimator.cs
│ ├── DoubleRenderingAnimator.cs
│ ├── RenderingAnimator.cs
│ ├── SizeAnimator.cs
│ ├── SizeRenderingAnimator.cs
│ ├── ThicknessAnimator.cs
│ ├── ThicknessRenderingAnimator.cs
│ ├── ValueRenderingAnimator.cs
│ ├── VectorAnimator.cs
│ └── VectorRenderingAnimator.cs
├── Application.Avalonia.csproj
├── Application.cs
├── Controls
│ ├── ApplicationWindow.cs
│ ├── Dialog.cs
│ ├── InputDialog.cs
│ ├── ScrollViewerExtensions.cs
│ └── UserControl.cs
└── IAvaloniaApplication.cs
├── Application.Tests
├── Animation
│ └── AnimatorTests.cs
├── Application.Tests.csproj
├── ApplicationExtensionsTests.cs
├── TestApplication.cs
├── TestLogger.cs
├── TestLoggerProvider.cs
├── TestSettings.cs
└── ViewModels
│ ├── ObservablePropertyTests.cs
│ ├── TestViewModel.cs
│ └── ViewModelTests.cs
├── Application
├── Animation
│ ├── Animator.cs
│ ├── DoubleAnimator.cs
│ ├── Interpolators.cs
│ └── ValueAnimator.cs
├── Application.csproj
├── BaseApplicationObject.cs
├── BaseDisposableApplicationObject.cs
├── IApplication.cs
├── IApplicationObject.cs
├── PlatformCommands.cs
├── Threading
│ └── IThreadDependent.cs
├── ViewModels
│ ├── ObservableProperty.cs
│ └── ViewModel.cs
└── Windows
│ └── Input
│ ├── BaseCommand.cs
│ ├── Command.cs
│ ├── CommandExtensions.cs
│ └── ObservableCommandState.cs
├── AutoUpdate.Tests
├── AutoUpdate.Tests.csproj
├── BaseTests.cs
├── Installers
│ ├── BasePackageInstallerTests.cs
│ └── ZipPackageInstallerTests.cs
├── Program.cs
├── Resolvers
│ ├── BasePackageResolverTests.cs
│ ├── FilePackageResolverTests.cs
│ ├── JsonPackageResolverTests.cs
│ └── XmlPackageResolverTests.cs
├── UpdaterTests.cs
└── ViewModels
│ └── UpdatingSessionTests.cs
├── AutoUpdate
├── AutoUpdate.csproj
├── BaseUpdaterComponent.cs
├── IUpdaterComponent.cs
├── Installers
│ ├── BasePackageInstaller.cs
│ ├── IPackageInstaller.cs
│ └── ZipPackageInstaller.cs
├── Resolvers
│ ├── BasePackageResolver.cs
│ ├── FilePackageResolver.cs
│ ├── IPackageResolver.cs
│ ├── JsonPackageResolver.cs
│ └── XmlPackageResolver.cs
├── Updater.cs
└── ViewModels
│ └── UpdatingSession.cs
├── Avalonia.Tests
├── App.axaml
├── App.axaml.cs
├── Avalonia.Tests.csproj
├── Data
│ └── Converters
│ │ └── ConvertersTests.cs
├── MainWindow.axaml
└── MainWindow.axaml.cs
├── Avalonia
├── Avalonia.csproj
├── AvaloniaObjectExtensions.cs
├── CachedResource.cs
├── Collections
│ └── AvaloniaListExtensions.cs
├── Controls
│ ├── ComboBoxExtensions.cs
│ ├── ControlExtensions.cs
│ ├── DateTimeTextBox.cs
│ ├── FormattedLinkTextBlock.cs
│ ├── FormattedSelectableTextBlock.cs
│ ├── FormattedTextBlock.cs
│ ├── IPAddressTextBox.cs
│ ├── IntegerTextBox.cs
│ ├── LayoutableExtensions.cs
│ ├── LinkTextBlock.cs
│ ├── ListBoxExtensions.cs
│ ├── ObjectTextBox.cs
│ ├── Presenters
│ │ └── ProgressRingPresenter.cs
│ ├── ProgressRing.cs
│ ├── RealNumberTextBox.cs
│ ├── ResourceHostExtensions.cs
│ ├── ResourceNodeExtensions.cs
│ ├── SelectableTextBlock.cs
│ ├── SelectingItemsControlExtensions.cs
│ ├── TabControlExtensions.cs
│ ├── TextBlock.cs
│ ├── TimeSpanTextBox.cs
│ ├── UriTextBox.cs
│ ├── ValueTextBox.cs
│ ├── Window.cs
│ └── WindowExtensions.cs
├── Data
│ └── Converters
│ │ ├── BaseValueConverter.cs
│ │ ├── BooleanToValueConverter.cs
│ │ ├── BooleanToValueConverters.cs
│ │ ├── ComparableConverters.cs
│ │ ├── DoubleConverters.cs
│ │ ├── EnumConverters.cs
│ │ ├── FilePathConverters.cs
│ │ ├── NumberConverters.cs
│ │ ├── ObjectConverters.cs
│ │ └── ValueConverterExtensions.cs
├── FormattedString.cs
├── Input
│ ├── DataObjectExtensions.cs
│ ├── InputElementExtensions.cs
│ └── Platform
│ │ └── ClipboardExtensions.cs
├── Media
│ └── TextFormatting
│ │ └── TextLayoutExtensions.cs
├── Theme
│ └── Default.axaml
├── Threading
│ ├── DispatcherScheduledAction.cs
│ └── DispatcherSynchronizationContext.cs
└── VIsualTree
│ └── VisualExtensions.cs
├── BuildPackages.bat
├── BuildPackages.sh
├── Configuration.Tests
├── BaseSettingsSerializerTests.cs
├── BaseSettingsTests.cs
├── Configuration.Tests.csproj
├── JsonSettingsSerializerTests.cs
├── MemorySettingsTests.cs
├── PersistentSettingsTests.cs
├── SettingKeyTests.cs
├── TestSettings.cs
└── XmlSettingsSerializerTests.cs
├── Configuration
├── Configuration.csproj
├── ISettings.cs
├── ISettingsSerializer.cs
├── JsonSettingsSerializer.cs
├── MemorySettings.cs
├── PersistentSettings.cs
└── XmlSettingsSerializer.cs
├── Core.Tests
├── ArrayExtensionTests.cs
├── BaseShareableDisposableTests.cs
├── CachedObservableValueTests.cs
├── Collections
│ ├── FilteredObservableListTests.cs
│ ├── ListExtensionsTests.cs
│ ├── ObservableListTests.cs
│ ├── SortedObservableListTests.cs
│ ├── SortedObservableListTests.xlsx
│ └── TypeConvertedObservableListTests.cs
├── Core.Tests.csproj
├── Diagnostics
│ └── MemoryTests.cs
├── ForwardedObservableBooleanTests.cs
├── IO
│ ├── BaseStreamProviderTests.cs
│ ├── FileSizeExtensionsTests.cs
│ ├── FileStreamProviderTests.cs
│ └── MemoryStreamProviderTests.cs
├── MemoryExtensionsTest.cs
├── Net
│ ├── Http
│ │ └── HttpResponseStreamProviderTests.cs
│ └── WebRequestStreamProviderTests.cs
├── ObjectExtensionsTest.cs
├── ObservableExtensionsTest.cs
├── ObservableValueTests.cs
├── Program.cs
├── RangeTests.cs
├── SpanExtensionsTest.cs
├── StringExtensionsTests.cs
└── Threading
│ ├── ScheduledActionTests.cs
│ ├── SingleThreadSynchronizationContextTests.cs
│ ├── SynchronizationContextExtensionsTests.cs
│ └── Tasks
│ └── FixedThreadsTaskSchedulerTests.cs
├── Core
├── ArrayExtensions.cs
├── BaseAsyncDisposable.cs
├── BaseDisposable.cs
├── BaseShareableDisposable.cs
├── Buffers
│ └── PinnableExtensions.cs
├── CachedObservableValue.cs
├── Collections
│ ├── CollectionExtensions.cs
│ ├── ComparerExtensions.cs
│ ├── DictionaryExtensions.cs
│ ├── EnumerableExtensions.cs
│ ├── FilteredObservableList.cs
│ ├── LinkedListExtensions.cs
│ ├── ListExtensions.cs
│ ├── NotifyCollectionChangedExtensions.cs
│ ├── ObservableList.cs
│ ├── QueueExtensions.cs
│ ├── ReadOnlyObservableList.cs
│ ├── ReadOnlySet.cs
│ ├── ReversedList.cs
│ ├── ReversedObservableList.cs
│ ├── SetExtensions.cs
│ ├── SortedObservableList.cs
│ ├── StackExtensions.cs
│ ├── TypeCastingList.cs
│ ├── TypeCastingObservableList.cs
│ └── TypeConvertedObservableList.cs
├── ComponentModel
│ └── NotifyPropertyChangedExtensions.cs
├── Core.csproj
├── DelegateExtensions.cs
├── Diagnostics
│ └── Memory.cs
├── DisposableCollection.cs
├── DisposableExtensions.cs
├── EmptyDisposable.cs
├── EventHandler.cs
├── FixedObservableValue.cs
├── ForwardedObservableBoolean.cs
├── Global.cs
├── IO
│ ├── Directory.cs
│ ├── File.cs
│ ├── FileInfoExtensions.cs
│ ├── FileSizeExtensions.cs
│ ├── FileStreamProvider.cs
│ ├── IStreamProvider.cs
│ ├── MemoryStreamProvider.cs
│ ├── PathComparer.cs
│ ├── PathEqualityComparer.cs
│ ├── PathExtensions.cs
│ ├── StreamAccess.cs
│ ├── StreamExtensions.cs
│ └── StreamWrapper.cs
├── IShareableDisposable.cs
├── InternalStateCorruptedException.cs
├── InterruptiblePredicate.cs
├── InvertedObservableBoolean.cs
├── LinuxDesktop.cs
├── LinuxDisbribution.cs
├── MemoryExtensions.cs
├── MutableObservableValue.cs
├── Net
│ ├── Http
│ │ └── HttpResponseStreamProvider.cs
│ └── WebRequestStreamProvider.cs
├── ObjectExtensions.cs
├── ObservableExtensions.cs
├── ObservableValue.cs
├── Observer.cs
├── Platform.cs
├── PointerDelegates.cs
├── Range.cs
├── RefDelegates.cs
├── SpanExtensions.cs
├── StringExtensions.cs
├── StringPool.cs
├── Threading
│ ├── DelayedCallbacks.cs
│ ├── IDelayedCallbackStub.cs
│ ├── ISynchronizable.cs
│ ├── ScheduledAction.cs
│ ├── SingleThreadSynchronizationContext.cs
│ ├── SynchronizationContextExtensions.cs
│ └── Tasks
│ │ ├── FixedThreadsTaskFactory.cs
│ │ └── FixedThreadsTaskScheduler.cs
├── TypeConvertedObservable.cs
├── WeakObserver.cs
└── WindowsVersion.cs
├── Directory.Build.props
├── Documentation
├── .gitignore
├── Documentation.csproj
├── api
│ ├── .gitignore
│ └── index.md
├── articles
│ ├── collection_extensions.md
│ ├── disposable_extensions.md
│ ├── intro.md
│ ├── object_extensions.md
│ ├── observable_value.md
│ ├── sorted_observable_list.md
│ ├── threading.md
│ ├── toc.yml
│ └── type_converted_observable_list.md
├── docfx.json
├── images
│ ├── favicon.ico
│ ├── logo.svg
│ ├── sorted_list_pref_random_adding_16384.png
│ ├── sorted_list_pref_random_adding_4096.png
│ ├── sorted_list_pref_random_adding_8192.png
│ ├── sorted_list_pref_random_adding_non_overlapped_16384.png
│ ├── sorted_list_pref_random_adding_non_overlapped_4096.png
│ └── sorted_list_pref_random_adding_non_overlapped_8192.png
├── index.md
├── templates
│ └── material
│ │ └── public
│ │ └── main.css
└── toc.yml
├── LICENSE
├── MacOS.Tests
├── MacOS.Tests.csproj
├── ObjectiveC
│ └── ClassTests.cs
└── Program.cs
├── MacOS
├── AppKit
│ ├── NSAppearance.cs
│ ├── NSApplication.cs
│ ├── NSColor.cs
│ ├── NSColorSpace.cs
│ ├── NSControl.cs
│ ├── NSControlSize.cs
│ ├── NSControlTint.cs
│ ├── NSDockTile.cs
│ ├── NSEdgeInsets.cs
│ ├── NSImage.cs
│ ├── NSImageAlignment.cs
│ ├── NSImageScaling.cs
│ ├── NSImageView.cs
│ ├── NSLayoutAnchor.cs
│ ├── NSLayoutConstraint.cs
│ ├── NSLayoutDimension.cs
│ ├── NSLayoutXAxisAnchor.cs
│ ├── NSLayoutYAxisAnchor.cs
│ ├── NSPoint.cs
│ ├── NSProgressIndicator.cs
│ ├── NSProgressIndicatorStyle.cs
│ ├── NSRect.cs
│ ├── NSResponder.cs
│ ├── NSSize.cs
│ ├── NSView.cs
│ └── NSWindow.cs
├── CoreFoundation
│ ├── CFAllocator.cs
│ ├── CFData.cs
│ ├── CFDictionary.cs
│ ├── CFMutableData.cs
│ ├── CFNumber.cs
│ ├── CFObject.cs
│ ├── CFRange.cs
│ └── CFString.cs
├── CoreGraphics
│ ├── CGBitmapInfo.cs
│ ├── CGColorRenderingIntent.cs
│ ├── CGColorSpace.cs
│ ├── CGColorSpaceModel.cs
│ ├── CGDataProvider.cs
│ ├── CGError.cs
│ ├── CGImage.cs
│ ├── CGImageAlphaInfo.cs
│ ├── CGImageByteOrderInfo.cs
│ ├── CGImagePixelFormatInfo.cs
│ ├── CGImageProperties.cs
│ ├── CGPoint.cs
│ ├── CGRect.cs
│ ├── CGSize.cs
│ ├── Display.cs
│ └── PixelSize.cs
├── ImageIO
│ ├── CGImageSource.cs
│ └── CGImageSourceStatus.cs
├── MacOS.csproj
├── NativeLibraryHandles.cs
├── NativeLibraryNames.cs
├── NativeMethodInfo.cs
├── NativeTypeConversion.cs
└── ObjectiveC
│ ├── Class.cs
│ ├── Member.cs
│ ├── NSArray.cs
│ ├── NSEnumerator.cs
│ ├── NSObject.cs
│ ├── NSRange.cs
│ ├── NSString.cs
│ └── Selector.cs
├── README.md
├── Resources
├── Icon Attribution.htm
├── Icon.svg
├── Icon_128px.png
├── Icon_16px.png
├── Icon_24px.png
├── Icon_256px.png
├── Icon_32px.png
├── Icon_512px.png
└── Icon_64px.png
├── Tests.Tests
├── EventMonitorTests.cs
├── NotifyPropertyChangedExtensionsTests.cs
└── Tests.Tests.csproj
└── Tests
├── EventMonitor.cs
├── NotifyPropertyChangedExtensions.cs
├── Random.cs
└── Tests.csproj
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .vs
3 | .vscode
4 | AppBase.sln.DotSettings.user
5 | global.json
6 | obj
7 | bin
8 | PublishProfiles
9 | /Core/CarinaStudio.AppBase.Core.xml
10 | /Configuration/CarinaStudio.AppBase.Configuration.xml
11 | /Application/CarinaStudio.AppBase.Application.xml
12 | /Application.Android/CarinaStudio.AppBase.Application.Android.xml
13 | /Application.Avalonia/CarinaStudio.AppBase.Application.Avalonia.xml
14 | /AutoUpdate/CarinaStudio.AppBase.AutoUpdate.xml
15 | /Avalonia/CarinaStudio.AppBase.Avalonia.xml
16 | /MacOS/CarinaStudio.AppBase.MacOS.xml
17 | /Tests/CarinaStudio.AppBase.Tests.xml
18 | /Core.Tests/Collections/~$SortedListTests.xlsx
19 | /Packages
20 |
--------------------------------------------------------------------------------
/Application.Android.Tests/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Application.Android.Tests/App.cs:
--------------------------------------------------------------------------------
1 | using Android.Runtime;
2 | using CarinaStudio.Android;
3 | using System;
4 |
5 | namespace CarinaStudio.AppBase.App.Android;
6 |
7 | [global::Android.App.Application(Theme="@style/AppTheme")]
8 | public class App : CarinaStudio.Android.Application
9 | {
10 | // Constructor.
11 | public App(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
12 | { }
13 | }
--------------------------------------------------------------------------------
/Application.Android.Tests/Application.Android.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0-android
5 | 29
6 | Exe
7 | enable
8 | enable
9 | carinastudio.appbase.app.android
10 | 1
11 | 1.0
12 | CarinaStudio.AppBase.App.Android
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.xml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "Resource"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the Resource class would expose:
26 |
27 | public class Resource {
28 | public class Drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class Layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class Strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use Resource.Drawable.icon to reference the drawable/icon.png file, or
43 | Resource.Layout.main to reference the layout/main.xml file, or Resource.Strings.first_string
44 | to reference the first string in the dictionary file values/strings.xml.
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-anydpi-v26/appicon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-anydpi-v26/appicon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-hdpi/appicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-hdpi/appicon.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-hdpi/appicon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-hdpi/appicon_background.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-hdpi/appicon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-hdpi/appicon_foreground.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-mdpi/appicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-mdpi/appicon.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-mdpi/appicon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-mdpi/appicon_background.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-mdpi/appicon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-mdpi/appicon_foreground.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-xhdpi/appicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-xhdpi/appicon.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-xhdpi/appicon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-xhdpi/appicon_background.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-xhdpi/appicon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-xhdpi/appicon_foreground.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-xxhdpi/appicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-xxhdpi/appicon.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-xxhdpi/appicon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-xxhdpi/appicon_background.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-xxhdpi/appicon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-xxhdpi/appicon_foreground.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-xxxhdpi/appicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-xxxhdpi/appicon.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-xxxhdpi/appicon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-xxxhdpi/appicon_background.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/mipmap-xxxhdpi/appicon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Android.Tests/Resources/mipmap-xxxhdpi/appicon_foreground.png
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2C3E50
4 |
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Application.Android.Tests
3 | Hello, Android!
4 |
5 |
--------------------------------------------------------------------------------
/Application.Android.Tests/Resources/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Application.Android/AndroidLogger.cs:
--------------------------------------------------------------------------------
1 | using Android.Util;
2 | using Microsoft.Extensions.Logging;
3 | using System;
4 |
5 | namespace CarinaStudio.Android;
6 |
7 | ///
8 | /// Implementation of based-on android logger.
9 | ///
10 | class AndroidLogger : ILogger
11 | {
12 | // Fields.
13 | readonly string tag;
14 |
15 |
16 | // Constructor.
17 | public AndroidLogger(string tag) =>
18 | this.tag = tag;
19 |
20 |
21 | ///
22 | public IDisposable BeginScope(TState state) =>
23 | new EmptyDisposable();
24 |
25 |
26 | // Convert log level to priority.
27 | static LogPriority ConvertToLogPriority(LogLevel logLevel) => logLevel switch
28 | {
29 | LogLevel.Critical
30 | or LogLevel.Error => LogPriority.Error,
31 | LogLevel.Warning => LogPriority.Warn,
32 | LogLevel.Debug => LogPriority.Debug,
33 | LogLevel.Information => LogPriority.Info,
34 | _ => LogPriority.Verbose,
35 | };
36 |
37 |
38 | ///
39 | public bool IsEnabled(LogLevel logLevel)
40 | {
41 | if (logLevel == LogLevel.None)
42 | return false;
43 | return global::Android.Util.Log.IsLoggable(this.tag, ConvertToLogPriority(logLevel));
44 | }
45 |
46 |
47 | ///
48 | public void Log(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func formatter)
49 | {
50 | if (logLevel == LogLevel.None)
51 | return;
52 | global::Android.Util.Log.WriteLine(ConvertToLogPriority(logLevel), this.tag, formatter(state, exception));
53 | }
54 | }
55 |
56 |
57 | ///
58 | /// Implementation of .
59 | ///
60 | class AndroidLoggerProvider : ILoggerProvider
61 | {
62 | ///
63 | public ILogger CreateLogger(string categoryName) =>
64 | new AndroidLogger(categoryName);
65 |
66 |
67 | ///
68 | void IDisposable.Dispose()
69 | { }
70 | }
--------------------------------------------------------------------------------
/Application.Android/Application.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0-android;net9.0-android;net10.0-android
5 | 29
6 | CarinaStudio.Android
7 | CarinaStudio.AppBase.Application.Android
8 | ©2022 Carina Studio
9 | CarinaStudio.AppBase.Application.Android
10 | AppBase is a base library set for .NET application. CarinaStudio.AppBase.Application.Android provides basic implementation for CarinaStudio.AppBase.Application for Android.
11 | preview
12 |
13 |
14 |
15 | CarinaStudio.AppBase.Application.Android.xml
16 |
17 |
18 |
19 | CarinaStudio.AppBase.Application.Android.xml
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Application.Android/IAndroidApplication.cs:
--------------------------------------------------------------------------------
1 | namespace CarinaStudio.Android;
2 |
3 | ///
4 | /// Extended interface of for Android application.
5 | ///
6 | public interface IAndroidApplication : IApplication, IContextObject
7 | { }
--------------------------------------------------------------------------------
/Application.Android/IContextObject.cs:
--------------------------------------------------------------------------------
1 | using Android.Content;
2 |
3 | namespace CarinaStudio.Android;
4 |
5 | ///
6 | /// Interface for object which is related to a .
7 | ///
8 | public interface IContextObject
9 | {
10 | ///
11 | /// Get related .
12 | ///
13 | Context Context { get; }
14 | }
--------------------------------------------------------------------------------
/Application.Avalonia.Tests/App.axaml:
--------------------------------------------------------------------------------
1 |
5 |
6 | Test resource string
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Application.Avalonia.Tests/App.axaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls.ApplicationLifetimes;
3 | using Avalonia.Markup.Xaml;
4 | using CarinaStudio.Configuration;
5 | using Microsoft.Extensions.Logging;
6 | using System;
7 | using System.Globalization;
8 |
9 | namespace CarinaStudio
10 | {
11 | public class App : Application, IApp
12 | {
13 | // Build application.
14 | public static AppBuilder BuildAvaloniaApp()
15 | => AppBuilder.Configure()
16 | .UsePlatformDetect()
17 | .LogToTrace();
18 |
19 |
20 | // Initialize.
21 | public override void Initialize()
22 | {
23 | AvaloniaXamlLoader.Load(this);
24 | }
25 |
26 |
27 | // Program entry.
28 | public static void Main(string[] args)
29 | {
30 | //Environment.SetEnvironmentVariable("AVALONIA_GLOBAL_SCALE_FACTOR", "2");
31 | BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
32 | }
33 |
34 |
35 | // Called when Avalonia initialized.
36 | public override void OnFrameworkInitializationCompleted()
37 | {
38 | base.OnFrameworkInitializationCompleted();
39 | (this.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.Let(it =>
40 | {
41 | //it.ShutdownMode = Avalonia.Controls.ShutdownMode.OnExplicitShutdown;
42 | //if (Platform.IsMacOS)
43 | //it.ShutdownMode = Avalonia.Controls.ShutdownMode.OnExplicitShutdown;
44 | it.MainWindow = new MainWindow();
45 | });
46 | }
47 |
48 |
49 | // Implementations.
50 | public override CultureInfo CultureInfo => CultureInfo.CurrentCulture;
51 | public override IObservable GetObservableString(string key) => new FixedObservableValue(null);
52 | public override string? GetString(string key, string? defaultValue = null) => defaultValue;
53 | public override bool IsShutdownStarted => false;
54 | public override ILoggerFactory LoggerFactory { get; } = new LoggerFactory();
55 | public override ISettings PersistentState { get; } = new MemorySettings();
56 | public override ISettings Settings { get; } = new MemorySettings();
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Application.Avalonia.Tests/AppIcon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/carina-studio/AppBase/4b475d606bc45ef4a7f8627707d18fc3edfb41fb/Application.Avalonia.Tests/AppIcon.ico
--------------------------------------------------------------------------------
/Application.Avalonia.Tests/Application.Avalonia.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net8.0;net9.0
6 | enable
7 | CarinaStudio
8 | CarinaStudio.App
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Application.Avalonia.Tests/IApp.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace CarinaStudio
8 | {
9 | interface IApp : IAvaloniaApplication
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Application.Avalonia.Tests/MainWindow.axaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 | Title in resources
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Application.Avalonia.Tests/TestDialog.axaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Application.Avalonia.Tests/TestDialog.axaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Markup.Xaml;
4 | using CarinaStudio.Controls;
5 | using CarinaStudio.Threading;
6 | using System;
7 |
8 | namespace CarinaStudio
9 | {
10 | partial class TestDialog : Dialog
11 | {
12 | public TestDialog()
13 | {
14 | InitializeComponent();
15 | }
16 |
17 | private void InitializeComponent()
18 | {
19 | AvaloniaXamlLoader.Load(this);
20 | }
21 |
22 | public void GenerateResult()
23 | {
24 | //var random = new Random();
25 | //this.Close(random.Next(256));
26 | this.MoveToCenterOfScreen();
27 | }
28 |
29 | protected override void OnOpened(EventArgs e)
30 | {
31 | base.OnOpened(e);
32 | this.SynchronizationContext.Post(() => this.Get