├── Assets └── 1.png ├── src ├── MatoProductivity.Core │ ├── mato.db │ ├── mato.db-shm │ ├── mato.db-wal │ ├── Location │ │ ├── Road.cs │ │ ├── Poi.cs │ │ ├── ILocationResolveProvider.cs │ │ ├── LocationResolveException.cs │ │ ├── GecodeLocation.cs │ │ ├── IPGecodeLocation.cs │ │ ├── Position.cs │ │ └── ReGeocodeLocation.cs │ ├── Models │ │ ├── UserInfo.cs │ │ └── Entities │ │ │ ├── INoteSegmentPayload.cs │ │ │ ├── INoteSegment.cs │ │ │ ├── Setting.cs │ │ │ ├── NoteGroup.cs │ │ │ ├── NoteSegmentStore.cs │ │ │ ├── Note.cs │ │ │ └── NoteTemplate.cs │ ├── Location.Amap │ │ ├── AmapHttpConsts.cs │ │ ├── AmapInverseLocationResponse.cs │ │ ├── AmapPositiveHttpResponse.cs │ │ ├── AmapHttpResponse.cs │ │ ├── AmapLocationResolveProvider.cs │ │ └── AmapPositiveHttpRequestParamter.cs │ ├── appsettings.json │ ├── MatoProductivityConsts.cs │ ├── Weather │ │ └── QWeatherConsts.cs │ ├── LocalNotification │ │ ├── NotificationEventArgs.cs │ │ └── INotificationManager.cs │ ├── log4net.Production.config │ ├── log4net.config │ ├── Theme │ │ └── Theme.cs │ ├── Localization │ │ └── MatoProductivityLocalization.cs │ ├── Settings │ │ └── CommonSettingNames.cs │ └── Configuration │ │ └── AppConfigurations.cs ├── MatoProductivity │ ├── wwwroot │ │ ├── favicon.ico │ │ ├── css │ │ │ ├── fonts │ │ │ │ ├── SegoeUI.woff │ │ │ │ ├── SegoeUIBold.woff │ │ │ │ ├── SegoeUILight.woff │ │ │ │ ├── SegoeUISemibold.woff │ │ │ │ └── SegoeUISemilight.woff │ │ │ └── open-iconic │ │ │ │ ├── font │ │ │ │ └── fonts │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ └── open-iconic.woff │ │ │ │ └── ICON-LICENSE │ │ ├── index.html │ │ └── amap_index.html │ ├── Resources │ │ ├── Images │ │ │ ├── cn.png │ │ │ ├── cd2.png │ │ │ ├── logo.png │ │ │ ├── app_action.png │ │ │ ├── headphone.png │ │ │ ├── microphone2.png │ │ │ ├── easter_egg_bg.JPG │ │ │ ├── easter_egg_photo.JPG │ │ │ ├── albumart_placeholder.png │ │ │ ├── more.svg │ │ │ ├── tab_user.svg │ │ │ ├── tab_statistics.svg │ │ │ ├── tab_note_template.svg │ │ │ └── tab_note.svg │ │ ├── Fonts │ │ │ ├── FontAwesome.ttf │ │ │ ├── Mulish-Bold.ttf │ │ │ ├── Mulish-Black.ttf │ │ │ ├── Mulish-Light.ttf │ │ │ ├── Mulish-Medium.ttf │ │ │ ├── Mulish-ExtraBold.ttf │ │ │ ├── Mulish-Regular.ttf │ │ │ ├── Mulish-SemiBold.ttf │ │ │ ├── OpenSans-Regular.ttf │ │ │ ├── fa-regular-400.ttf │ │ │ ├── FontAwesome-Solid.ttf │ │ │ ├── Mulish-ExtraLight.ttf │ │ │ ├── OpenSans-Semibold.ttf │ │ │ └── FontAwesome-Regular.ttf │ │ ├── AppIcon │ │ │ └── appicon.svg │ │ └── Raw │ │ │ └── AboutAssets.txt │ ├── Platforms │ │ ├── Windows │ │ │ ├── Assets │ │ │ │ ├── StoreLogo.png │ │ │ │ ├── SplashScreen.png │ │ │ │ ├── SplashScreen.scale-200.png │ │ │ │ ├── LockScreenLogo.scale-200.png │ │ │ │ ├── Square150x150Logo.scale-200.png │ │ │ │ ├── Square44x44Logo.scale-200.png │ │ │ │ ├── Wide310x150Logo.scale-200.png │ │ │ │ └── Square44x44Logo.targetsize-24_altform-unplated.png │ │ │ ├── App.xaml │ │ │ ├── app.manifest │ │ │ ├── App.xaml.cs │ │ │ └── Package.appxmanifest │ │ ├── Android │ │ │ ├── Resources │ │ │ │ └── values │ │ │ │ │ └── colors.xml │ │ │ ├── HtmlParser.Android.cs │ │ │ ├── AlarmHandler.cs │ │ │ ├── MainApplication.cs │ │ │ ├── AndroidManifest.xml │ │ │ └── MainActivity.cs │ │ ├── iOS │ │ │ ├── AppDelegate.cs │ │ │ ├── Program.cs │ │ │ └── WeChat.cs │ │ └── MacCatalyst │ │ │ ├── AppDelegate.cs │ │ │ ├── Program.cs │ │ │ └── Info.plist │ ├── Properties │ │ └── launchSettings.json │ ├── Common │ │ ├── DayStateEnum.cs │ │ ├── WeekModel.cs │ │ ├── CommonFunctionEventArgs.cs │ │ ├── DayModel.cs │ │ └── PopupSize.cs │ ├── ViewModels │ │ ├── IPopupViewModelBase.cs │ │ ├── ISearchViewModel.cs │ │ ├── IPopupContainerViewModelBase.cs │ │ ├── IDraggableViewModel.cs │ │ ├── NoteTimeLineGroup.cs │ │ ├── NoteSegmentStoreGroup.cs │ │ ├── KeyValueStatisticGroup.cs │ │ ├── FinishedChooiseEvenArgs.cs │ │ ├── AboutMePageViewModel.cs │ │ └── PopupViewModelBase.cs │ ├── WeChat │ │ ├── WXScene.cs │ │ └── IWeChat.cs │ ├── Core.Services │ │ ├── IAutoSet.cs │ │ ├── DrawingLineSize.cs │ │ ├── IReadOnlyNoteSegmentServiceContainer.cs │ │ ├── IHasTimer.cs │ │ ├── INoteSegmentServiceFactory.cs │ │ ├── INoteSegmentServiceContainer.cs │ │ ├── IDraggableItem.cs │ │ ├── AutoSetChangedEventArgs.cs │ │ ├── NotificationJobArgs.cs │ │ ├── INoteSegmentService.cs │ │ ├── NoteSegmentPayloadFactory.cs │ │ └── NotificationJob.cs │ ├── Styles │ │ ├── CommonResourceDictionary.xaml.cs │ │ ├── Fonts.xaml.cs │ │ ├── Theme.xaml.cs │ │ ├── Colors.xaml.cs │ │ └── Fonts.xaml │ ├── Core.Views │ │ ├── TextSegmentView.xaml.cs │ │ ├── TimerSegmentView.xaml.cs │ │ ├── ContactSegmentView.xaml.cs │ │ ├── DateTimeSegmentView.xaml.cs │ │ ├── WeatherSegmentView.xaml.cs │ │ ├── KeyValueSegmentView.xaml.cs │ │ ├── LocationSegmentView.xaml.cs │ │ ├── MediaSegmentView.xaml.cs │ │ ├── VoiceSegmentView.xaml.cs │ │ ├── DocumentSegmentView.xaml.cs │ │ ├── TodoSegmentView.xaml.cs │ │ ├── WeatherSegmentView.xaml │ │ ├── NoteSegmentDataTemplateSelector.cs │ │ └── ScriptSegmentView.xaml.cs │ ├── _Imports.razor │ ├── Core.TemplateService │ │ └── INoteSegmentTemplateServiceFactory.cs │ ├── Services │ │ ├── IDateService.cs │ │ └── DateService.cs │ ├── Controls │ │ ├── StyleType.cs │ │ ├── SelectionArgs.cs │ │ ├── StyleArgs.cs │ │ ├── RecordingMotionView.xaml │ │ └── IsDoneToggleButton.xaml.cs │ ├── MatoProductivityBuilderExtensions.cs │ ├── Models │ │ └── NotificationEto.cs │ ├── Views │ │ ├── ThirdPartyLicensesPage.xaml.cs │ │ ├── PrivacyPolicyPopupPage.xaml.cs │ │ ├── AboutMePage.xaml.cs │ │ ├── PrivacyPolicyPage.xaml.cs │ │ ├── IconSelectingPage.xaml.cs │ │ ├── NotePage.xaml.cs │ │ ├── UserProfilePage.xaml.cs │ │ ├── AppActionSettingPage.xaml.cs │ │ ├── NoteSegmentStoreListPage.xaml.cs │ │ ├── E.xaml.cs │ │ ├── StatisticPage.xaml.cs │ │ ├── NoteTemplateListPage.xaml.cs │ │ ├── E.xaml │ │ ├── MainPage.xaml │ │ ├── NoteListPage.xaml.cs │ │ ├── LocationSelectingPage.xaml.cs │ │ ├── MainPage.xaml.cs │ │ ├── EditNotePage.xaml.cs │ │ ├── PrivacyPolicyPage.xaml │ │ ├── LoginPage.xaml.cs │ │ ├── EditNoteTemplatePage.xaml.cs │ │ ├── ThirdPartyLicensesPage.xaml │ │ ├── FirstLaunchPage.xaml.cs │ │ └── PrivacyPolicyPopupPage.xaml │ ├── Converter │ │ ├── True2FalseConverter.cs │ │ ├── IntegerDigitVisibleConverter.cs │ │ ├── DecimalDigitVisibleConverter.cs │ │ ├── AlbumArtConverter.cs │ │ ├── SliderMaxValueConverter.cs │ │ ├── TimeSpanRangeStringConverter.cs │ │ ├── SecondsToTimeSpanConverter.cs │ │ ├── DateTimeToStringConverter.cs │ │ ├── TimeSpanToFriendlyStringConverter.cs │ │ ├── DateTimeToFormatTimeStringConverter.cs │ │ ├── Bool2StringConverter.cs │ │ ├── IsValid2BoolConverter.cs │ │ ├── AnyTrueMultiConverter.cs │ │ └── AllTrueMultiConverter.cs │ ├── Extensions │ │ └── TranslateExtension.cs │ ├── App.xaml │ └── Helper │ │ └── GeoLocationHelper.cs ├── libs │ ├── Plugin.Maui.Audio │ │ ├── EmptyAudioSource.cs │ │ ├── IAudioSource.cs │ │ ├── AudioPlayer │ │ │ ├── AudioPlayer.shared.cs │ │ │ ├── AudioPlayer.net.cs │ │ │ └── AsyncAudioPlayer.shared.cs │ │ ├── AudioRecorder │ │ │ ├── AudioRecorder.net.cs │ │ │ └── IAudioRecorder.shared.cs │ │ ├── FileAudioSource.cs │ │ ├── StreamMediaDataSource.android.cs │ │ ├── TaskExtensions.cs │ │ ├── FailedToLoadAudioException.shared.cs │ │ └── AudioManager.shared.cs │ ├── AipSdk │ │ ├── AipSdk.csproj │ │ └── Baidu │ │ │ └── Aip │ │ │ ├── ContentCensor │ │ │ ├── Base.cs │ │ │ └── AntiTerror.cs │ │ │ ├── AipException.cs │ │ │ └── Speech │ │ │ └── Base.cs │ └── QWeatherAPI │ │ ├── QWeatherAPI.csproj │ │ ├── Tools │ │ ├── Units.cs │ │ └── Net │ │ │ └── Http │ │ │ └── WebRequests.cs │ │ ├── Result │ │ ├── Share │ │ │ └── WindScale.cs │ │ ├── GeoAPI │ │ │ └── CityLookup │ │ │ │ └── GeoResult.cs │ │ ├── WeatherWarning │ │ │ └── WarningResult.cs │ │ ├── WeatherDailyForecast │ │ │ └── WeatherResult.cs │ │ ├── RealTimeWeather │ │ │ └── WeatherResult.cs │ │ └── WeatherHourlyForecast │ │ │ └── WeatherResult.cs │ │ └── WeatherWarningAPI.cs ├── MatoProductivity.Infrastructure │ ├── Helper │ │ ├── TokenHelper.cs │ │ └── StreamHelper.cs │ ├── Common │ │ ├── IBasicInfo.cs │ │ └── IClueObject.cs │ ├── MatoProductivity.Infrastructure.csproj │ └── InfoResult.cs └── MatoProductivity.EntityFrameworkCore │ ├── EntityFrameworkCore │ ├── DbContextOptionsConfigurer.cs │ ├── MatoProductivityDbContext.cs │ ├── MatoProductivityDbContextFactory.cs │ └── MatoProductivityEntityFrameworkCoreModule.cs │ ├── Seed │ └── SeedHelper.cs │ ├── Helper │ └── WithDbContextHelper.cs │ └── Migrations │ ├── 20240124142247_v0.1.4.cs │ ├── 20240101114512_v0.1.3.cs │ └── 20230506024959_v0.1.2.cs ├── .editorconfig └── README.md /Assets/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/Assets/1.png -------------------------------------------------------------------------------- /src/MatoProductivity.Core/mato.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity.Core/mato.db -------------------------------------------------------------------------------- /src/MatoProductivity.Core/mato.db-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity.Core/mato.db-shm -------------------------------------------------------------------------------- /src/MatoProductivity.Core/mato.db-wal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity.Core/mato.db-wal -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/cn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Images/cn.png -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/cd2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Images/cd2.png -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Images/logo.png -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/Mulish-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/Mulish-Bold.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/app_action.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Images/app_action.png -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/headphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Images/headphone.png -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/css/fonts/SegoeUI.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/wwwroot/css/fonts/SegoeUI.woff -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/Mulish-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/Mulish-Black.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/Mulish-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/Mulish-Light.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/Mulish-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/Mulish-Medium.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/microphone2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Images/microphone2.png -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/Mulish-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/Mulish-ExtraBold.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/Mulish-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/Mulish-Regular.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/Mulish-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/Mulish-SemiBold.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/easter_egg_bg.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Images/easter_egg_bg.JPG -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/css/fonts/SegoeUIBold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/wwwroot/css/fonts/SegoeUIBold.woff -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/css/fonts/SegoeUILight.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/wwwroot/css/fonts/SegoeUILight.woff -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Windows/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Platforms/Windows/Assets/StoreLogo.png -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/FontAwesome-Solid.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/FontAwesome-Solid.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/Mulish-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/Mulish-ExtraLight.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/OpenSans-Semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/OpenSans-Semibold.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/easter_egg_photo.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Images/easter_egg_photo.JPG -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/css/fonts/SegoeUISemibold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/wwwroot/css/fonts/SegoeUISemibold.woff -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Windows/Assets/SplashScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Platforms/Windows/Assets/SplashScreen.png -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Fonts/FontAwesome-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Fonts/FontAwesome-Regular.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/albumart_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Resources/Images/albumart_placeholder.png -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/css/fonts/SegoeUISemilight.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/wwwroot/css/fonts/SegoeUISemilight.woff -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location/Road.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Location 2 | { 3 | public class Road 4 | { 5 | public string Name { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/libs/Plugin.Maui.Audio/EmptyAudioSource.cs: -------------------------------------------------------------------------------- 1 | namespace Plugin.Maui.Audio; 2 | 3 | public class EmptyAudioSource : IAudioSource 4 | { 5 | public Stream GetAudioStream() => Stream.Null; 6 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Windows Machine": { 4 | "commandName": "MsixPackage", 5 | "nativeDebugging": false 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Windows/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Platforms/Windows/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Windows/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Platforms/Windows/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /src/MatoProductivity/Common/DayStateEnum.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Models 2 | { 3 | public enum DayStateEnum 4 | { 5 | Active, 6 | Normal, 7 | Past, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Windows/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Platforms/Windows/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Windows/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Platforms/Windows/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Windows/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Platforms/Windows/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /src/MatoProductivity/ViewModels/IPopupViewModelBase.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace MatoProductivity.ViewModels 3 | { 4 | public interface IPopupViewModelBase 5 | { 6 | Size PopupSize { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /src/MatoProductivity/WeChat/WXScene.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.WeChat 2 | { 3 | public enum WXScene 4 | { 5 | Timeline, 6 | Favorite, 7 | SceneSession 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Models/UserInfo.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Models 2 | { 3 | public class UserInfo 4 | { 5 | public string Name { get; set; } 6 | public string Nickname { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /src/MatoProductivity.Infrastructure/Helper/TokenHelper.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Infrastructure.Helper 2 | { 3 | public class TokenHelper 4 | { 5 | internal static readonly string WindowToken = "WINDOW"; 6 | } 7 | } -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location.Amap/AmapHttpConsts.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Amap 2 | { 3 | public class AmapHttpConsts 4 | { 5 | public const string HttpClientName = "AmapLocationHttpClient"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/MatoProductivity.Infrastructure/Common/IBasicInfo.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Infrastructure.Common 2 | { 3 | public interface IBasicInfo 4 | { 5 | long Id { get; set; } 6 | string Title { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Windows/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jevonsflash/MatoProductivity/HEAD/src/MatoProductivity/Platforms/Windows/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /src/MatoProductivity/ViewModels/ISearchViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.ViewModels 2 | { 3 | public interface ISearchViewModel 4 | { 5 | Command Search { get; set; } 6 | string SearchKeywords { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Services/IAutoSet.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Services 2 | { 3 | public interface IAutoSet 4 | { 5 | bool IsAutoSet { get; } 6 | event EventHandler OnAutoSetChanged; 7 | 8 | } 9 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Services/DrawingLineSize.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Services; 2 | 3 | public class DrawingLineSize 4 | { 5 | public string Name { get; set; } 6 | public double FontSize { get; set; } 7 | public float Value { get; set; } 8 | } 9 | -------------------------------------------------------------------------------- /src/MatoProductivity/Styles/CommonResourceDictionary.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Styles; 2 | 3 | public partial class CommonResourceDictionary : ResourceDictionary 4 | { 5 | public CommonResourceDictionary() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Android/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #512BD4 4 | #2B0B98 5 | #2B0B98 6 | -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/AppIcon/appicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/libs/AipSdk/AipSdk.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.1 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CS4014: 由于此调用不会等待,因此在调用完成前将继续执行当前方法 4 | dotnet_diagnostic.CS4014.severity = error 5 | 6 | # CS0108: 成员隐藏继承的成员;缺少关键字 new 7 | dotnet_diagnostic.CS0108.severity = error 8 | 9 | # CS0114: 成员隐藏继承的成员;缺少关键字 override 10 | dotnet_diagnostic.CS0114.severity = error 11 | -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/TextSegmentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | 3 | 4 | namespace MatoProductivity.Core.Views; 5 | 6 | public partial class TextSegmentView : ContentView, ITransientDependency 7 | { 8 | public TextSegmentView() 9 | { 10 | InitializeComponent(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/TimerSegmentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | 3 | namespace MatoProductivity.Core.Views; 4 | 5 | public partial class TimerSegmentView : ContentView, ITransientDependency 6 | { 7 | public TimerSegmentView() 8 | { 9 | InitializeComponent(); 10 | } 11 | } -------------------------------------------------------------------------------- /src/MatoProductivity/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Components.Forms 3 | @using Microsoft.AspNetCore.Components.Routing 4 | @using Microsoft.AspNetCore.Components.Web 5 | @using Microsoft.AspNetCore.Components.Web.Virtualization 6 | @using Microsoft.JSInterop 7 | 8 | -------------------------------------------------------------------------------- /src/libs/QWeatherAPI/QWeatherAPI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.1 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/ContactSegmentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | 3 | 4 | namespace MatoProductivity.Core.Views; 5 | 6 | public partial class ContactSegmentView : ContentView, ITransientDependency 7 | { 8 | public ContactSegmentView() 9 | { 10 | InitializeComponent(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/DateTimeSegmentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | 3 | namespace MatoProductivity.Core.Views; 4 | 5 | public partial class DateTimeSegmentView : ContentView, ITransientDependency 6 | { 7 | public DateTimeSegmentView() 8 | { 9 | InitializeComponent(); 10 | } 11 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/WeatherSegmentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | 3 | 4 | namespace MatoProductivity.Core.Views; 5 | 6 | public partial class WeatherSegmentView : ContentView, ITransientDependency 7 | { 8 | public WeatherSegmentView() 9 | { 10 | InitializeComponent(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/KeyValueSegmentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | 3 | 4 | namespace MatoProductivity.Core.Views; 5 | 6 | public partial class KeyValueSegmentView : ContentView, ITransientDependency 7 | { 8 | public KeyValueSegmentView() 9 | { 10 | InitializeComponent(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/LocationSegmentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | 3 | 4 | namespace MatoProductivity.Core.Views; 5 | 6 | public partial class LocationSegmentView : ContentView, ITransientDependency 7 | { 8 | public LocationSegmentView() 9 | { 10 | InitializeComponent(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/MatoProductivity/ViewModels/IPopupContainerViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using CommunityToolkit.Maui.Views; 2 | 3 | namespace MatoProductivity.ViewModels 4 | { 5 | public interface IPopupContainerViewModelBase 6 | { 7 | bool PopupLoading { get; set; } 8 | 9 | Task CloseAllPopup(); 10 | } 11 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Styles/Fonts.xaml.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace MatoProductivity.Styles 3 | { 4 | [XamlCompilation(XamlCompilationOptions.Compile)] 5 | public partial class Fonts : ResourceDictionary 6 | { 7 | public Fonts() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Styles/Theme.xaml.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace MatoProductivity.Styles 3 | { 4 | [XamlCompilation(XamlCompilationOptions.Compile)] 5 | public partial class Theme : ResourceDictionary 6 | { 7 | public Theme() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Styles/Colors.xaml.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace MatoProductivity.Styles 3 | { 4 | [XamlCompilation(XamlCompilationOptions.Compile)] 5 | public partial class Colors : ResourceDictionary 6 | { 7 | public Colors() 8 | { 9 | InitializeComponent(); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/MatoProductivity.Core/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "Default": "Data Source=file:{0};" 4 | }, 5 | "Logging": { 6 | "IncludeScopes": false, 7 | "LogLevel": { 8 | "Default": "Debug", 9 | "System": "Information", 10 | "Microsoft": "Information" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/MediaSegmentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Services; 3 | 4 | namespace MatoProductivity.Core.Views; 5 | 6 | public partial class MediaSegmentView : ContentView, ITransientDependency 7 | { 8 | public MediaSegmentView() 9 | { 10 | InitializeComponent(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/VoiceSegmentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Services; 3 | 4 | namespace MatoProductivity.Core.Views; 5 | 6 | public partial class VoiceSegmentView : ContentView, ITransientDependency 7 | { 8 | public VoiceSegmentView() 9 | { 10 | InitializeComponent(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Services/IReadOnlyNoteSegmentServiceContainer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace MatoProductivity.Core.Services 4 | { 5 | public interface IReadOnlyNoteSegmentServiceContainer 6 | { 7 | ObservableCollection NoteSegments { get; set; } 8 | 9 | } 10 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/DocumentSegmentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Services; 3 | 4 | namespace MatoProductivity.Core.Views; 5 | 6 | public partial class DocumentSegmentView : ContentView, ITransientDependency 7 | { 8 | public DocumentSegmentView() 9 | { 10 | InitializeComponent(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/libs/QWeatherAPI/Tools/Units.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 QWeatherAPI.Tools 8 | { 9 | #region 单位枚举 10 | public enum Units 11 | { 12 | Metric, 13 | Inch 14 | } 15 | #endregion 16 | } 17 | -------------------------------------------------------------------------------- /src/MatoProductivity/ViewModels/IDraggableViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.ViewModels 2 | { 3 | public interface IDraggableViewModel 4 | { 5 | Command ItemDragged { get; set; } 6 | Command ItemDraggedOver { get; set; } 7 | Command ItemDragLeave { get; set; } 8 | Command ItemDropped { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /src/MatoProductivity/WeChat/IWeChat.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | 3 | namespace MatoProductivity.Core.WeChat 4 | { 5 | public interface IWeChat : ISingletonDependency 6 | { 7 | string Register(string appid = ""); 8 | void ShareImageTo(byte[] image, WXScene scene); 9 | void ShareTextTo(string text, WXScene scene); 10 | } 11 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Services/IHasTimer.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Services 2 | { 3 | public interface IHasTimer 4 | { 5 | DateTime ExactTime { get; } 6 | bool IsShowFromNow { get; set; } 7 | DateTime Time { get; set; } 8 | TimeSpan TimeFromNow { get; } 9 | TimeSpan TimeOffset { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Services/INoteSegmentServiceFactory.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Models.Entities; 3 | 4 | namespace MatoProductivity.Core.Services 5 | { 6 | public interface INoteSegmentServiceFactory: ISingletonDependency 7 | { 8 | INoteSegmentService GetNoteSegmentService(NoteSegment noteSegment); 9 | } 10 | } -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location/Poi.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Location 2 | { 3 | public class Poi 4 | { 5 | public string Tag { get; set; } 6 | public string Name { get; set; } 7 | public string Type { get; set; } 8 | public string Address { get; set; } 9 | public int? Distance { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/MatoProductivityConsts.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core 2 | { 3 | public class MatoProductivityConsts 4 | { 5 | public const string LocalizationSourceName = "MatoProductivity"; 6 | 7 | public const string ConnectionStringName = "Default"; 8 | 9 | public const bool MultiTenancyEnabled = false; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using Foundation; 2 | using Microsoft.Maui; 3 | using Microsoft.Maui.Hosting; 4 | 5 | namespace MatoProductivity 6 | { 7 | [Register("AppDelegate")] 8 | public class AppDelegate : MauiUIApplicationDelegate 9 | { 10 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Weather/QWeatherConsts.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 MatoProductivity.Core.Weather 8 | { 9 | public class QWeatherConsts 10 | { 11 | public const string Key= "c506e27d063345d4800889da480323b4"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/MatoProductivity/Common/WeekModel.cs: -------------------------------------------------------------------------------- 1 | using MatoProductivity.Infrastructure; 2 | using System; 3 | 4 | namespace MatoProductivity.Models 5 | { 6 | public class WeekModel : ObservableObject 7 | { 8 | public DateTime LastDay { get; set; } 9 | public DateTime StartDay { get; set; } 10 | public string WeekString { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Windows/App.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/MacCatalyst/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using Foundation; 2 | using Microsoft.Maui; 3 | using Microsoft.Maui.Hosting; 4 | 5 | namespace MatoProductivity.Platforms.MacCatalyst 6 | { 7 | [Register("AppDelegate")] 8 | public class AppDelegate : MauiUIApplicationDelegate 9 | { 10 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.TemplateService/INoteSegmentTemplateServiceFactory.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Models.Entities; 3 | 4 | namespace MatoProductivity.Core.Services 5 | { 6 | public interface INoteSegmentTemplateServiceFactory: ISingletonDependency 7 | { 8 | INoteSegmentService GetNoteSegmentService(NoteSegmentTemplate noteSegmentTemplate); 9 | } 10 | } -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location/ILocationResolveProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace MatoProductivity.Core.Location 4 | { 5 | public interface ILocationResolveProvider 6 | { 7 | 8 | Task GeocodeAsync(string address, string city = null); 9 | 10 | Task ReGeocodeAsync(double lat, double lng, int radius = 50); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MatoProductivity 2 | 3 | ![](./Assets/1.png) 4 | 5 | 完全开源的记事App - 凡事摘要,已上架腾讯应用商店。 6 | 7 | [【凡事摘要官方下载-凡事摘要 app 最新版本免费下载-应用宝官网】](https://sj.qq.com/appdetail/com.mato.matoproductivity) 8 | 9 | 欢迎提交PR 10 | 11 | 12 | ## 技术博客 13 | 系列文章将带你了解核心功能和代码: 14 | 15 | * [[MAUI 项目实战] 笔记App:程序设计](https://blog.csdn.net/jevonsflash/article/details/140523571) 16 | * [MAUI 项目实战] 笔记App:数据库设计 17 | * [MAUI 项目实战] 笔记App:界面与交互 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Services/INoteSegmentServiceContainer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace MatoProductivity.Core.Services 4 | { 5 | public interface INoteSegmentServiceContainer : IReadOnlyNoteSegmentServiceContainer 6 | { 7 | Command CreateSegment { get; set; } 8 | NoteSegmentState NoteSegmentState { get; set; } 9 | Command RemoveSegment { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Services/IDateService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Abp.Dependency; 4 | using MatoProductivity.Models; 5 | 6 | namespace MatoProductivity.Services 7 | { 8 | public interface IDateService : ISingletonDependency 9 | { 10 | WeekModel GetWeek(DateTime date); 11 | 12 | List GetDayList(DateTime firstDayInWeek, DateTime lastDayInWeek); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/MatoProductivity.Infrastructure/Common/IClueObject.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 MatoProductivity.Infrastructure.Common 8 | { 9 | public interface IClueObject 10 | { 11 | /// 12 | /// 线索字符串表 13 | /// 14 | List ClueStrings { get; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/libs/Plugin.Maui.Audio/IAudioSource.cs: -------------------------------------------------------------------------------- 1 | namespace Plugin.Maui.Audio; 2 | 3 | /// 4 | /// Definition of a source of audio. 5 | /// 6 | public interface IAudioSource 7 | { 8 | /// 9 | /// Provides a to allow for the playback of the audio contents. 10 | /// 11 | /// A with the contents of the audio to play. 12 | Stream GetAudioStream(); 13 | } -------------------------------------------------------------------------------- /src/MatoProductivity.Core/LocalNotification/NotificationEventArgs.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 MatoProductivity.Core.LocalNotification 8 | { 9 | 10 | public class NotificationEventArgs : EventArgs 11 | { 12 | public string Title { get; set; } 13 | public string Message { get; set; } 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/libs/Plugin.Maui.Audio/AudioPlayer/AudioPlayer.shared.cs: -------------------------------------------------------------------------------- 1 | namespace Plugin.Maui.Audio; 2 | 3 | public partial class AudioPlayer : IAudioPlayer 4 | { 5 | #pragma warning disable CS0067 6 | 7 | public event EventHandler? PlaybackEnded; 8 | 9 | #pragma warning restore CS0067 10 | ~AudioPlayer() 11 | { 12 | Dispose(false); 13 | } 14 | 15 | public void Dispose() 16 | { 17 | Dispose(true); 18 | 19 | GC.SuppressFinalize(this); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location.Amap/AmapInverseLocationResponse.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Amap 2 | { 3 | /// 4 | /// 逆地址解析结果 5 | /// 6 | public class AmapInverseLocationResponse : AmapHttpResponse 7 | { 8 | public AmapRegeocode Regeocode { get; set; } 9 | public AmapInverseLocationResponse() 10 | { 11 | Regeocode = new AmapRegeocode(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/MatoProductivity/Common/CommonFunctionEventArgs.cs: -------------------------------------------------------------------------------- 1 | 2 | using MatoProductivity.Infrastructure.Common; 3 | 4 | namespace MatoProductivity.Common 5 | { 6 | public class CommonFunctionEventArgs 7 | { 8 | public CommonFunctionEventArgs(IBasicInfo info, string code) 9 | { 10 | Info = info; 11 | Code = code; 12 | } 13 | public IBasicInfo Info { get; set; } 14 | public string Code { get; set; } 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Controls/StyleType.cs: -------------------------------------------------------------------------------- 1 | #if ANDROID 2 | 3 | # endif 4 | #if IOS 5 | using Foundation; 6 | using UIKit; 7 | using Microsoft.Maui.Controls.Compatibility.Platform.iOS; 8 | # endif 9 | 10 | 11 | namespace MatoProductivity.Core.Controls 12 | { 13 | public partial class WysiwygContentEditor 14 | { 15 | public enum StyleType 16 | { 17 | underline, italic, bold, backgoundColor, foregroundColor, size 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Models/Entities/INoteSegmentPayload.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Models.Entities 2 | { 3 | public interface INoteSegmentPayload 4 | { 5 | string Key { get; set; } 6 | string StringValue { get; } 7 | byte[] Value { get; set; } 8 | string ValueType { get; set; } 9 | 10 | T GetConcreteValue() where T : struct; 11 | string GetStringValue(); 12 | void SetStringValue(string value); 13 | } 14 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Common/DayModel.cs: -------------------------------------------------------------------------------- 1 | using MatoProductivity.Infrastructure; 2 | using System; 3 | using System.ComponentModel; 4 | 5 | namespace MatoProductivity.Models 6 | { 7 | 8 | public class DayModel : ObservableObject 9 | { 10 | public int Column { get; set; } 11 | public DateTime Date { get; set; } 12 | public int Day { get; set; } 13 | public string DayName { get; set; } 14 | public DayStateEnum State { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/iOS/Program.cs: -------------------------------------------------------------------------------- 1 | using UIKit; 2 | 3 | namespace MatoProductivity { 4 | public class Program 5 | { 6 | // This is the main entry point of the application. 7 | static void Main(string[] args) 8 | { 9 | // if you want to use a different Application Delegate class from "AppDelegate" 10 | // you can specify it here. 11 | UIApplication.Main(args, null, typeof(AppDelegate)); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Services/IDraggableItem.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Services 2 | { 3 | public interface IDraggableItem 4 | { 5 | bool IsBeingDraggedOver { get; set; } 6 | bool IsBeingDragged { get; set; } 7 | Command Dragged { get; set; } 8 | Command DraggedOver { get; set; } 9 | 10 | Command DragLeave { get; set; } 11 | 12 | Command Dropped { get; set; } 13 | 14 | object DraggedItem { get; set; } 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Services/AutoSetChangedEventArgs.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 MatoProductivity.Core.Services 8 | { 9 | public class AutoSetChangedEventArgs: EventArgs 10 | { 11 | public bool IsAutoSet { get; set; } 12 | 13 | public AutoSetChangedEventArgs(bool isAutoSet) 14 | { 15 | this.IsAutoSet= isAutoSet; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/MatoProductivity/MatoProductivityBuilderExtensions.cs: -------------------------------------------------------------------------------- 1 | using Abp.Modules; 2 | using MatoProductivity.Core; 3 | 4 | namespace MatoProductivity 5 | { 6 | public static class MatoProductivityBuilderExtensions 7 | { 8 | 9 | public static MauiAppBuilder UseMatoProductivity(this MauiAppBuilder builder) where TStartupModule : AbpModule 10 | { 11 | builder.Services.AddMatoProductivityService(); 12 | return builder; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/MatoProductivity/ViewModels/NoteTimeLineGroup.cs: -------------------------------------------------------------------------------- 1 | using MatoProductivity.Core.Models.Entities; 2 | using System.Collections.ObjectModel; 3 | 4 | namespace MatoProductivity.ViewModels 5 | { 6 | public class NoteTimeLineGroup : ObservableCollection 7 | { 8 | public string TimeCategory { get; private set; } 9 | 10 | public NoteTimeLineGroup(string category, IEnumerable Notes) : base(Notes) 11 | { 12 | TimeCategory = category; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/libs/Plugin.Maui.Audio/AudioRecorder/AudioRecorder.net.cs: -------------------------------------------------------------------------------- 1 | namespace Plugin.Maui.Audio; 2 | 3 | partial class AudioRecorder : IAudioRecorder 4 | { 5 | public AudioRecorder() 6 | { 7 | } 8 | 9 | public bool CanRecordAudio => false; 10 | 11 | public bool IsRecording => false; 12 | 13 | public Task StartAsync() => Task.CompletedTask; 14 | 15 | public Task StartAsync(string filePath) => Task.CompletedTask; 16 | 17 | public Task StopAsync() => Task.FromResult(new EmptyAudioSource()); 18 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/MacCatalyst/Program.cs: -------------------------------------------------------------------------------- 1 | using UIKit; 2 | 3 | namespace MatoProductivity.Platforms.MacCatalyst 4 | { 5 | public class Program 6 | { 7 | // This is the main entry point of the application. 8 | static void Main(string[] args) 9 | { 10 | // if you want to use a different Application Delegate class from "AppDelegate" 11 | // you can specify it here. 12 | UIApplication.Main(args, null, typeof(AppDelegate)); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Services/NotificationJobArgs.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Services 2 | { 3 | 4 | [Serializable] 5 | public class NotificationJobArgs 6 | { 7 | public NotificationJobArgs(string notificationTitle, string notificationContent) 8 | { 9 | NotificationTitle = notificationTitle; 10 | NotificationContent = notificationContent; 11 | } 12 | 13 | public string NotificationTitle { get; set; } 14 | public string NotificationContent { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Models/NotificationEto.cs: -------------------------------------------------------------------------------- 1 | using Abp.Events.Bus; 2 | using MatoProductivity.Core.Services; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace MatoProductivity.Core.Models 10 | { 11 | public class NotificationEto:EventData 12 | { 13 | public NotificationEto(NotificationJobArgs args) 14 | { 15 | Args = args; 16 | } 17 | 18 | public NotificationJobArgs Args { get; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/LocalNotification/INotificationManager.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 MatoProductivity.Core.LocalNotification 8 | { 9 | public interface INotificationManager 10 | { 11 | event EventHandler NotificationReceived; 12 | void Initialize(); 13 | void SendNotification(string title, string message, DateTime? notifyTime = null); 14 | void ReceiveNotification(string title, string message); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/TodoSegmentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Services; 3 | using Microsoft.Maui.Layouts; 4 | 5 | namespace MatoProductivity.Core.Views; 6 | 7 | public partial class TodoSegmentView : ContentView, ITransientDependency 8 | { 9 | 10 | public TodoSegmentView() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | private void IsDoneToggleButton_Toggled(object sender, ToggledEventArgs e) 16 | { 17 | (this.BindingContext as TodoSegmentService).SwitchDone.Execute(e.Value); 18 | } 19 | } -------------------------------------------------------------------------------- /src/MatoProductivity/ViewModels/NoteSegmentStoreGroup.cs: -------------------------------------------------------------------------------- 1 | using MatoProductivity.Core.Models.Entities; 2 | using System.Collections.ObjectModel; 3 | 4 | namespace MatoProductivity.ViewModels 5 | { 6 | public class NoteSegmentStoreGroup : ObservableCollection 7 | { 8 | public string Category { get; private set; } 9 | 10 | public NoteSegmentStoreGroup(string category, IEnumerable NoteSegmentStores) : base(NoteSegmentStores) 11 | { 12 | Category = category; 13 | } 14 | } 15 | 16 | 17 | 18 | 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/MatoProductivity.Infrastructure/MatoProductivity.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | enable 6 | latest 7 | AnyCPU;x64 8 | 9 | 10 | 11 | 12 | all 13 | runtime; build; native; contentfiles; analyzers 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/MatoProductivity/Controls/SelectionArgs.cs: -------------------------------------------------------------------------------- 1 | #if ANDROID 2 | 3 | # endif 4 | #if IOS 5 | using Foundation; 6 | using UIKit; 7 | using Microsoft.Maui.Controls.Compatibility.Platform.iOS; 8 | # endif 9 | 10 | 11 | namespace MatoProductivity.Core.Controls 12 | { 13 | public partial class WysiwygContentEditor 14 | { 15 | public class SelectionArgs : EventArgs 16 | { 17 | public int Start; 18 | public int End; 19 | public SelectionArgs(int start, int end) 20 | { 21 | Start = start; 22 | End = end; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/libs/Plugin.Maui.Audio/FileAudioSource.cs: -------------------------------------------------------------------------------- 1 | namespace Plugin.Maui.Audio; 2 | 3 | /// 4 | /// A file based implementation. 5 | /// 6 | public class FileAudioSource : IAudioSource 7 | { 8 | public FileAudioSource(string filePath) 9 | { 10 | this.filePath = filePath; 11 | } 12 | 13 | readonly string filePath; 14 | 15 | public string GetFilePath() 16 | { 17 | return filePath; 18 | } 19 | 20 | public Stream GetAudioStream() 21 | { 22 | if (File.Exists(filePath)) 23 | { 24 | return new FileStream(filePath, FileMode.Open, FileAccess.Read); 25 | } 26 | 27 | return Stream.Null; 28 | } 29 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Views/ThirdPartyLicensesPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Abp.Configuration; 3 | using Abp.Dependency; 4 | using MatoProductivity.Core.Settings; 5 | using MatoProductivity.ViewModels; 6 | 7 | namespace MatoProductivity 8 | { 9 | public partial class ThirdPartyLicensesPage : ContentPageBase, ISingletonDependency 10 | { 11 | public ThirdPartyLicensesPage() 12 | { 13 | InitializeComponent(); 14 | } 15 | 16 | private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e) 17 | { 18 | await navigationService.PopAsync(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/MatoProductivity/Controls/StyleArgs.cs: -------------------------------------------------------------------------------- 1 | #if ANDROID 2 | 3 | # endif 4 | #if IOS 5 | using Foundation; 6 | using UIKit; 7 | using Microsoft.Maui.Controls.Compatibility.Platform.iOS; 8 | # endif 9 | 10 | 11 | namespace MatoProductivity.Core.Controls 12 | { 13 | public partial class WysiwygContentEditor 14 | { 15 | public class StyleArgs : EventArgs 16 | { 17 | public StyleType Style; 18 | 19 | public string Params; 20 | public StyleArgs(StyleType style, string @params = null) 21 | { 22 | Style = style; 23 | Params=@params; 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/MatoProductivity.Infrastructure/InfoResult.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 MatoProductivity.Infrastructure 8 | { 9 | public class InfoResult 10 | { 11 | public InfoResult(bool isSucess) 12 | { 13 | IsSucess = isSucess; 14 | Result = default; 15 | } 16 | public InfoResult(bool isSucess, T result) 17 | { 18 | IsSucess = isSucess; 19 | Result = result; 20 | } 21 | public bool IsSucess { get; set; } 22 | public T Result { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Android/HtmlParser.Android.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.Text; 3 | 4 | namespace MatoProductivity.Core.Controls 5 | { 6 | public static class HtmlParser_Android 7 | { 8 | public static ISpanned HtmlToSpanned(string htmlString) 9 | { 10 | ISpanned spanned = Html.FromHtml(htmlString, FromHtmlOptions.ModeCompact); 11 | return spanned; 12 | } 13 | 14 | public static string SpannedToHtml(ISpanned spanned) 15 | { 16 | string htmlString = Html.ToHtml(spanned, ToHtmlOptions.ParagraphLinesIndividual); 17 | return htmlString; 18 | } 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/True2FalseConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using Microsoft.Maui.Controls; 4 | 5 | namespace MatoProductivity.Converter 6 | { 7 | public class True2FalseConverter : IValueConverter 8 | { 9 | public True2FalseConverter() 10 | { 11 | 12 | } 13 | 14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 15 | { 16 | return !(bool)value; 17 | } 18 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 19 | { 20 | return !(bool)value; 21 | } 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/PrivacyPolicyPopupPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Models.Entities; 3 | using MatoProductivity.ViewModels; 4 | 5 | namespace MatoProductivity.Core.Views; 6 | 7 | public partial class PrivacyPolicyPopupPage : PopupBase, ITransientDependency 8 | { 9 | 10 | public PrivacyPolicyPopupPage() 11 | { 12 | InitializeComponent(); 13 | 14 | } 15 | 16 | public PrivacyPolicyPopupPage(string url) : this() 17 | { 18 | this.MainWebView.Source=url; 19 | } 20 | 21 | private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e) 22 | { 23 | await this.CloseAsync(); 24 | } 25 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/more.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/AboutMePage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Models.Entities; 3 | using MatoProductivity.ViewModels; 4 | 5 | namespace MatoProductivity.Views; 6 | 7 | public partial class AboutMePage : PopupBase, ITransientDependency 8 | { 9 | private AboutMePageViewModel AboutMePageViewModel => this.BindingContext as AboutMePageViewModel; 10 | 11 | public AboutMePage(AboutMePageViewModel aboutMePageViewModel) 12 | { 13 | InitializeComponent(); 14 | this.BindingContext = aboutMePageViewModel; 15 | } 16 | 17 | private async void PopupBase_Opened(object sender, CommunityToolkit.Maui.Core.PopupOpenedEventArgs e) 18 | { 19 | 20 | } 21 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/tab_user.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Raw/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories). Deployment of the asset to your application 3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. 4 | 5 | 6 | 7 | These files will be deployed with you package and will be accessible using Essentials: 8 | 9 | async Task LoadMauiAsset() 10 | { 11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); 12 | using var reader = new StreamReader(stream); 13 | 14 | var contents = reader.ReadToEnd(); 15 | } 16 | -------------------------------------------------------------------------------- /src/libs/QWeatherAPI/Result/Share/WindScale.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 QWeatherAPI.Result.Share 8 | { 9 | public class WindScale 10 | { 11 | /// 12 | /// 最大风力等级 13 | /// 14 | public int ScaleMax; 15 | /// 16 | /// 最小风力等级 17 | /// 18 | public int ScaleMin; 19 | 20 | internal WindScale(string scale) 21 | { 22 | string[] splitScale = scale.Split('-'); 23 | ScaleMin = int.Parse(splitScale[0]); 24 | ScaleMax = int.Parse(splitScale[1]); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Services/INoteSegmentService.cs: -------------------------------------------------------------------------------- 1 | using MatoProductivity.Core.Models.Entities; 2 | 3 | namespace MatoProductivity.Core.Services 4 | { 5 | public interface INoteSegmentService:IDraggableItem 6 | { 7 | INoteSegment NoteSegment { get; set; } 8 | Command Submit { get; set; } 9 | Command Create { get; set; } 10 | Command Remove { get; set; } 11 | Command GoToState { get; set; } 12 | NoteSegmentState NoteSegmentState { get; set; } 13 | IReadOnlyNoteSegmentServiceContainer Container { get; set; } 14 | 15 | void SubmitAction(object obj); 16 | void CreateAction(object obj); 17 | void RemoveAction(object obj); 18 | void GoToStateAction(object obj); 19 | 20 | } 21 | } -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Models/Entities/INoteSegment.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Models.Entities 2 | { 3 | public interface INoteSegment 4 | { 5 | string Color { get; set; } 6 | string Desc { get; set; } 7 | string Icon { get; set; } 8 | bool IsHidden { get; set; } 9 | bool IsRemovable { get; set; } 10 | int Rank { get; set; } 11 | string Status { get; set; } 12 | string Title { get; set; } 13 | string Type { get; set; } 14 | 15 | INoteSegmentPayload GetNoteSegmentPayload(string key); 16 | INoteSegmentPayload GetOrSetNoteSegmentPayload(string key, INoteSegmentPayload noteSegmentPayload); 17 | void SetNoteSegmentPayload(INoteSegmentPayload noteSegmentPayload); 18 | } 19 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/IntegerDigitVisibleConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using Microsoft.Maui.Controls; 4 | 5 | namespace MatoProductivity.Converter 6 | { 7 | internal class IntegerDigitVisibleConverter : IValueConverter 8 | { 9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 10 | { 11 | var intDigitLength = (int)value; 12 | var digitIndex = System.Convert.ToInt32(parameter); 13 | 14 | return digitIndex < intDigitLength; 15 | } 16 | 17 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/MatoProductivity/Common/PopupSize.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace MatoProductivity 3 | { 4 | static class PopupSize 5 | { 6 | // examples for fixed sizes 7 | public static Size Tiny => new Size(100, 100); 8 | 9 | public static Size Small => new Size(300, 300); 10 | 11 | // examples for relative to screen sizes 12 | public static Size Medium => new Size(0.7 * (DeviceDisplay.MainDisplayInfo.Width / DeviceDisplay.MainDisplayInfo.Density), 0.6 * (DeviceDisplay.MainDisplayInfo.Height / DeviceDisplay.MainDisplayInfo.Density)); 13 | 14 | public static Size Large => new Size(0.9 * (DeviceDisplay.MainDisplayInfo.Width / DeviceDisplay.MainDisplayInfo.Density), 0.8 * (DeviceDisplay.MainDisplayInfo.Height / DeviceDisplay.MainDisplayInfo.Density)); 15 | } 16 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/DecimalDigitVisibleConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using Microsoft.Maui.Controls; 4 | 5 | namespace MatoProductivity.Converter 6 | { 7 | internal class DecimalDigitVisibleConverter : IValueConverter 8 | { 9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 10 | { 11 | var decDigitLength = (int)value; 12 | var digitIndex = System.Convert.ToInt32(parameter); 13 | 14 | return digitIndex < decDigitLength; 15 | } 16 | 17 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/AlbumArtConverter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Maui.Controls; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace MatoProductivity.Converter 10 | { 11 | public class AlbumArtConverter : IValueConverter 12 | { 13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 14 | { 15 | return (value as ImageSource) == null ? "albumart_placeholder.png" : value; 16 | } 17 | 18 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 19 | { 20 | throw new NotImplementedException(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/PrivacyPolicyPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Abp.Configuration; 3 | using Abp.Dependency; 4 | using MatoProductivity.Core.Settings; 5 | using MatoProductivity.ViewModels; 6 | 7 | namespace MatoProductivity 8 | { 9 | public partial class PrivacyPolicyPage : ContentPageBase, ISingletonDependency 10 | { 11 | public PrivacyPolicyPage() 12 | { 13 | InitializeComponent(); 14 | } 15 | 16 | public PrivacyPolicyPage(string url) : this() 17 | { 18 | this.MainWebView.Source=url; 19 | } 20 | 21 | private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e) 22 | { 23 | await navigationService.PopAsync(); 24 | 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/log4net.Production.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/log4net.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location.Amap/AmapPositiveHttpResponse.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace MatoProductivity.Core.Amap 4 | { 5 | /// 6 | /// 正地址解析结果 7 | /// 8 | public class AmapPositiveHttpResponse : AmapHttpResponse 9 | { 10 | /// 11 | /// 返回结果数目 12 | /// 13 | /// 14 | /// 返回结果的个数。 15 | /// 16 | public int Count { get; set; } 17 | 18 | /// 19 | /// 地理编码信息列表 20 | /// 21 | [JsonProperty("geocodes")] 22 | public AmapGeocode[] Geocodes { get; set; } 23 | 24 | public AmapPositiveHttpResponse() 25 | { 26 | Geocodes = new AmapGeocode[0]; 27 | } 28 | 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Models/Entities/Setting.cs: -------------------------------------------------------------------------------- 1 | using Abp.AutoMapper; 2 | using Abp.Domain.Entities; 3 | using Abp.Extensions; 4 | using AutoMapper.Configuration.Annotations; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.ComponentModel.DataAnnotations; 8 | using System.ComponentModel.DataAnnotations.Schema; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | 13 | namespace MatoProductivity.Core.Models.Entities 14 | { 15 | public class Setting : Entity 16 | { 17 | public Setting(string id, string value) 18 | { 19 | Id=id; 20 | Value=value; 21 | } 22 | 23 | [Key] 24 | public override string Id { get; set; } 25 | public string Value { get; set; } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/IconSelectingPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Models.Entities; 3 | using MatoProductivity.ViewModels; 4 | 5 | namespace MatoProductivity.Views; 6 | 7 | public partial class IconSelectingPage : PopupBase, ITransientDependency 8 | { 9 | private IconSelectingPageViewModel IconSelectingPageViewModel => this.BindingContext as IconSelectingPageViewModel; 10 | 11 | public IconSelectingPage(IconSelectingPageViewModel iconSelectingPageViewModel) 12 | { 13 | InitializeComponent(); 14 | this.BindingContext = iconSelectingPageViewModel; 15 | } 16 | 17 | private async void PopupBase_Opened(object sender, CommunityToolkit.Maui.Core.PopupOpenedEventArgs e) 18 | { 19 | await IconSelectingPageViewModel.Init(); 20 | 21 | } 22 | } -------------------------------------------------------------------------------- /src/MatoProductivity/ViewModels/KeyValueStatisticGroup.cs: -------------------------------------------------------------------------------- 1 | using MatoProductivity.Core.Models.Entities; 2 | using System.Collections.ObjectModel; 3 | 4 | namespace MatoProductivity.ViewModels 5 | { 6 | 7 | public class NoteStatistic 8 | { 9 | public string Title { get; set; } 10 | 11 | public ICollection KeyValueStatisticGroups { get; set; } 12 | public ICollection CreationTimes { get; set; } 13 | } 14 | 15 | public class KeyValueStatisticGroup : ObservableCollection 16 | { 17 | public string Title { get; private set; } 18 | 19 | public KeyValueStatisticGroup(string title, IEnumerable keyValueSegments) : base(keyValueSegments) 20 | { 21 | Title = title; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/MatoProductivity/Controls/RecordingMotionView.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Windows/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | true/PM 12 | PerMonitorV2, PerMonitor 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location/LocationResolveException.cs: -------------------------------------------------------------------------------- 1 | using Abp; 2 | using System; 3 | using System.Runtime.Serialization; 4 | 5 | namespace MatoProductivity.Core.Location 6 | { 7 | public class LocationResolveException : AbpException 8 | { 9 | public LocationResolveException() 10 | { 11 | } 12 | 13 | public LocationResolveException(string message) 14 | : base(message) 15 | { 16 | } 17 | 18 | public LocationResolveException(string message, Exception innerException) 19 | : base(message, innerException) 20 | { 21 | } 22 | 23 | public LocationResolveException(SerializationInfo serializationInfo, StreamingContext context) 24 | : base(serializationInfo, context) 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/NotePage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.ViewModels; 3 | 4 | namespace MatoProductivity.Views; 5 | 6 | public partial class NotePage : PopupBase, ITransientDependency 7 | { 8 | private NotePageViewModel NotePageViewModel => this.BindingContext as NotePageViewModel; 9 | 10 | public NotePage(NotePageViewModel NotePageViewModel, long NoteId) 11 | { 12 | InitializeComponent(); 13 | this.BindingContext = NotePageViewModel; 14 | this.NotePageViewModel.NoteId = NoteId; 15 | 16 | 17 | } 18 | 19 | private void DragGestureRecognizer_DragStarting_Collection(object sender, DragStartingEventArgs e) 20 | { 21 | 22 | } 23 | 24 | private void DropGestureRecognizer_DragOver(object sender, DragEventArgs e) 25 | { 26 | 27 | } 28 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/SliderMaxValueConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using Microsoft.Maui.Controls; 4 | 5 | namespace MatoProductivity.Converter 6 | { 7 | public class SliderMaxValueConverter : IValueConverter 8 | { 9 | public SliderMaxValueConverter() 10 | { 11 | } 12 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 13 | { 14 | var val = (double)value; 15 | if (val <= 0) 16 | { 17 | val = double.MaxValue; 18 | } 19 | return val; 20 | } 21 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 22 | { 23 | return !(bool)value; 24 | } 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/UserProfilePage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Abp.Configuration; 3 | using Abp.Dependency; 4 | using MatoProductivity.Core.Settings; 5 | using MatoProductivity.ViewModels; 6 | 7 | namespace MatoProductivity 8 | { 9 | public partial class UserProfilePage : ContentPageBase, ISingletonDependency 10 | { 11 | private UserProfilePageViewModel UserProfilePageViewModel => this.BindingContext as UserProfilePageViewModel; 12 | 13 | public UserProfilePage(UserProfilePageViewModel noteTemplateListPageViewModel) 14 | { 15 | InitializeComponent(); 16 | this.BindingContext = noteTemplateListPageViewModel; 17 | } 18 | 19 | 20 | private void TextCell_Tapped(object sender, EventArgs e) 21 | { 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/AppActionSettingPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Models.Entities; 3 | using MatoProductivity.ViewModels; 4 | 5 | namespace MatoProductivity.Views; 6 | 7 | public partial class AppActionSettingPage : PopupBase, ITransientDependency 8 | { 9 | private AppActionSettingPageViewModel AppActionSettingPageViewModel => this.BindingContext as AppActionSettingPageViewModel; 10 | 11 | public AppActionSettingPage(AppActionSettingPageViewModel noteSegmentStoreListPageViewModel) 12 | { 13 | InitializeComponent(); 14 | this.BindingContext = noteSegmentStoreListPageViewModel; 15 | } 16 | 17 | private async void PopupBase_Opened(object sender, CommunityToolkit.Maui.Core.PopupOpenedEventArgs e) 18 | { 19 | await AppActionSettingPageViewModel.Init(); 20 | 21 | } 22 | } -------------------------------------------------------------------------------- /src/libs/QWeatherAPI/Tools/Net/Http/WebRequests.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http; 2 | using System.Text; 3 | using System.Threading.Tasks; 4 | 5 | namespace QWeatherAPI.Tools.Net.Http 6 | { 7 | internal static class WebRequests 8 | { 9 | // Get 请求 10 | internal static async Task GetRequestAsync(string Url, HttpMessageHandler handler = null) 11 | { 12 | Url = Url.Trim(); 13 | if (handler == null) 14 | { 15 | handler = new HttpClientHandler() 16 | { 17 | AutomaticDecompression = System.Net.DecompressionMethods.GZip 18 | }; 19 | } 20 | using (HttpClient client = new HttpClient(handler)) 21 | { 22 | return await client.GetAsync(Url); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/MatoProductivity.EntityFrameworkCore/EntityFrameworkCore/DbContextOptionsConfigurer.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Common; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace MatoProductivity.EntityFrameworkCore 5 | { 6 | public static class DbContextOptionsConfigurer 7 | { 8 | public static void Configure( 9 | DbContextOptionsBuilder dbContextOptions, 10 | string connectionString 11 | ) 12 | { 13 | /* This is the single point to configure DbContextOptions for MatoProductivityDbContext */ 14 | dbContextOptions.UseSqlite(connectionString); 15 | } 16 | 17 | public static void Configure(DbContextOptionsBuilder builder, DbConnection connection) 18 | { 19 | builder.UseSqlite(connection); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/NoteSegmentStoreListPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Models.Entities; 3 | using MatoProductivity.ViewModels; 4 | 5 | namespace MatoProductivity.Views; 6 | 7 | public partial class NoteSegmentStoreListPage : PopupBase, ITransientDependency 8 | { 9 | private NoteSegmentStoreListPageViewModel NoteSegmentStoreListPageViewModel => this.BindingContext as NoteSegmentStoreListPageViewModel; 10 | 11 | public NoteSegmentStoreListPage(NoteSegmentStoreListPageViewModel noteSegmentStoreListPageViewModel) 12 | { 13 | InitializeComponent(); 14 | this.BindingContext = noteSegmentStoreListPageViewModel; 15 | } 16 | 17 | private async void PopupBase_Opened(object sender, CommunityToolkit.Maui.Core.PopupOpenedEventArgs e) 18 | { 19 | await NoteSegmentStoreListPageViewModel.Init(); 20 | 21 | } 22 | } -------------------------------------------------------------------------------- /src/libs/Plugin.Maui.Audio/StreamMediaDataSource.android.cs: -------------------------------------------------------------------------------- 1 | namespace Plugin.Maui.Audio; 2 | 3 | class StreamMediaDataSource : Android.Media.MediaDataSource 4 | { 5 | Stream data; 6 | 7 | public StreamMediaDataSource(Stream data) 8 | { 9 | this.data = data; 10 | } 11 | 12 | public override long Size => data.Length; 13 | 14 | public override int ReadAt(long position, byte[]? buffer, int offset, int size) 15 | { 16 | ArgumentNullException.ThrowIfNull(buffer); 17 | 18 | if (data.CanSeek) 19 | { 20 | data.Seek(position, SeekOrigin.Begin); 21 | } 22 | 23 | return data.Read(buffer, offset, size); 24 | } 25 | 26 | public override void Close() 27 | { 28 | data.Dispose(); 29 | data = Stream.Null; 30 | } 31 | 32 | protected override void Dispose(bool disposing) 33 | { 34 | base.Dispose(disposing); 35 | 36 | data.Dispose(); 37 | data = Stream.Null; 38 | } 39 | } -------------------------------------------------------------------------------- /src/libs/Plugin.Maui.Audio/TaskExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Plugin.Maui.Audio; 2 | 3 | public static class TaskExtensions 4 | { 5 | /// 6 | /// Provides a mechanism to await until the supplied has been cancelled. 7 | /// 8 | /// The to await. 9 | /// A task that represents the asynchronous operation. 10 | public static Task WhenCanceled(this CancellationToken cancellationToken) 11 | { 12 | var completionSource = new TaskCompletionSource(); 13 | 14 | cancellationToken.Register( 15 | input => 16 | { 17 | if (input is TaskCompletionSource taskCompletionSource) 18 | { 19 | taskCompletionSource.SetResult(true); 20 | } 21 | }, 22 | completionSource); 23 | 24 | return completionSource.Task; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Theme/Theme.cs: -------------------------------------------------------------------------------- 1 | using Abp.Domain.Entities.Auditing; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.ComponentModel.DataAnnotations.Schema; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace MatoProductivity.Core.Theme 11 | { 12 | public class Theme : FullAuditedEntity 13 | { 14 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] 15 | public override long Id { get; set; } 16 | public string Title { get; set; } 17 | public string Name { get; set; } 18 | public string Img { get; set; } 19 | 20 | public bool IsSel { get; set; } 21 | public string ColorA { get; set; } 22 | public string ColorB { get; set; } 23 | public string ColorC { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/MatoProductivity/ViewModels/FinishedChooiseEvenArgs.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.ViewModels 2 | { 3 | public class FinishedChooiseEvenArgs 4 | { 5 | 6 | public FinishedChooiseEvenArgs(string address , Core.Location.Location location) 7 | { 8 | Address=address; 9 | Location=location; 10 | } 11 | private string _address; 12 | 13 | public string Address 14 | { 15 | get { return _address; } 16 | set 17 | { 18 | _address = value; 19 | } 20 | } 21 | 22 | 23 | private Core.Location.Location _location; 24 | 25 | public Core.Location.Location Location 26 | { 27 | get { return _location; } 28 | set 29 | { 30 | _location = value; 31 | } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Views/E.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Models.Entities; 3 | using MatoProductivity.ViewModels; 4 | 5 | namespace MatoProductivity.Views; 6 | 7 | public partial class E : PopupBase, ITransientDependency 8 | { 9 | 10 | 11 | private bool isOpen = false; 12 | private Animation[] animations = null; 13 | public E() 14 | { 15 | InitializeComponent(); 16 | this.CanBeDismissedByTappingOutsideOfPopup = false; 17 | Opened +=E_Opened; 18 | animations=new Animation[1]; 19 | } 20 | 21 | private void E_Opened(object sender, CommunityToolkit.Maui.Core.PopupOpenedEventArgs e) 22 | { 23 | Init(); 24 | } 25 | 26 | 27 | public async void Init() 28 | { 29 | var result = await MainImage.ScaleTo(1.5, 1000).ContinueWith(c => this.CanBeDismissedByTappingOutsideOfPopup=true); 30 | } 31 | 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/StatisticPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Models.Entities; 3 | using MatoProductivity.ViewModels; 4 | using Microsoft.AspNetCore.Components.WebView.Maui; 5 | 6 | namespace MatoProductivity.Views; 7 | 8 | public partial class StatisticPage : ContentPageBase, ISingletonDependency 9 | { 10 | private StatisticPageViewModel noteListPageViewModel => this.BindingContext as StatisticPageViewModel; 11 | 12 | public StatisticPage(StatisticPageViewModel noteListPageViewModel) 13 | { 14 | InitializeComponent(); 15 | this.BindingContext = noteListPageViewModel; 16 | 17 | } 18 | 19 | private void ContentPageBase_Appearing(object sender, EventArgs e) 20 | { 21 | rootComponent.Parameters = 22 | new Dictionary 23 | { 24 | { "StatisticPageViewModel", noteListPageViewModel } 25 | }; 26 | } 27 | 28 | 29 | } -------------------------------------------------------------------------------- /src/libs/Plugin.Maui.Audio/AudioPlayer/AudioPlayer.net.cs: -------------------------------------------------------------------------------- 1 | namespace Plugin.Maui.Audio; 2 | 3 | partial class AudioPlayer : IAudioPlayer 4 | { 5 | public AudioPlayer(Stream audioStream) { } 6 | 7 | public AudioPlayer(string fileName) { } 8 | 9 | protected virtual void Dispose(bool disposing) { } 10 | 11 | public double Duration { get; } 12 | 13 | public double CurrentPosition { get; } 14 | 15 | public double Volume { get; set; } 16 | 17 | public double Balance { get; set; } 18 | 19 | public bool IsPlaying { get; } 20 | 21 | public bool Loop { get; set; } 22 | 23 | public bool CanSeek { get; } 24 | 25 | public void Play() { } 26 | 27 | public void Pause() { } 28 | 29 | public void Stop() { } 30 | 31 | public void Seek(double position) { } 32 | 33 | public double Speed { get; set; } 34 | 35 | public double MinimumSpeed { get; } 36 | 37 | public double MaximumSpeed { get; } 38 | 39 | public bool CanSetSpeed { get; } 40 | } -------------------------------------------------------------------------------- /src/MatoProductivity.EntityFrameworkCore/Seed/SeedHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Transactions; 7 | using Abp.Dependency; 8 | using Abp.Domain.Uow; 9 | using Abp.EntityFrameworkCore.Uow; 10 | using Microsoft.EntityFrameworkCore; 11 | 12 | namespace MatoProductivity.EntityFrameworkCore.Seed 13 | { 14 | public static class SeedHelper 15 | { 16 | public static void SeedHostDb(IIocResolver iocResolver) 17 | { 18 | Helper.WithDbContextHelper.WithDbContext(iocResolver, SeedHostDb); 19 | } 20 | 21 | public static void SeedHostDb(MatoProductivityDbContext context) 22 | { 23 | context.SuppressAutoSetTenantId = true; 24 | 25 | // Host seed 26 | new InitialDbBuilder(context).Create(); 27 | } 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/tab_statistics.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/TimeSpanRangeStringConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using MatoProductivity.Infrastructure.Helper; 4 | using Microsoft.Maui.Controls; 5 | 6 | namespace MatoProductivity.Converter 7 | { 8 | public class TimeSpanRangeStringConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | var time = (TimeSpan)value; 13 | var format = parameter==default ? "已过去|现在|还剩" : parameter.ToString(); 14 | return CommonHelper.FormatTimeSpamString(time, format); 15 | //return time.ToString("yyyy年M月d日 HH:mm:ss"); 16 | } 17 | 18 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 19 | { 20 | DateTime ts = DateTime.Parse(value as string); 21 | return ts; 22 | } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Android/AlarmHandler.cs: -------------------------------------------------------------------------------- 1 | using Android.Content; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace MatoProductivity.Core.Platforms.Android 9 | { 10 | [BroadcastReceiver(Enabled = true, Label = "Local Notifications Broadcast Receiver")] 11 | public class AlarmHandler : BroadcastReceiver 12 | { 13 | public override void OnReceive(Context context, Intent intent) 14 | { 15 | if (intent?.Extras != null) 16 | { 17 | string title = intent.GetStringExtra(LocalNotification.TitleKey); 18 | string message = intent.GetStringExtra(LocalNotification.MessageKey); 19 | 20 | LocalNotification manager = LocalNotification.Instance ?? new LocalNotification(); 21 | manager.Show(title, message); 22 | } 23 | } 24 | } 25 | 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MaBlaApp 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 |
Loading...
18 | 19 |
20 | An unhandled error has occurred. 21 | Reload 22 | 🗙 23 |
24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location.Amap/AmapHttpResponse.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | namespace MatoProductivity.Core.Amap 4 | { 5 | public abstract class AmapHttpResponse 6 | { 7 | /// 8 | /// 返回结果状态值 9 | /// 10 | /// 11 | /// 返回值为 0 或 1,0 表示请求失败;1 表示请求成功。 12 | /// 13 | public int Status { get; set; } 14 | /// 15 | /// 返回状态说明 16 | /// 17 | /// 18 | /// 当 status 为 0 时,info 会返回具体错误原因,否则返回“OK”。 19 | /// 20 | public string Info { get; set; } 21 | 22 | /// 23 | /// 返回状态码 24 | /// 25 | public string InfoCode { get; set; } 26 | 27 | public bool IsSuccess() 28 | { 29 | return Status == 1; 30 | } 31 | 32 | public string GetErrorMessage() 33 | { 34 | return this.Info; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/MatoProductivity/Extensions/TranslateExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Reflection; 4 | using System.Resources; 5 | using Abp.Domain.Services; 6 | using Abp.Localization; 7 | 8 | namespace MatoProductivity.Core.Localization 9 | { 10 | // You exclude the 'Extension' suffix when using in Xaml markup 11 | [ContentProperty("Text")] 12 | public class TranslateExtension : DomainService, IMarkupExtension 13 | { 14 | public TranslateExtension() 15 | { 16 | LocalizationSourceName = MatoProductivityConsts.LocalizationSourceName; 17 | 18 | } 19 | public string Text { get; set; } 20 | 21 | public object ProvideValue(IServiceProvider serviceProvider) 22 | { 23 | Console.WriteLine(CultureInfo.CurrentUICulture); 24 | if (Text == null) 25 | return ""; 26 | var translation = L(Text); 27 | return translation; 28 | } 29 | 30 | 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/NoteTemplateListPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Abp.Configuration; 3 | using Abp.Dependency; 4 | using MatoProductivity.Core.Settings; 5 | using MatoProductivity.ViewModels; 6 | 7 | namespace MatoProductivity 8 | { 9 | public partial class NoteTemplateListPage : ContentPageBase, ISingletonDependency 10 | { 11 | private NoteTemplateListPageViewModel NoteTemplateListPageViewModel => this.BindingContext as NoteTemplateListPageViewModel; 12 | 13 | public NoteTemplateListPage(NoteTemplateListPageViewModel noteTemplateListPageViewModel) 14 | { 15 | InitializeComponent(); 16 | this.BindingContext = noteTemplateListPageViewModel; 17 | this.Load(); 18 | } 19 | 20 | private async void ContentPageBase_Loaded(object sender, EventArgs e) 21 | { 22 | } 23 | 24 | private async void Load() 25 | { 26 | await NoteTemplateListPageViewModel.Init(); 27 | 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/amap_index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | AmapApp 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
Loading...
16 | 17 |
18 | An unhandled error has occurred. 19 | Reload 20 | 🗙 21 |
22 | 23 | 24 | 25 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/libs/Plugin.Maui.Audio/AudioRecorder/IAudioRecorder.shared.cs: -------------------------------------------------------------------------------- 1 | namespace Plugin.Maui.Audio; 2 | 3 | /// 4 | /// Provides the ability to record audio. 5 | /// 6 | public interface IAudioRecorder 7 | { 8 | /// 9 | /// Gets whether the device is capable of recording audio. 10 | /// 11 | bool CanRecordAudio { get; } 12 | 13 | /// 14 | /// Gets whether the recorder is currently recording audio. 15 | /// 16 | bool IsRecording { get; } 17 | 18 | /// 19 | /// Start recording audio to disk in a randomly generated file. 20 | /// 21 | Task StartAsync(); 22 | 23 | /// 24 | /// Start recording audio to disk in the supplied . 25 | /// 26 | ///The path on disk to store the recording. 27 | Task StartAsync(string filePath); 28 | 29 | /// 30 | /// Stop recording and return the instance with the recording data. 31 | /// 32 | Task StopAsync(); 33 | } -------------------------------------------------------------------------------- /src/MatoProductivity.Infrastructure/Helper/StreamHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace MatoProductivity.Infrastructure.Helper 7 | { 8 | public class StreamHelper 9 | { 10 | public static void WriteStream(Stream stream, string fileName) 11 | { 12 | FileStream fs = null; 13 | BinaryWriter bw = null; 14 | try 15 | { 16 | byte[] bytes = new byte[stream.Length]; 17 | stream.Read(bytes, 0, bytes.Length); 18 | stream.Seek(0, SeekOrigin.Begin); 19 | fs = new FileStream(fileName, FileMode.Create); 20 | bw = new BinaryWriter(fs); 21 | bw.Write(bytes); 22 | } 23 | catch (Exception ex) 24 | { 25 | return; 26 | } 27 | finally 28 | { 29 | bw.Close(); 30 | fs.Close(); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/SecondsToTimeSpanConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using Microsoft.Maui.Controls; 4 | 5 | namespace MatoProductivity.Converter 6 | { 7 | public class SecondsToTimeSpanConverter : IValueConverter 8 | { 9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 10 | { 11 | 12 | var time = new TimeSpan(); 13 | var result = string.Empty; 14 | var d = (double)value; 15 | if (d < 0) 16 | { 17 | return time.ToString(@"mm\:ss"); 18 | } 19 | time = TimeSpan.FromSeconds(d); 20 | result = time.ToString(time.TotalHours >= 1.0 ? @"hh\:mm\:ss" : @"mm\:ss"); 21 | return result; 22 | } 23 | 24 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 25 | { 26 | TimeSpan ts = (TimeSpan)value; 27 | return ts.TotalSeconds; 28 | } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Localization/MatoProductivityLocalization.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Abp.Configuration.Startup; 7 | using Abp.Localization.Dictionaries; 8 | using Abp.Localization.Dictionaries.Xml; 9 | using Abp.Reflection.Extensions; 10 | 11 | namespace MatoProductivity.Core.Localization 12 | { 13 | internal class LocalizationConfigurer 14 | { 15 | public static void Configure(ILocalizationConfiguration localizationConfiguration) 16 | { 17 | localizationConfiguration.Sources.Add( 18 | new DictionaryBasedLocalizationSource(MatoProductivityConsts.LocalizationSourceName, 19 | new XmlEmbeddedFileLocalizationDictionaryProvider( 20 | typeof(LocalizationConfigurer).GetAssembly(), 21 | "MatoProductivity.Core.Localization.SourceFiles" 22 | ) 23 | ) 24 | ); 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/libs/Plugin.Maui.Audio/FailedToLoadAudioException.shared.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace Plugin.Maui.Audio; 4 | 5 | /// 6 | /// When the audio fails to load this exception is thrown with details about the cause. 7 | /// 8 | public class FailedToLoadAudioException : Exception 9 | { 10 | /// 11 | /// Creates a new instance of this exception. 12 | /// 13 | /// Message which describes the cause of the exception. 14 | public FailedToLoadAudioException(string message) : base(message) 15 | { 16 | } 17 | 18 | protected FailedToLoadAudioException(SerializationInfo info, StreamingContext context) : base(info, context) 19 | { 20 | } 21 | 22 | /// 23 | /// Triggers a throw of this exception. 24 | /// 25 | /// Message which describes the cause of the exception. 26 | /// 27 | public static void Throw(string message) => throw new FailedToLoadAudioException(message); 28 | } -------------------------------------------------------------------------------- /src/libs/Plugin.Maui.Audio/AudioManager.shared.cs: -------------------------------------------------------------------------------- 1 | namespace Plugin.Maui.Audio; 2 | 3 | public class AudioManager : IAudioManager 4 | { 5 | static IAudioManager? currentImplementation; 6 | 7 | public static IAudioManager Current => currentImplementation ??= new AudioManager(); 8 | 9 | /// 10 | public IAudioPlayer CreatePlayer(Stream audioStream) 11 | { 12 | ArgumentNullException.ThrowIfNull(audioStream); 13 | 14 | return new AudioPlayer(audioStream); 15 | } 16 | 17 | /// 18 | public IAudioPlayer CreatePlayer(string fileName) 19 | { 20 | ArgumentNullException.ThrowIfNull(fileName); 21 | 22 | return new AudioPlayer(fileName); 23 | } 24 | 25 | /// 26 | public AsyncAudioPlayer CreateAsyncPlayer(Stream audioStream) => new (CreatePlayer(audioStream)); 27 | 28 | /// 29 | public AsyncAudioPlayer CreateAsyncPlayer(string fileName) => new (CreatePlayer(fileName)); 30 | 31 | /// 32 | public IAudioRecorder CreateRecorder() 33 | { 34 | return new AudioRecorder(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/tab_note_template.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Models/Entities/NoteGroup.cs: -------------------------------------------------------------------------------- 1 | using Abp.Domain.Entities.Auditing; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.ComponentModel.DataAnnotations.Schema; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace MatoProductivity.Core.Models.Entities 11 | { 12 | public class NoteGroup : FullAuditedEntity 13 | { 14 | public NoteGroup() 15 | { 16 | 17 | } 18 | public NoteGroup(string name, bool isHidden, bool isRemovable) 19 | { 20 | Title = name; 21 | IsHidden = isHidden; 22 | IsRemovable = isRemovable; 23 | } 24 | 25 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] 26 | public override long Id { get; set; } 27 | public string Title { get; set; } 28 | 29 | public bool IsHidden { get; set; } 30 | 31 | public bool IsRemovable { get; set; } 32 | 33 | public ICollection Notes { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/MatoProductivity/Resources/Images/tab_note.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/MacCatalyst/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UIRequiredDeviceCapabilities 11 | 12 | arm64 13 | 14 | UISupportedInterfaceOrientations 15 | 16 | UIInterfaceOrientationPortrait 17 | UIInterfaceOrientationLandscapeLeft 18 | UIInterfaceOrientationLandscapeRight 19 | 20 | UISupportedInterfaceOrientations~ipad 21 | 22 | UIInterfaceOrientationPortrait 23 | UIInterfaceOrientationPortraitUpsideDown 24 | UIInterfaceOrientationLandscapeLeft 25 | UIInterfaceOrientationLandscapeRight 26 | 27 | XSAppIconAssets 28 | Assets.xcassets/appicon.appiconset 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location/GecodeLocation.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace MatoProductivity.Core.Location 4 | { 5 | /// 6 | /// 正地址 7 | /// 8 | public class GecodeLocation : Location 9 | { 10 | /// 11 | /// 绝对精度 12 | /// 13 | public int Confidence { get; set; } 14 | /// 15 | /// 理解程度 16 | /// 分值范围0-100 17 | /// 分值越大,服务对地址理解程度越高 18 | /// 19 | public int Pomprehension { get; set; } 20 | /// 21 | /// 能精确理解的地址类型 22 | /// 23 | public string Level { get; set; } 24 | /// 25 | /// 附加信息 26 | /// 27 | public IDictionary Additionals { get; } 28 | 29 | public GecodeLocation() 30 | { 31 | Additionals = new Dictionary(); 32 | } 33 | 34 | public void AddAdditional(string key, object value) 35 | { 36 | Additionals.Add(key, value); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/MatoProductivity/App.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/MatoProductivity.EntityFrameworkCore/Helper/WithDbContextHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Transactions; 7 | using Abp.Dependency; 8 | using Abp.Domain.Uow; 9 | using Abp.EntityFrameworkCore.Uow; 10 | using Microsoft.EntityFrameworkCore; 11 | 12 | namespace MatoProductivity.EntityFrameworkCore.Helper 13 | { 14 | public class WithDbContextHelper 15 | { 16 | public static void WithDbContext(IIocResolver iocResolver, Action contextAction) 17 | where TDbContext : DbContext 18 | { 19 | using (var uowManager = iocResolver.ResolveAsDisposable()) 20 | { 21 | using (var uow = uowManager.Object.Begin(TransactionScopeOption.Suppress)) 22 | { 23 | var context = uowManager.Object.Current.GetDbContext(); 24 | 25 | contextAction(context); 26 | 27 | uow.Complete(); 28 | } 29 | } 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/MatoProductivity.EntityFrameworkCore/Migrations/20240124142247_v0.1.4.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace MatoProductivity.EntityFrameworkCore.Migrations 6 | { 7 | /// 8 | public partial class v014 : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.CreateTable( 14 | name: "Setting", 15 | columns: table => new 16 | { 17 | Id = table.Column(type: "TEXT", nullable: false), 18 | Value = table.Column(type: "TEXT", nullable: true) 19 | }, 20 | constraints: table => 21 | { 22 | table.PrimaryKey("PK_Setting", x => x.Id); 23 | }); 24 | } 25 | 26 | /// 27 | protected override void Down(MigrationBuilder migrationBuilder) 28 | { 29 | migrationBuilder.DropTable( 30 | name: "Setting"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/DateTimeToStringConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using Microsoft.Maui.Controls; 4 | 5 | namespace MatoProductivity.Converter 6 | { 7 | public class DateTimeToStringConverter : IValueConverter 8 | { 9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 10 | { 11 | if (value==null) 12 | { 13 | return null; 14 | } 15 | var time = (DateTime)value; 16 | var format = "yy年M月d日 HH:mm:ss"; 17 | if (DateTime.Now.Year==time.Year) 18 | { 19 | format = "M月d日 HH:mm:ss"; 20 | } 21 | string parseFomate = parameter == null ? format : parameter as string; 22 | return time.ToString(parseFomate); 23 | //return time.ToString("yyyy年M月d日 HH:mm:ss"); 24 | } 25 | 26 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 27 | { 28 | DateTime ts = DateTime.Parse(value as string); 29 | return ts; 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Services/NoteSegmentPayloadFactory.cs: -------------------------------------------------------------------------------- 1 | using MatoProductivity.Core.Models.Entities; 2 | using MatoProductivity.ViewModels; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace MatoProductivity.Core.Services 10 | { 11 | public static class NoteSegmentPayloadFactory 12 | { 13 | public static INoteSegmentPayload CreateNoteSegmentPayload(this NoteSegmentService noteSegmentService, string key, object value, string valuetype = null) 14 | { 15 | if (noteSegmentService.NoteSegment!=null) 16 | { 17 | if (noteSegmentService.NoteSegment is NoteSegment 18 | ) 19 | { 20 | return new NoteSegmentPayload(key, value, valuetype); 21 | } 22 | else if (noteSegmentService.NoteSegment is NoteSegmentTemplate) 23 | { 24 | 25 | return new NoteSegmentTemplatePayload(key, value, valuetype); 26 | } 27 | } 28 | return default; 29 | 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Services/NotificationJob.cs: -------------------------------------------------------------------------------- 1 | using Abp.BackgroundJobs; 2 | using Abp.Dependency; 3 | using Abp.Events.Bus; 4 | using Abp.Notifications; 5 | using MatoProductivity.Core.Models; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | 12 | 13 | namespace MatoProductivity.Core.Services 14 | { 15 | 16 | 17 | public class NotificationJob : IAsyncBackgroundJob, ITransientDependency 18 | { 19 | private readonly IEventBus eventBus; 20 | 21 | public NotificationJob(IEventBus eventBus) 22 | { 23 | this.eventBus = eventBus; 24 | } 25 | public async Task ExecuteAsync(NotificationJobArgs args) 26 | { 27 | await Task.Run(async () => 28 | { 29 | var notificationEto = new NotificationEto(args); 30 | await eventBus.TriggerAsync(this, notificationEto); 31 | Console.WriteLine("您有新的消息:" + args.NotificationTitle); 32 | Console.WriteLine(args.NotificationContent); 33 | }); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/libs/AipSdk/Baidu/Aip/ContentCensor/Base.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Baidu, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | 14 | namespace Baidu.Aip.ContentCensor 15 | { 16 | public class Base : AipServiceBase 17 | { 18 | public Base(string apiKey, string secretKey) : base(apiKey, secretKey) 19 | { 20 | } 21 | 22 | protected AipHttpRequest DefaultRequest(string uri) 23 | { 24 | return new AipHttpRequest(uri) 25 | { 26 | Method = "POST", 27 | BodyType = AipHttpRequest.BodyFormat.Formed 28 | }; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/TimeSpanToFriendlyStringConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using MatoProductivity.Infrastructure.Helper; 4 | using Microsoft.Maui.Controls; 5 | 6 | namespace MatoProductivity.Converter 7 | { 8 | public class TimeSpanToFriendlyStringConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | var time = (TimeSpan)value; 13 | if (parameter==default) 14 | { 15 | var format = "{0}天{1}时{2}分{3}秒"; 16 | return CommonHelper.FormatTimeSpamString2(time, format); 17 | } 18 | else 19 | { 20 | var format = parameter.ToString(); 21 | return time.ToString(@format); 22 | } 23 | //return time.ToString("yyyy年M月d日 HH:mm:ss"); 24 | } 25 | 26 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 27 | { 28 | DateTime ts = DateTime.Parse(value as string); 29 | return ts; 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/MatoProductivity/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Models/Entities/NoteSegmentStore.cs: -------------------------------------------------------------------------------- 1 | using Abp.AutoMapper; 2 | using Abp.Domain.Entities; 3 | using Abp.Extensions; 4 | using AutoMapper.Configuration.Annotations; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.ComponentModel.DataAnnotations; 8 | using System.ComponentModel.DataAnnotations.Schema; 9 | using System.Linq; 10 | using System.Text; 11 | using System.Threading.Tasks; 12 | 13 | namespace MatoProductivity.Core.Models.Entities 14 | { 15 | [AutoMapTo(typeof(NoteSegment), typeof(NoteSegmentTemplate))] 16 | 17 | public class NoteSegmentStore : Entity 18 | { 19 | 20 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] 21 | public override long Id { get; set; } 22 | public string Title { get; set; } 23 | public string Type { get; set; } 24 | public string Category { get; set; } 25 | public string Status { get; set; } 26 | public string Desc { get; set; } 27 | public string Icon { get; set; } 28 | public string Color { get; set; } 29 | public bool IsHidden { get; set; } 30 | 31 | public bool IsRemovable { get; set; } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Windows/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Maui; 2 | using Microsoft.Maui.Hosting; 3 | using Microsoft.UI.Xaml; 4 | using Windows.ApplicationModel; 5 | 6 | // To learn more about WinUI, the WinUI project structure, 7 | // and more about our project templates, see: http://aka.ms/winui-project-info. 8 | 9 | namespace MatoProductivity.WinUI 10 | { 11 | /// 12 | /// Provides application-specific behavior to supplement the default Application class. 13 | /// 14 | public partial class App : MauiWinUIApplication 15 | { 16 | /// 17 | /// Initializes the singleton application object. This is the first line of authored code 18 | /// executed, and as such is the logical equivalent of main() or WinMain(). 19 | /// 20 | public App() 21 | { 22 | this.InitializeComponent(); 23 | } 24 | 25 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 26 | 27 | protected override void OnLaunched(LaunchActivatedEventArgs args) 28 | { 29 | base.OnLaunched(args); 30 | 31 | Platform.OnLaunched(args); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Settings/CommonSettingNames.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 MatoProductivity.Core.Settings 8 | { 9 | public static class CommonSettingNames 10 | { 11 | public const string DatabaseVersion = "DatabaseVersion"; 12 | 13 | public const string IsNewSeason = "IsNewSeason"; 14 | public const string IsSleepModeOn = "IsSleepModeOn"; 15 | public const string TimingOffValue = "TimingOffValue"; 16 | public const string IsStopWhenTerminate = "IsStopWhenTerminate"; 17 | public const string IsAutoLrc = "IsAutoLrc"; 18 | public const string IsAutoOffset = "IsAutoOffset"; 19 | public const string IsAutoGA = "IsAutoGA"; 20 | public const string BackgroundList = "BackgroundList"; 21 | public const string IsShuffle = "IsShuffle"; 22 | public const string IsRepeatOne = "IsRepeatOne"; 23 | public const string IsRepeat = "IsRepeat"; 24 | public const string BreakPointMusicIndex = "BreakPointMusicIndex"; 25 | public const string IsHideQueueButton = "IsHideQueueButton"; 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/WeatherSegmentView.xaml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/E.xaml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/DateTimeToFormatTimeStringConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using MatoProductivity.Infrastructure.Helper; 4 | using Microsoft.Maui.Controls; 5 | 6 | namespace MatoProductivity.Converter 7 | { 8 | public class DateTimeToFormatTimeStringConverter : IValueConverter 9 | { 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | if (value==null) 13 | { 14 | return null; 15 | } 16 | var time = (DateTime)value; 17 | var format = "yy年M月d日 HH:mm:ss"; 18 | if (DateTime.Now.Year==time.Year) 19 | { 20 | format = "M月d日 HH:mm:ss"; 21 | } 22 | string parseFomate = parameter == null ? format : parameter as string; 23 | return CommonHelper.FormatDateTimeString(time, parseFomate); 24 | //return time.ToString("yyyy年M月d日 HH:mm:ss"); 25 | } 26 | 27 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 28 | { 29 | DateTime ts = DateTime.Parse(value as string); 30 | return ts; 31 | } 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/MatoProductivity.EntityFrameworkCore/EntityFrameworkCore/MatoProductivityDbContext.cs: -------------------------------------------------------------------------------- 1 | using Abp.EntityFrameworkCore; 2 | using Microsoft.EntityFrameworkCore; 3 | using MatoProductivity.Core.Theme; 4 | using MatoProductivity.Core.Models.Entities; 5 | 6 | namespace MatoProductivity.EntityFrameworkCore 7 | { 8 | public class MatoProductivityDbContext : AbpDbContext 9 | { 10 | //Add DbSet properties for your entities... 11 | 12 | public DbSet Note { get; set; } 13 | public DbSet NoteGroup { get; set; } 14 | public DbSet NoteSegment { get; set; } 15 | public DbSet NoteSegmentStore { get; set; } 16 | public DbSet NoteSegmentPayload { get; set; } 17 | public DbSet NoteTemplate { get; set; } 18 | public DbSet NoteSegmentTemplate { get; set; } 19 | public DbSet NoteSegmentTemplatePayload { get; set; } 20 | public DbSet Theme { get; set; } 21 | public DbSet Setting { get; set; } 22 | public MatoProductivityDbContext(DbContextOptions options) 23 | : base(options) 24 | { 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location/IPGecodeLocation.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace MatoProductivity.Core.Location 4 | { 5 | public class IPGecodeLocation 6 | { 7 | /// 8 | /// IP地址 9 | /// 10 | public string IpAddress { get; set; } 11 | /// 12 | /// 定位坐标 13 | /// 14 | public Location Location { get; set; } = new Location(); 15 | /// 16 | /// 国家 17 | /// 18 | public string Country { get; set; } 19 | /// 20 | /// 城市 21 | /// 22 | public string City { get; set; } 23 | /// 24 | /// 省份 25 | /// 26 | public string Province { get; set; } 27 | /// 28 | /// 区县 29 | /// 30 | public string District { get; set; } 31 | /// 32 | /// adcode 33 | /// 34 | public string AdCode { get; set; } 35 | 36 | public IDictionary Additionals { get; } = new Dictionary(); 37 | 38 | public void AddAdditional(string key, object value) 39 | { 40 | Additionals.Add(key, value); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 11 | 13 | 15 | 16 | 18 | 20 | 21 | 23 | 25 | 26 | 28 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/MatoProductivity.EntityFrameworkCore/Migrations/20240101114512_v0.1.3.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace MatoProductivity.EntityFrameworkCore.Migrations 6 | { 7 | /// 8 | public partial class v013 : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.AddColumn( 14 | name: "CanSimplified", 15 | table: "NoteTemplate", 16 | type: "INTEGER", 17 | nullable: false, 18 | defaultValue: false); 19 | 20 | migrationBuilder.AddColumn( 21 | name: "CanSimplified", 22 | table: "Note", 23 | type: "INTEGER", 24 | nullable: false, 25 | defaultValue: false); 26 | } 27 | 28 | /// 29 | protected override void Down(MigrationBuilder migrationBuilder) 30 | { 31 | migrationBuilder.DropColumn( 32 | name: "CanSimplified", 33 | table: "NoteTemplate"); 34 | 35 | migrationBuilder.DropColumn( 36 | name: "CanSimplified", 37 | table: "Note"); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/NoteSegmentDataTemplateSelector.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Models.Entities; 3 | using MatoProductivity.Core.Services; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace MatoProductivity.Core.Views 11 | { 12 | public class NoteSegmentDataTemplateSelector : DataTemplateSelector 13 | { 14 | 15 | public object ResourcesContainer { get; set; } 16 | 17 | protected override DataTemplate OnSelectTemplate(object item, BindableObject container) 18 | { 19 | if (item == null) 20 | { 21 | return default; 22 | } 23 | if (item is INoteSegmentService) 24 | { 25 | var dataTemplateName = (item as INoteSegmentService).NoteSegment.Type; 26 | if (dataTemplateName == null) { return default; } 27 | if (ResourcesContainer == null) 28 | { 29 | return Application.Current.Resources[dataTemplateName] as DataTemplate; 30 | } 31 | return (ResourcesContainer as VisualElement).Resources[dataTemplateName] as DataTemplate; 32 | 33 | } 34 | return default; 35 | 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/libs/QWeatherAPI/Result/GeoAPI/CityLookup/GeoResult.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace QWeatherAPI.Result.GeoAPI.CityLookup 9 | { 10 | public class GeoResult 11 | { 12 | /// 13 | /// API 状态码 14 | /// 15 | public string Code; 16 | /// 17 | /// 位置搜索结果 18 | /// 19 | public Location[] Locations = new Location[0]; 20 | 21 | /// 22 | /// 构造地理位置 API 返回结果 23 | /// 24 | /// 25 | /// 26 | public GeoResult(string jsonString) 27 | { 28 | JObject jsonData = JObject.Parse(jsonString); 29 | this.Code = jsonData.Value("code"); 30 | if (this.Code != "200") { throw new ArgumentException(this.Code); } 31 | foreach (JToken location in jsonData.SelectToken("location")) 32 | { 33 | var locationList = this.Locations.ToList(); 34 | locationList.Add(new Location(location)); 35 | this.Locations = locationList.ToArray(); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/libs/AipSdk/Baidu/Aip/AipException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Baidu, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | 14 | using System; 15 | 16 | namespace Baidu.Aip 17 | { 18 | /// 19 | /// 百度AI异常类 20 | /// 21 | [Serializable] 22 | public class AipException : Exception 23 | { 24 | public AipException() 25 | { 26 | Code = -1; 27 | } 28 | 29 | public AipException(string message) : base(message) 30 | { 31 | } 32 | 33 | public AipException(int code, string message) : base(message) 34 | { 35 | Code = code; 36 | } 37 | 38 | public int Code { get; set; } 39 | 40 | public static AipException TokenException(string message) 41 | { 42 | return new AipException("Token request failed! " + message); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/libs/QWeatherAPI/Result/WeatherWarning/WarningResult.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace QWeatherAPI.Result.WeatherWarning 9 | { 10 | public struct WarningResult 11 | { 12 | /// 13 | /// API 状态码,具体含义请参考状态码 14 | /// 15 | public string Code; 16 | /// 17 | /// 当前 API 的最近更新时间 18 | /// 19 | public string UpdateTime; 20 | /// 21 | /// 当前数据的响应式页面,便于嵌入网站或应用 22 | /// 23 | public string FxLink; 24 | /// 25 | /// 预警信息 26 | /// 27 | public Warning[] Warning; 28 | 29 | public WarningResult(string jsonString) 30 | { 31 | JObject jsonData = JObject.Parse(jsonString); 32 | Code = jsonData.Value("code"); 33 | UpdateTime = jsonData.Value("updateTime"); 34 | FxLink = jsonData.Value("fxLink"); 35 | List warnings = new List(); 36 | foreach (var warning in jsonData.SelectToken("warning")) 37 | { 38 | warnings.Add(new Warning(warning)); 39 | } 40 | Warning = warnings.ToArray(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/libs/QWeatherAPI/Result/WeatherDailyForecast/WeatherResult.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace QWeatherAPI.Result.WeatherDailyForecast 9 | { 10 | public class WeatherResult 11 | { 12 | /// 13 | /// API 状态码 14 | /// 15 | public string Code; 16 | /// 17 | /// API 状态最近更新时间 18 | /// 19 | public string UpdateTime; 20 | /// 21 | /// 当前数据的响应式页面,便于嵌入网站或应用 22 | /// 23 | public string FxLink; 24 | /// 25 | /// 逐天天气预报 26 | /// 27 | public Daily[] Daily = new Daily[0]; 28 | 29 | internal WeatherResult(string jsonString) 30 | { 31 | JObject jsonData = JObject.Parse(jsonString); 32 | Code = jsonData.Value("code"); 33 | UpdateTime = jsonData.Value("updateTime"); 34 | FxLink = jsonData.Value("fxLink"); 35 | foreach (var item in jsonData.SelectToken("daily")) 36 | { 37 | var dailyList = this.Daily.ToList(); 38 | dailyList.Add(new Daily(item)); 39 | this.Daily = dailyList.ToArray(); 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location.Amap/AmapLocationResolveProvider.cs: -------------------------------------------------------------------------------- 1 | using MatoProductivity.Core.Location; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using System.Threading.Tasks; 4 | 5 | namespace MatoProductivity.Core.Amap 6 | { 7 | public class AmapLocationResolveProvider : ILocationResolveProvider 8 | { 9 | protected AmapHttpRequestClient AmapHttpRequestClient { get; } 10 | 11 | public AmapLocationResolveProvider(AmapHttpRequestClient amapHttpRequestClient) 12 | { 13 | AmapHttpRequestClient = amapHttpRequestClient; 14 | } 15 | 16 | public async Task ReGeocodeAsync(double lat, double lng, int radius = 50) 17 | { 18 | var inverseRequestPramter = new AmapInverseHttpRequestParamter(); 19 | inverseRequestPramter.Locations = new Location.Location[1] 20 | { 21 | new Location.Location(lat, lng) 22 | }; 23 | return await AmapHttpRequestClient.InverseAsync(inverseRequestPramter); 24 | } 25 | 26 | public async Task GeocodeAsync(string address, string city) 27 | { 28 | var positiceRequestParamter = new AmapPositiveHttpRequestParamter 29 | { 30 | Address = address 31 | }; 32 | return await AmapHttpRequestClient.PositiveAsync(positiceRequestParamter); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/MatoProductivity.EntityFrameworkCore/EntityFrameworkCore/MatoProductivityDbContextFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using MatoProductivity.Core; 5 | using MatoProductivity.Core.Configuration; 6 | using Microsoft.EntityFrameworkCore; 7 | using Microsoft.EntityFrameworkCore.Design; 8 | using Microsoft.Extensions.Configuration; 9 | 10 | namespace MatoProductivity.EntityFrameworkCore 11 | { 12 | /* This class is needed to run EF Core PMC commands. Not used anywhere else */ 13 | public class MatoProductivityDbContextFactory : IDesignTimeDbContextFactory 14 | { 15 | public MatoProductivityDbContext CreateDbContext(string[] args) 16 | { 17 | var sqliteFilename = "mato.db"; 18 | string documentsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), sqliteFilename); 19 | var builder = new DbContextOptionsBuilder(); 20 | var hostFolder = Path.Combine(Environment.CurrentDirectory, "bin", "Debug", "net8.0"); 21 | 22 | var configuration = AppConfigurations.Get(hostFolder); 23 | DbContextOptionsConfigurer.Configure( 24 | builder, 25 | configuration.GetConnectionString(MatoProductivityConsts.ConnectionStringName) 26 | ); 27 | 28 | return new MatoProductivityDbContext(builder.Options); 29 | 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/libs/QWeatherAPI/Result/RealTimeWeather/WeatherResult.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace QWeatherAPI.Result.RealTimeWeather 9 | { 10 | public class WeatherResult 11 | { 12 | /// 13 | /// API 状态码 14 | /// 15 | public string Code; 16 | /// 17 | /// API 最近更新时间 18 | /// 19 | public string UpdateTime; 20 | /// 21 | /// 当前数据的响应式页面,便于嵌入网站或应用 22 | /// 23 | public string FxLink; 24 | /// 25 | /// 天气数据 26 | /// 27 | public Now Now; 28 | 29 | /// 30 | /// 构造当前天气 API 返回结果 31 | /// 32 | /// 33 | /// 34 | public WeatherResult(string jsonString) 35 | { 36 | JObject jsonData = JObject.Parse(jsonString); 37 | this.Code = jsonData.Value("code"); 38 | if (this.Code != "200") { throw new ArgumentException(this.Code); } 39 | this.UpdateTime = jsonData.Value("updateTime"); 40 | this.FxLink = jsonData.Value("fxLink"); 41 | this.Now = new Now(jsonData.SelectToken("now")); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Configuration/AppConfigurations.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | using Abp.Extensions; 3 | using Microsoft.Extensions.Configuration; 4 | 5 | namespace MatoProductivity.Core.Configuration 6 | { 7 | public static class AppConfigurations 8 | { 9 | private static readonly ConcurrentDictionary ConfigurationCache; 10 | 11 | static AppConfigurations() 12 | { 13 | ConfigurationCache = new ConcurrentDictionary(); 14 | } 15 | 16 | public static IConfigurationRoot Get(string path, string environmentName = null) 17 | { 18 | var cacheKey = path + "#" + environmentName; 19 | return ConfigurationCache.GetOrAdd( 20 | cacheKey, 21 | _ => BuildConfiguration(path, environmentName) 22 | ); 23 | } 24 | 25 | private static IConfigurationRoot BuildConfiguration(string path, string environmentName = null) 26 | { 27 | var builder = new ConfigurationBuilder() 28 | .SetBasePath(path) 29 | .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); 30 | 31 | if (!environmentName.IsNullOrWhiteSpace()) 32 | { 33 | builder = builder.AddJsonFile($"appsettings.{environmentName}.json", optional: true); 34 | } 35 | 36 | builder = builder.AddEnvironmentVariables(); 37 | 38 | return builder.Build(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location.Amap/AmapPositiveHttpRequestParamter.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace MatoProductivity.Core.Amap 4 | { 5 | /// 6 | /// 高德地图正地址解析请求参数 7 | /// 8 | public class AmapPositiveHttpRequestParamter 9 | { 10 | /// 11 | /// 结构化的地址 12 | /// 规则遵循:国家、省份、城市、区县、城镇、乡村、街道、门牌号码、屋邨、大厦,如:北京市朝阳区阜通东大街6号。 13 | /// 如果需要解析多个地址的话,请用"|"进行间隔,并且将 batch 参数设置为 true,最多支持 10 个地址进进行"|"分割形式的请求 14 | /// 15 | [NotNull] 16 | public string Address { get; set; } 17 | /// 18 | /// 城市 19 | /// 可选输入内容包括:指定城市的中文(如北京)、指定城市的中文全拼(beijing)、citycode(010)、adcode(110000),不支持县级市。 20 | /// 当指定城市查询内容为空时,会进行全国范围内的地址转换检索。 21 | /// 22 | [CanBeNull] 23 | public string City { get; set; } 24 | /// 25 | /// 批量查询控制 26 | /// batch 参数设置为 true 时进行批量查询操作,最多支持 10 个地址进行批量查询。 27 | /// batch 参数设置为 false 时进行单点查询,此时即使传入多个地址也只返回第一个地址的解析查询结果 28 | /// 29 | [CanBeNull] 30 | public bool Batch { get; set; } = false; 31 | /// 32 | /// 数字签名 33 | /// 34 | [CanBeNull] 35 | 36 | public string Sig { get; set; } 37 | /// 38 | /// 返回数据格式类型 39 | /// 可选输入内容包括:JSON,XML。设置 JSON 返回结果数据将会以JSON结构构成; 40 | /// 如果设置 XML 返回结果数据将以 XML 结构构成。 41 | /// 42 | [CanBeNull] 43 | public string Output { get; set; } = "JSON"; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/MatoProductivity/Helper/GeoLocationHelper.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 MatoProductivity.Helper 8 | { 9 | public class GeoLocationHelper 10 | { 11 | public static async Task GetNativePosition() 12 | { 13 | 14 | try 15 | { 16 | var request = new GeolocationRequest(GeolocationAccuracy.Medium); 17 | var location = await Geolocation.Default.GetLocationAsync(request); 18 | 19 | if (location != null) 20 | { 21 | Console.WriteLine($"Latitude: {location.Latitude}, Longitude: {location.Longitude}, Altitude: {location.Altitude}"); 22 | return location; 23 | } 24 | } 25 | catch (FeatureNotSupportedException fnsEx) 26 | { 27 | CommonHelper.ShowNoAuthorized("请在设置中开启位置的访问权限"); 28 | } 29 | catch (FeatureNotEnabledException fneEx) 30 | { 31 | CommonHelper.ShowNoAuthorized("当您的网络信号或GPS信号弱的时候,我们无法获取您的位置信息"); 32 | } 33 | catch (PermissionException pEx) 34 | { 35 | CommonHelper.ShowNoAuthorized("请在设置中开启位置的访问权限"); 36 | } 37 | catch (Exception ex) 38 | { 39 | // Unable to get location 40 | } 41 | return null; 42 | 43 | } 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/Bool2StringConverter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Maui.Controls; 2 | using System; 3 | using System.Globalization; 4 | 5 | namespace MatoProductivity.Converter 6 | { 7 | public class Bool2StringConverter : IValueConverter 8 | { 9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 10 | { 11 | try 12 | { 13 | if (string.IsNullOrEmpty((string)parameter)) 14 | { 15 | parameter = "是|否"; 16 | } 17 | var str1 = (parameter as string).Split('|')[0]; 18 | var str2 = (parameter as string).Split('|')[1]; 19 | 20 | if (value is bool) 21 | { 22 | return (bool)value ? str1 : str2; 23 | } 24 | else 25 | { 26 | string status = value.ToString().ToUpper(); 27 | if (status.Equals("TRUE")) 28 | { 29 | return str1; 30 | } 31 | else 32 | { 33 | return str2; 34 | } 35 | } 36 | } 37 | catch (Exception ex) 38 | { 39 | return string.Empty; 40 | } 41 | 42 | } 43 | 44 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 45 | { 46 | throw new NotImplementedException(); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/NoteListPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Models.Entities; 3 | using MatoProductivity.ViewModels; 4 | 5 | namespace MatoProductivity.Views; 6 | 7 | public partial class NoteListPage : ContentPageBase, ISingletonDependency 8 | { 9 | private NoteListPageViewModel noteListPageViewModel => this.BindingContext as NoteListPageViewModel; 10 | 11 | public NoteListPage(NoteListPageViewModel noteListPageViewModel) 12 | { 13 | InitializeComponent(); 14 | this.BindingContext = noteListPageViewModel; 15 | this.Load(); 16 | 17 | } 18 | 19 | 20 | private async void Button_Clicked(object sender, EventArgs e) 21 | { 22 | await navigationService.ShowPopupAsync((this.Resources["PopupMenu"] as PopupBase)); 23 | } 24 | 25 | private async void ContentPageBase_Loaded(object sender, EventArgs e) 26 | { 27 | 28 | } 29 | 30 | private async void Load() 31 | { 32 | await noteListPageViewModel.Init(); 33 | 34 | } 35 | 36 | private void SwipeView_SwipeStarted(object sender, SwipeStartedEventArgs e) 37 | { 38 | noteListPageViewModel.SetIsUsingContextMenu(true); 39 | } 40 | 41 | private void SwipeView_SwipeEnded(object sender, SwipeEndedEventArgs e) 42 | { 43 | if (!e.IsOpen) 44 | { 45 | noteListPageViewModel.SetIsUsingContextMenu(false); 46 | 47 | } 48 | 49 | } 50 | 51 | private void SwipeItemView_Invoked(object sender, EventArgs e) 52 | { 53 | noteListPageViewModel.SetIsUsingContextMenu(false); 54 | 55 | } 56 | } -------------------------------------------------------------------------------- /src/libs/AipSdk/Baidu/Aip/ContentCensor/AntiTerror.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Baidu, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | 14 | using System; 15 | using Newtonsoft.Json.Linq; 16 | 17 | namespace Baidu.Aip.ContentCensor 18 | { 19 | /// 20 | /// 暴恐 21 | /// 22 | public class AntiTerror : Base 23 | { 24 | public const string ANTI_TERROR = "https://aip.baidubce.com/rest/2.0/antiterror/v1/detect"; 25 | 26 | public AntiTerror(string apiKey, string secretKey) : base(apiKey, secretKey) 27 | { 28 | } 29 | 30 | /// 31 | /// 暴恐识别 32 | /// 33 | /// 图像字节数组 34 | /// 35 | public JObject Detect(byte[] image) 36 | { 37 | CheckNotNull(image, "image"); 38 | PreAction(); 39 | var aipReq = DefaultRequest(ANTI_TERROR); 40 | aipReq.Bodys.Add("image", Convert.ToBase64String(image)); 41 | return PostAction(aipReq); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/IsValid2BoolConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using Microsoft.Maui.Controls; 9 | 10 | namespace MatoProductivity.Converter 11 | { 12 | public class IsValid2BoolConverter : IValueConverter 13 | { 14 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 15 | { 16 | var result = false; 17 | 18 | if (value != null) 19 | { 20 | if (value is string) 21 | { 22 | result = 23 | !string.IsNullOrEmpty(value as string); 24 | } 25 | else if (value is ICollection) 26 | { 27 | result = 28 | (value as ICollection).Count != 0; 29 | } 30 | else 31 | { 32 | result = true; 33 | } 34 | } 35 | 36 | if (parameter!=null) 37 | { 38 | var isInvert = bool.Parse(parameter as string); 39 | if (isInvert) 40 | { 41 | result=!result; 42 | } 43 | } 44 | return result; 45 | } 46 | 47 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 48 | { 49 | throw new NotImplementedException(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Models/Entities/Note.cs: -------------------------------------------------------------------------------- 1 | using Abp.Domain.Entities.Auditing; 2 | using AutoMapper.Configuration.Annotations; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations; 6 | using System.ComponentModel.DataAnnotations.Schema; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace MatoProductivity.Core.Models.Entities 12 | { 13 | public class Note : FullAuditedEntity 14 | { 15 | public Note() 16 | { 17 | 18 | } 19 | public Note(string name, bool isHidden, bool isRemovable) 20 | { 21 | Title = name; 22 | IsHidden = isHidden; 23 | IsRemovable = isRemovable; 24 | } 25 | 26 | 27 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] 28 | public override long Id { get; set; } 29 | 30 | public ICollection NoteSegments { get; set; } 31 | 32 | public string Title { get; set; } 33 | public string Type { get; set; } 34 | public string Status { get; set; } 35 | public string Desc { get; set; } 36 | public string Icon { get; set; } 37 | public string Color { get; set; } 38 | public string BackgroundColor { get; set; } 39 | public string BackgroundImage { get; set; } 40 | 41 | public string PreViewContent { get; set; } 42 | 43 | public bool IsEditable { get; set; } 44 | 45 | public bool IsHidden { get; set; } 46 | 47 | public bool IsRemovable { get; set; } 48 | public bool CanSimplified { get; set; } 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/LocationSelectingPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Models.Entities; 3 | using MatoProductivity.ViewModels; 4 | 5 | namespace MatoProductivity.Core.Views; 6 | 7 | public partial class LocationSelectingPage : PopupBase, ITransientDependency 8 | { 9 | private LocationSelectingPageViewModel LocationSelectingPageViewModel => this.BindingContext as LocationSelectingPageViewModel; 10 | 11 | public LocationSelectingPage(LocationSelectingPageViewModel locationSelectingPageViewModel) 12 | { 13 | InitializeComponent(); 14 | this.BindingContext = locationSelectingPageViewModel; 15 | 16 | rootComponent.Parameters = 17 | new Dictionary 18 | { 19 | { "LocationSelectingPageViewModel", LocationSelectingPageViewModel } 20 | }; 21 | } 22 | 23 | private async void PopupBase_Opened(object sender, CommunityToolkit.Maui.Core.PopupOpenedEventArgs e) 24 | { 25 | } 26 | 27 | private void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e) 28 | { 29 | this.ContentFrame.IsVisible=true; 30 | this.ContentButton.IsVisible=false; 31 | this.ContentLabel.IsVisible=false; 32 | 33 | } 34 | 35 | private void Entry_Completed(object sender, EventArgs e) 36 | { 37 | EditDone(); 38 | } 39 | 40 | 41 | private void Entry_Unfocused(object sender, FocusEventArgs e) 42 | { 43 | EditDone(); 44 | 45 | } 46 | private void EditDone() 47 | { 48 | this.ContentFrame.IsVisible=false; 49 | this.ContentButton.IsVisible=true; 50 | this.ContentLabel.IsVisible=true; 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/AnyTrueMultiConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace MatoProductivity.Converter 9 | { 10 | public class AnyTrueMultiConverter : IMultiValueConverter 11 | { 12 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 13 | { 14 | if (values == null || !targetType.IsAssignableFrom(typeof(bool))) 15 | { 16 | return false; 17 | // Alternatively, return BindableProperty.UnsetValue to use the binding FallbackValue 18 | } 19 | 20 | foreach (var value in values) 21 | { 22 | if (value is bool&&(bool)value) 23 | { 24 | return true; 25 | } 26 | 27 | } 28 | return false; 29 | } 30 | 31 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 32 | { 33 | if (!(value is bool b) || targetTypes.Any(t => !t.IsAssignableFrom(typeof(bool)))) 34 | { 35 | // Return null to indicate conversion back is not possible 36 | return null; 37 | } 38 | 39 | if (b) 40 | { 41 | return targetTypes.Select(t => (object)true).ToArray(); 42 | } 43 | else 44 | { 45 | // Can't convert back from false because of ambiguity 46 | return null; 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/libs/QWeatherAPI/Result/WeatherHourlyForecast/WeatherResult.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace QWeatherAPI.Result.WeatherHourlyForecast 9 | { 10 | public class WeatherResult 11 | { 12 | /// 13 | /// API 状态码 14 | /// 15 | public string Code; 16 | /// 17 | /// API 状态最近更新时间 18 | /// 19 | public string UpdateTime; 20 | /// 21 | /// 当前数据的响应式页面,便于嵌入网站或应用 22 | /// 23 | public string FxLink; 24 | /// 25 | /// 24 小时预报结果 26 | /// 27 | public Hourly[] Hourly = new Hourly[0]; 28 | 29 | /// 30 | /// 构造 24 天气预报 API 返回结果 31 | /// 32 | /// 33 | /// 34 | public WeatherResult(string jsonString) 35 | { 36 | JObject jsonData = JObject.Parse(jsonString); 37 | this.Code = jsonData.Value("code"); 38 | if (this.Code != "200") { throw new ArgumentException(this.Code); } 39 | this.UpdateTime = jsonData.Value("updateTime"); 40 | this.FxLink = jsonData.Value("fxLink"); 41 | foreach (var item in jsonData.SelectToken("hourly")) 42 | { 43 | var hourlyList = this.Hourly.ToList(); 44 | hourlyList.Add(new Hourly(item)); 45 | this.Hourly = hourlyList.ToArray(); 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using Abp.Events.Bus; 3 | using MatoProductivity.Core.Models; 4 | using MatoProductivity.Views; 5 | 6 | namespace MatoProductivity; 7 | 8 | public partial class MainPage : Shell, ITransientDependency 9 | { 10 | private readonly IocManager iocManager; 11 | private readonly IEventBus eventBus; 12 | 13 | public MainPage(IocManager iocManager, IEventBus eventBus) 14 | { 15 | InitializeComponent(); 16 | this.iocManager = iocManager; 17 | this.eventBus = eventBus; 18 | Loaded += MainPage_Loaded; 19 | this.Init(); 20 | } 21 | 22 | private async void MainPage_Loaded(object sender, EventArgs e) 23 | { 24 | this.eventBus.AsyncRegister(NotificationInvokedAction); 25 | } 26 | 27 | private async Task NotificationInvokedAction(NotificationEto arg) 28 | { 29 | MainThread.BeginInvokeOnMainThread(async () => 30 | { 31 | var title = arg.Args.NotificationTitle; 32 | var content = arg.Args.NotificationContent; 33 | await DisplayAlert(title, content, "OK"); 34 | }); 35 | 36 | } 37 | 38 | private void Init() 39 | { 40 | var noteTemplatePage = iocManager.Resolve(); 41 | this.NoteTemplateContent.Content = noteTemplatePage; 42 | 43 | var notePage = iocManager.Resolve(); 44 | this.NoteContent.Content = notePage; 45 | 46 | var statisticPage = iocManager.Resolve(); 47 | this.StatisticContent.Content = statisticPage; 48 | 49 | var userProfilePage = iocManager.Resolve(); 50 | this.UserProfileContent.Content = userProfilePage; 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Models/Entities/NoteTemplate.cs: -------------------------------------------------------------------------------- 1 | using Abp.AutoMapper; 2 | using Abp.Domain.Entities.Auditing; 3 | using AutoMapper.Configuration.Annotations; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.ComponentModel.DataAnnotations; 7 | using System.ComponentModel.DataAnnotations.Schema; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading.Tasks; 11 | 12 | namespace MatoProductivity.Core.Models.Entities 13 | { 14 | [AutoMap(typeof(Note))] 15 | public class NoteTemplate : FullAuditedEntity 16 | { 17 | public NoteTemplate() 18 | { 19 | 20 | } 21 | public NoteTemplate(string name, bool isHidden, bool isRemovable) 22 | { 23 | Title = name; 24 | IsHidden = isHidden; 25 | IsRemovable = isRemovable; 26 | } 27 | 28 | [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] 29 | public override long Id { get; set; } 30 | 31 | public ICollection NoteSegmentTemplates { get; set; } 32 | 33 | public string Title { get; set; } 34 | public string Type { get; set; } 35 | public string Status { get; set; } 36 | public string Desc { get; set; } 37 | public string Icon { get; set; } 38 | public string Color { get; set; } 39 | public string BackgroundColor { get; set; } 40 | public string BackgroundImage { get; set; } 41 | 42 | public string PreViewContent { get; set; } 43 | 44 | public bool IsEditable { get; set; } 45 | 46 | public bool IsHidden { get; set; } 47 | 48 | public bool IsRemovable { get; set; } 49 | 50 | public bool CanSimplified { get; set; } 51 | 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/EditNotePage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.ViewModels; 3 | using Microsoft.Maui.Handlers; 4 | using System.Collections.Specialized; 5 | 6 | namespace MatoProductivity.Views; 7 | 8 | public partial class EditNotePage : ContentPageBase, ITransientDependency 9 | { 10 | private EditNotePageViewModel editNotePageViewModel => this.BindingContext as EditNotePageViewModel; 11 | 12 | public EditNotePage(EditNotePageViewModel editNotePageViewModel) 13 | { 14 | InitializeComponent(); 15 | this.BindingContext = editNotePageViewModel; 16 | } 17 | 18 | 19 | public EditNotePage(EditNotePageViewModel editNotePageViewModel, long NoteId) : this(editNotePageViewModel) 20 | { 21 | this.editNotePageViewModel.NoteId = NoteId; 22 | 23 | } 24 | 25 | 26 | public EditNotePage(EditNotePageViewModel editNotePageViewModel, long NoteId, long NoteTemplateId) : this(editNotePageViewModel, NoteId) 27 | { 28 | editNotePageViewModel.Clone.Execute(NoteTemplateId); 29 | 30 | } 31 | 32 | private void OnFavoriteSwipeItemInvoked(object sender, EventArgs e) 33 | { 34 | 35 | } 36 | 37 | private void OnDeleteSwipeItemInvoked(object sender, EventArgs e) 38 | { 39 | 40 | } 41 | 42 | private void DragGestureRecognizer_DragStarting_Collection(object sender, DragStartingEventArgs e) 43 | { 44 | 45 | } 46 | 47 | private void Button_Clicked(object sender, EventArgs e) 48 | { 49 | 50 | } 51 | 52 | private void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e) 53 | { 54 | 55 | } 56 | 57 | protected override bool OnBackButtonPressed() 58 | { 59 | editNotePageViewModel.SubmitBack.Execute(null); 60 | return true; 61 | } 62 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Views/PrivacyPolicyPage.xaml: -------------------------------------------------------------------------------- 1 | 7 | 9 | 10 | 13 | 14 | 15 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/MatoProductivity/ViewModels/AboutMePageViewModel.cs: -------------------------------------------------------------------------------- 1 | using Abp.Collections.Extensions; 2 | using Abp.Dependency; 3 | using Abp.Domain.Repositories; 4 | using Abp.Extensions; 5 | using MatoProductivity.Core.Models.Entities; 6 | using MatoProductivity.Core.ViewModels; 7 | using MatoProductivity.Helper; 8 | using MatoProductivity.Services; 9 | using MatoProductivity.Views; 10 | using Microsoft.Maui.ApplicationModel; 11 | using System; 12 | using System.Collections.ObjectModel; 13 | using System.Collections.Specialized; 14 | using System.Runtime.CompilerServices; 15 | 16 | namespace MatoProductivity.ViewModels 17 | { 18 | public class AboutMePageViewModel : PopupViewModelBase, ISingletonDependency 19 | { 20 | private readonly NavigationService navigationService; 21 | 22 | public AboutMePageViewModel( 23 | NavigationService navigationService 24 | ) 25 | { 26 | this.GoUriCommand = new Command(GoUriAction); 27 | this.Back = new Command(BackAction); 28 | 29 | this.navigationService = navigationService; 30 | } 31 | 32 | private async void GoUriAction(object obj) 33 | { 34 | await CommonHelper.GoUri(obj); 35 | } 36 | private async void BackAction(object obj) 37 | { 38 | await this.navigationService.PopAsync(); 39 | } 40 | protected override void SetSize(DisplayInfo displayInfo) 41 | { 42 | var newWidth = displayInfo.Width*0.8; 43 | var newHeight = 800; 44 | 45 | var d = displayInfo.Density; 46 | PopupSize=new Size(newWidth/d, newHeight/d); 47 | } 48 | 49 | public Command GoUriCommand { get; set; } 50 | public Command Back { get; set; } 51 | 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/MatoProductivity/Controls/IsDoneToggleButton.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using System.Runtime.CompilerServices; 3 | 4 | namespace MatoProductivity.Core.Controls; 5 | 6 | public partial class IsDoneToggleButton : ContentView 7 | { 8 | public event EventHandler Toggled; 9 | 10 | public IsDoneToggleButton() 11 | { 12 | InitializeComponent(); 13 | SetIsToggled(IsToggled); 14 | } 15 | 16 | public static readonly BindableProperty IsToggledProperty = 17 | BindableProperty.Create("IsToggled", typeof(bool), typeof(IsDoneToggleButton), false, propertyChanged: (bindable, oldValue, newValue) => 18 | { 19 | var obj = (IsDoneToggleButton)bindable; 20 | obj.SetIsToggled(obj.IsToggled); 21 | 22 | }); 23 | 24 | public bool IsToggled 25 | { 26 | get { return (bool)GetValue(IsToggledProperty); } 27 | set { SetValue(IsToggledProperty, value); } 28 | } 29 | 30 | public static readonly BindableProperty IsReadOnlyProperty = 31 | BindableProperty.Create("IsReadOnly", typeof(bool), typeof(IsDoneToggleButton), false); 32 | 33 | public bool IsReadOnly 34 | { 35 | get { return (bool)GetValue(IsReadOnlyProperty); } 36 | set { SetValue(IsReadOnlyProperty, value); } 37 | } 38 | 39 | private void SetIsToggled(bool isChecked) 40 | { 41 | string visualState = isChecked ? "Checked" : "Unchecked"; 42 | VisualStateManager.GoToState(MainBorder, visualState); 43 | } 44 | 45 | private void TapGestureRecognizer_OnTapped(object sender, TappedEventArgs e) 46 | { 47 | if (!IsReadOnly) 48 | { 49 | this.IsToggled=!this.IsToggled; 50 | this.Toggled?.Invoke(this, new ToggledEventArgs(IsToggled)); 51 | } 52 | 53 | } 54 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Windows/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | 15 | MatoProductivity 16 | Microsoft 17 | Assets\appiconStoreLogo.png 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 39 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/libs/Plugin.Maui.Audio/AudioPlayer/AsyncAudioPlayer.shared.cs: -------------------------------------------------------------------------------- 1 | namespace Plugin.Maui.Audio; 2 | 3 | /// 4 | /// Provides async/await support by wrapping an . 5 | /// 6 | public class AsyncAudioPlayer 7 | { 8 | readonly IAudioPlayer audioPlayer; 9 | CancellationTokenSource? stopCancellationToken; 10 | 11 | /// 12 | /// Creates a new instance of . 13 | /// This is particularly useful if you want to customise the audio playback settings before playback. 14 | /// 15 | /// An implementation to act as the underlying mechanism of playing audio. 16 | public AsyncAudioPlayer(IAudioPlayer audioPlayer) 17 | { 18 | this.audioPlayer = audioPlayer; 19 | } 20 | 21 | /// 22 | /// Begin audio playback asynchronously. 23 | /// 24 | /// A to allow for canceling the audio playback. 25 | /// A that represents the asynchronous operation, awaiting this method will wait until the audio has finished playing before continuing. 26 | public async Task PlayAsync(CancellationToken cancellationToken) 27 | { 28 | var taskCompletionSource = new TaskCompletionSource(); 29 | 30 | stopCancellationToken = new(); 31 | 32 | audioPlayer.PlaybackEnded += (o, e) => taskCompletionSource.TrySetResult(); 33 | 34 | audioPlayer.Play(); 35 | 36 | await Task.WhenAny( 37 | taskCompletionSource.Task, 38 | cancellationToken.WhenCanceled(), 39 | stopCancellationToken.Token.WhenCanceled()); 40 | 41 | audioPlayer.Stop(); 42 | } 43 | 44 | /// 45 | /// Stops the currently playing audio. 46 | /// 47 | public void Stop() 48 | { 49 | stopCancellationToken?.Cancel(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location/Position.cs: -------------------------------------------------------------------------------- 1 | namespace MatoProductivity.Core.Location 2 | { 3 | /// 4 | /// 位置量 5 | /// 6 | public class Position 7 | { 8 | /// 9 | /// 左上纬度 10 | /// 11 | public double LeftTopLatitude { get; } 12 | /// 13 | /// 左上经度 14 | /// 15 | public double LeftTopLongitude { get; } 16 | /// 17 | /// 左下纬度 18 | /// 19 | public double LeftBottomLatitude { get; } 20 | /// 21 | /// 左下经度 22 | /// 23 | public double LeftBottomLongitude { get; } 24 | 25 | /// 26 | /// 右上纬度 27 | /// 28 | public double RightTopLatitude { get; } 29 | /// 30 | /// 右上经度 31 | /// 32 | public double RightTopLongitude { get; } 33 | /// 34 | /// 右下纬度 35 | /// 36 | public double RightBottomLatitude { get; } 37 | /// 38 | /// 右下经度 39 | /// 40 | public double RightBottomLongitude { get; } 41 | 42 | internal Position(double leftTopLat, double leftBottomLat, double leftTopLng, double leftBottomLng, 43 | double rightTopLat, double rightBottomLat, double rightTopLng, double rightBottomLng) 44 | { 45 | LeftTopLatitude = leftTopLat; 46 | LeftBottomLatitude = leftBottomLat; 47 | LeftTopLongitude = leftTopLng; 48 | LeftBottomLongitude = leftBottomLng; 49 | RightTopLatitude = rightTopLat; 50 | RightTopLongitude = rightTopLng; 51 | RightBottomLatitude = rightBottomLat; 52 | RightBottomLongitude = rightBottomLng; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/iOS/WeChat.cs: -------------------------------------------------------------------------------- 1 | using MatoProductivity.Core.WeChat; 2 | using WXApi_Api; 3 | using WXApiObject_Api; 4 | using WXApiObject_Scene = WXApiObject_Structs.WXScene; 5 | 6 | namespace MatoProductivity.Core.Platforms.Android 7 | { 8 | public class WeChat : IWeChat 9 | { 10 | public string Register(string appid = "") 11 | { 12 | var result = WXApi.RegisterApp(appid: appid, universalLink: ""); 13 | return result.ToString(); 14 | } 15 | 16 | public void _ShareTextTo(string msg, WXScene scene, string description) 17 | { 18 | int WXSceneValue = (int)WXApiObject_Scene.Session; 19 | switch (scene) 20 | { 21 | case WXScene.Timeline: 22 | WXSceneValue = (int)WXApiObject_Scene.Timeline; 23 | break; 24 | case WXScene.Favorite: 25 | WXSceneValue = (int)WXApiObject_Scene.Favorite; 26 | 27 | break; 28 | case WXScene.SceneSession: 29 | WXSceneValue = (int)WXApiObject_Scene.Session; 30 | 31 | break; 32 | default: 33 | break; 34 | } 35 | 36 | 37 | 38 | var req = new SendMessageToWXReq() 39 | { 40 | Scene = WXSceneValue, 41 | 42 | Text = msg, 43 | BText = true, 44 | }; 45 | WXApi.SendReq(req, isOK => 46 | { 47 | 48 | }); 49 | 50 | } 51 | 52 | public void ShareImageTo(byte[] image, WXScene scene) 53 | { 54 | throw new NotImplementedException(); 55 | } 56 | 57 | public void ShareTextTo(string text, WXScene scene) 58 | { 59 | this._ShareTextTo(text, scene, string.Empty); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/MatoProductivity/Converter/AllTrueMultiConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace MatoProductivity.Converter 9 | { 10 | public class AllTrueMultiConverter : IMultiValueConverter 11 | { 12 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 13 | { 14 | if (values == null || !targetType.IsAssignableFrom(typeof(bool))) 15 | { 16 | return false; 17 | // Alternatively, return BindableProperty.UnsetValue to use the binding FallbackValue 18 | } 19 | 20 | foreach (var value in values) 21 | { 22 | if (!(value is bool b)) 23 | { 24 | return false; 25 | // Alternatively, return BindableProperty.UnsetValue to use the binding FallbackValue 26 | } 27 | else if (!b) 28 | { 29 | return false; 30 | } 31 | } 32 | return true; 33 | } 34 | 35 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 36 | { 37 | if (!(value is bool b) || targetTypes.Any(t => !t.IsAssignableFrom(typeof(bool)))) 38 | { 39 | // Return null to indicate conversion back is not possible 40 | return null; 41 | } 42 | 43 | if (b) 44 | { 45 | return targetTypes.Select(t => (object)true).ToArray(); 46 | } 47 | else 48 | { 49 | // Can't convert back from false because of ambiguity 50 | return null; 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/MatoProductivity.EntityFrameworkCore/Migrations/20230506024959_v0.1.2.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace MatoProductivity.EntityFrameworkCore.Migrations 6 | { 7 | /// 8 | public partial class v012 : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.CreateTable( 14 | name: "NoteSegmentStore", 15 | columns: table => new 16 | { 17 | Id = table.Column(type: "INTEGER", nullable: false) 18 | .Annotation("Sqlite:Autoincrement", true), 19 | Title = table.Column(type: "TEXT", nullable: true), 20 | Type = table.Column(type: "TEXT", nullable: true), 21 | Category = table.Column(type: "TEXT", nullable: true), 22 | Status = table.Column(type: "TEXT", nullable: true), 23 | Desc = table.Column(type: "TEXT", nullable: true), 24 | Icon = table.Column(type: "TEXT", nullable: true), 25 | Color = table.Column(type: "TEXT", nullable: true), 26 | IsHidden = table.Column(type: "INTEGER", nullable: false), 27 | IsRemovable = table.Column(type: "INTEGER", nullable: false) 28 | }, 29 | constraints: table => 30 | { 31 | table.PrimaryKey("PK_NoteSegmentStore", x => x.Id); 32 | }); 33 | } 34 | 35 | /// 36 | protected override void Down(MigrationBuilder migrationBuilder) 37 | { 38 | migrationBuilder.DropTable( 39 | name: "NoteSegmentStore"); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/MatoProductivity/Core.Views/ScriptSegmentView.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.Core.Services; 3 | 4 | namespace MatoProductivity.Core.Views; 5 | public partial class ScriptSegmentView : ContentView, ITransientDependency 6 | { 7 | 8 | public ScriptSegmentView() 9 | { 10 | InitializeComponent(); 11 | HideCollectionViews(); 12 | Loaded+=ScriptSegmentView_Loaded; 13 | } 14 | 15 | private void ScriptSegmentView_Loaded(object sender, EventArgs e) 16 | { 17 | (BindingContext as ScriptSegmentService).GetImageSize=() => new Size(this.MainEditor.Width, this.MainEditor.Height); 18 | } 19 | 20 | private void DrawingLineSizeButton_Clicked(object sender, EventArgs e) 21 | { 22 | ColorCollectionView.IsVisible = false; 23 | DrawingLineSizeCollectionView.IsVisible = !DrawingLineSizeCollectionView.IsVisible; 24 | } 25 | 26 | private void LineColorButton_Clicked(object sender, EventArgs e) 27 | { 28 | DrawingLineSizeCollectionView.IsVisible = false; 29 | ColorCollectionView.IsVisible = !ColorCollectionView.IsVisible; 30 | 31 | } 32 | 33 | private void HideCollectionViews() 34 | { 35 | ColorCollectionView.IsVisible = false; 36 | DrawingLineSizeCollectionView.IsVisible = false; 37 | } 38 | 39 | private void Button_Clicked(object sender, EventArgs e) 40 | { 41 | HideCollectionViews(); 42 | 43 | } 44 | 45 | private void ExpandDrawingViewButton_Clicked(object sender, EventArgs e) 46 | { 47 | if (this.MainEditor.HeightRequest<900) 48 | { 49 | this.MainEditor.HeightRequest+=200; 50 | } 51 | } 52 | 53 | private void ShrinkDrawingViewButton_Clicked(object sender, EventArgs e) 54 | { 55 | if (this.MainEditor.HeightRequest>300) 56 | { 57 | this.MainEditor.HeightRequest-=200; 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Services/DateService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using MatoProductivity.Models; 5 | 6 | namespace MatoProductivity.Services 7 | { 8 | public class DateService: IDateService 9 | { 10 | public WeekModel GetWeek(DateTime date) 11 | { 12 | DayOfWeek firstDay = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek; 13 | DateTime firstDayInWeek = date.Date; 14 | while (firstDayInWeek.DayOfWeek != firstDay) 15 | firstDayInWeek = firstDayInWeek.AddDays(-1); 16 | var lastDayInWeek = firstDayInWeek.AddDays(6); 17 | return new WeekModel() 18 | { 19 | StartDay = firstDayInWeek, 20 | LastDay = lastDayInWeek, 21 | WeekString = firstDayInWeek.Month == lastDayInWeek.Month ? 22 | $"{firstDayInWeek.ToString("MMMM")} {firstDayInWeek.Day} - {lastDayInWeek.Day}" : 23 | $"{firstDayInWeek.ToString("MMMM")} {firstDayInWeek.Day} - {lastDayInWeek.ToString("MMMM")} {lastDayInWeek.Day}" 24 | }; 25 | } 26 | 27 | public List GetDayList(DateTime firstDayInWeek, DateTime lastDayInWeek) 28 | { 29 | List dayList = new List(); 30 | for (var i = 0; i < 7; i++) 31 | { 32 | var date = firstDayInWeek.AddDays(i); 33 | dayList.Add(new DayModel() 34 | { 35 | Date = date, 36 | Day = date.Day, 37 | DayName = date.ToString("ddd"), 38 | State = date.Date < DateTime.Now.Date ? DayStateEnum.Past : 39 | DayStateEnum.Normal, 40 | Column = i 41 | }); 42 | } 43 | return dayList; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/LoginPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Abp.Configuration; 3 | using Abp.Dependency; 4 | using MatoProductivity.Core.Settings; 5 | using MatoProductivity.Core.Views; 6 | using MatoProductivity.ViewModels; 7 | 8 | namespace MatoProductivity 9 | { 10 | public partial class LoginPage : PopupBase, ITransientDependency 11 | { 12 | private readonly IIocResolver iocResolver; 13 | private LoginPageViewModel LoginPageViewModel => this.BindingContext as LoginPageViewModel; 14 | 15 | public event EventHandler OnFinishedChooise; 16 | public LoginPage(IIocResolver iocResolver, LoginPageViewModel loginPageViewModel) 17 | { 18 | InitializeComponent(); 19 | this.BindingContext = loginPageViewModel; 20 | this.iocResolver=iocResolver; 21 | } 22 | 23 | private async void PopupBase_Opened(object sender, CommunityToolkit.Maui.Core.PopupOpenedEventArgs e) 24 | { 25 | } 26 | 27 | 28 | 29 | 30 | private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e) 31 | { 32 | using var objWrapper = iocResolver.ResolveAsDisposable(new { url = "https://blog.matoapp.net/apps/matoproductivity/license.html" }); 33 | await navigationService.ShowPopupAsync(objWrapper.Object); 34 | } 35 | 36 | private async void TapGestureRecognizer_Tapped_1(object sender, TappedEventArgs e) 37 | { 38 | using var objWrapper = iocResolver.ResolveAsDisposable(new { url = "https://blog.matoapp.net/apps/matoproductivity/privacy.html" }); 39 | await navigationService.ShowPopupAsync(objWrapper.Object); 40 | } 41 | 42 | private async void TapGestureRecognizer_Tapped_2(object sender, TappedEventArgs e) 43 | { 44 | await this.CloseAsync(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Android/MainApplication.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.App; 3 | using Android.Runtime; 4 | using Microsoft.Maui; 5 | using Microsoft.Maui.Hosting; 6 | 7 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 8 | [assembly: UsesPermission(Android.Manifest.Permission.ReadExternalStorage)] 9 | [assembly: UsesPermission(Android.Manifest.Permission.ReadMediaAudio)] 10 | [assembly: UsesPermission(Android.Manifest.Permission.ReadMediaImages)] 11 | [assembly: UsesPermission(Android.Manifest.Permission.ReadMediaVideo)] 12 | [assembly: UsesPermission(Android.Manifest.Permission.AccessFineLocation)] 13 | [assembly: UsesPermission(Android.Manifest.Permission.AccessCoarseLocation)] 14 | [assembly: UsesPermission(Android.Manifest.Permission.AccessBackgroundLocation)] 15 | // Needed for Taking photo/video 16 | [assembly: UsesPermission(Android.Manifest.Permission.Camera)] 17 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage, MaxSdkVersion = 32)] 18 | [assembly: UsesPermission(Android.Manifest.Permission.ReadContacts)] 19 | // Add these properties if you would like to filter out devices that do not have cameras, or set to false to make them optional 20 | [assembly: UsesFeature("android.hardware.camera", Required = true)] 21 | [assembly: UsesFeature("android.hardware.camera.autofocus", Required = true)] 22 | [assembly: UsesFeature("android.hardware.location", Required = false)] 23 | [assembly: UsesFeature("android.hardware.location.gps", Required = false)] 24 | [assembly: UsesFeature("android.hardware.location.network", Required = false)] 25 | 26 | 27 | namespace MatoProductivity 28 | { 29 | [Application] 30 | public class MainApplication : MauiApplication 31 | { 32 | public MainApplication(IntPtr handle, JniHandleOwnership ownership) 33 | : base(handle, ownership) 34 | { 35 | } 36 | 37 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 38 | } 39 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/MatoProductivity/ViewModels/PopupViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using Abp.Domain.Repositories; 3 | using Abp.Domain.Uow; 4 | using System.Reflection; 5 | using MatoProductivity.Core.Models.Entities; 6 | using MatoProductivity.Core.Services; 7 | using Microsoft.EntityFrameworkCore; 8 | using System.Collections.ObjectModel; 9 | using MatoProductivity.Services; 10 | using MatoProductivity.Views; 11 | using System.Drawing; 12 | using MatoProductivity.Core.ViewModels; 13 | using System.Runtime.CompilerServices; 14 | using Size = Microsoft.Maui.Graphics.Size; 15 | 16 | namespace MatoProductivity.ViewModels 17 | { 18 | public class PopupViewModelBase : ViewModelBase, IPopupViewModelBase 19 | { 20 | private readonly IDeviceDisplay deviceDisplay; 21 | public PopupViewModelBase() 22 | { 23 | this.deviceDisplay=DeviceDisplay.Current; 24 | this.deviceDisplay.MainDisplayInfoChanged+=DeviceDisplay_MainDisplayInfoChanged; 25 | var displayInfo = this.deviceDisplay.MainDisplayInfo; 26 | SetSize(displayInfo); 27 | } 28 | 29 | private void DeviceDisplay_MainDisplayInfoChanged(object sender, DisplayInfoChangedEventArgs e) 30 | { 31 | var displayInfo = e.DisplayInfo; 32 | // 新的宽度和高度 33 | SetSize(displayInfo); 34 | } 35 | 36 | protected virtual void SetSize(DisplayInfo displayInfo) 37 | { 38 | var newWidth = displayInfo.Width; 39 | var newHeight = displayInfo.Height*0.8; 40 | 41 | var d = displayInfo.Density; 42 | PopupSize=new Size(newWidth/d, newHeight/d); 43 | } 44 | 45 | private Size _popupSize; 46 | 47 | public Size PopupSize 48 | { 49 | get { return _popupSize; } 50 | set 51 | { 52 | _popupSize = value; 53 | RaisePropertyChanged(); 54 | 55 | } 56 | } 57 | 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/EditNoteTemplatePage.xaml.cs: -------------------------------------------------------------------------------- 1 | using Abp.Dependency; 2 | using MatoProductivity.ViewModels; 3 | using Microsoft.Maui.Handlers; 4 | 5 | namespace MatoProductivity.Views; 6 | 7 | public partial class EditNoteTemplatePage : ContentPageBase, ITransientDependency 8 | { 9 | private EditNoteTemplatePageViewModel editNoteTemplatePageViewModel => this.BindingContext as EditNoteTemplatePageViewModel; 10 | 11 | public EditNoteTemplatePage(EditNoteTemplatePageViewModel editNoteTemplatePageViewModel) 12 | { 13 | InitializeComponent(); 14 | this.BindingContext = editNoteTemplatePageViewModel; 15 | } 16 | 17 | 18 | public EditNoteTemplatePage(EditNoteTemplatePageViewModel editNoteTemplatePageViewModel, long NoteId) : this(editNoteTemplatePageViewModel) 19 | { 20 | this.editNoteTemplatePageViewModel.NoteTemplateId = NoteId; 21 | 22 | } 23 | 24 | 25 | public EditNoteTemplatePage(EditNoteTemplatePageViewModel editNoteTemplatePageViewModel, long NoteId, long NoteTemplateId) : this(editNoteTemplatePageViewModel, NoteId) 26 | { 27 | editNoteTemplatePageViewModel.Clone.Execute(NoteTemplateId); 28 | 29 | } 30 | 31 | private void OnFavoriteSwipeItemInvoked(object sender, EventArgs e) 32 | { 33 | 34 | } 35 | 36 | private void OnDeleteSwipeItemInvoked(object sender, EventArgs e) 37 | { 38 | 39 | } 40 | 41 | private void DragGestureRecognizer_DragStarting_Collection(object sender, DragStartingEventArgs e) 42 | { 43 | 44 | } 45 | 46 | private void Button_Clicked(object sender, EventArgs e) 47 | { 48 | 49 | } 50 | 51 | protected override bool OnBackButtonPressed() 52 | { 53 | editNoteTemplatePageViewModel.SubmitBack.Execute(null); 54 | return true; 55 | } 56 | 57 | private void MainCollectionView_Scrolled(object sender, ItemsViewScrolledEventArgs e) 58 | { 59 | this.CoverImage.TranslationY= e.VerticalOffset*0.8; 60 | } 61 | 62 | } -------------------------------------------------------------------------------- /src/libs/AipSdk/Baidu/Aip/Speech/Base.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Baidu, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | 14 | using System; 15 | using System.Net; 16 | 17 | namespace Baidu.Aip.Speech 18 | { 19 | public class Base : AipServiceBase 20 | { 21 | public Base(string apiKey, string secretKey) : base(apiKey, secretKey) 22 | { 23 | IsDev = true; 24 | } 25 | 26 | public Base(string appId, string apiKey, string secretKey) : base(appId, apiKey, secretKey) 27 | { 28 | IsDev = true; 29 | } 30 | 31 | protected string Cuid 32 | { 33 | get { return Utils.Md5(Token); } 34 | } 35 | 36 | 37 | protected override void DoAuthorization() 38 | { 39 | lock (AuthLock) 40 | { 41 | if (!NeetAuth()) 42 | return; 43 | 44 | var resp = Auth.OpenApiFetchToken(ApiKey, SecretKey, true); 45 | 46 | ExpireAt = DateTime.Now.AddSeconds((int) resp["expires_in"] - 1); 47 | IsDev = true; 48 | Token = (string) resp["access_token"]; 49 | HasDoneAuthoried = true; 50 | } 51 | } 52 | 53 | 54 | protected override HttpWebRequest GenerateWebRequest(AipHttpRequest aipRequest) 55 | { 56 | return aipRequest.GenerateSpeechRequest(this.Timeout); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Styles/Fonts.xaml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 10 | 14 | 18 | 22 | 26 | 30 | 34 | 38 | 42 | 46 | 50 | 51 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/ThirdPartyLicensesPage.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | 15 | 16 | 19 | 20 | 21 | 22 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/MatoProductivity/Views/FirstLaunchPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Abp.Configuration; 3 | using Abp.Dependency; 4 | using MatoProductivity.Core.Settings; 5 | using MatoProductivity.Core.Views; 6 | using MatoProductivity.ViewModels; 7 | using Microsoft.Maui.Devices; 8 | 9 | namespace MatoProductivity 10 | { 11 | public partial class FirstLaunchPage : PopupBase, ITransientDependency 12 | { 13 | private readonly IIocResolver iocResolver; 14 | private readonly DisplayInfo displayInfo; 15 | 16 | public event EventHandler OnFinishedChooise; 17 | public FirstLaunchPage(IIocResolver iocResolver) 18 | { 19 | InitializeComponent(); 20 | this.iocResolver=iocResolver; 21 | } 22 | 23 | private async void PopupBase_Opened(object sender, CommunityToolkit.Maui.Core.PopupOpenedEventArgs e) 24 | { 25 | 26 | Size=new Size(290, 360); 27 | } 28 | 29 | 30 | private void Button_Clicked(object sender, EventArgs e) 31 | { 32 | this.OnFinishedChooise?.Invoke(this, true); 33 | } 34 | 35 | private void Button_Clicked_1(object sender, EventArgs e) 36 | { 37 | this.OnFinishedChooise?.Invoke(this, false); 38 | 39 | } 40 | 41 | private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e) 42 | { 43 | using var objWrapper = iocResolver.ResolveAsDisposable(new { url = "https://blog.matoapp.net/apps/matoproductivity/license.html" }); 44 | await navigationService.ShowPopupAsync(objWrapper.Object); 45 | } 46 | 47 | private async void TapGestureRecognizer_Tapped_1(object sender, TappedEventArgs e) 48 | { 49 | using var objWrapper = iocResolver.ResolveAsDisposable(new { url = "https://blog.matoapp.net/apps/matoproductivity/privacy.html" }); 50 | await navigationService.ShowPopupAsync(objWrapper.Object); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/MatoProductivity/Platforms/Android/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Content.PM; 3 | using Android.OS; 4 | using Android.Runtime; 5 | using Microsoft.Maui; 6 | 7 | namespace MatoProductivity 8 | { 9 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)] 10 | [IntentFilter(new[] { Platform.Intent.ActionAppAction }, 11 | Categories = new[] { global::Android.Content.Intent.CategoryDefault })] 12 | public class MainActivity : MauiAppCompatActivity 13 | { 14 | public MainActivity() 15 | { 16 | AndroidEnvironment.UnhandledExceptionRaiser += UnhandledException; 17 | AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; 18 | } 19 | protected override void OnResume() 20 | { 21 | base.OnResume(); 22 | 23 | Platform.OnResume(this); 24 | } 25 | 26 | protected override void OnNewIntent(Android.Content.Intent intent) 27 | { 28 | base.OnNewIntent(intent); 29 | 30 | Platform.OnNewIntent(intent); 31 | } 32 | protected override void OnCreate(Bundle savedInstanceState) 33 | { 34 | base.OnCreate(savedInstanceState); 35 | Platform.Init(this, savedInstanceState); 36 | 37 | } 38 | public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults) 39 | { 40 | 41 | Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); 42 | 43 | base.OnRequestPermissionsResult(requestCode, permissions, grantResults); 44 | } 45 | 46 | private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) 47 | { 48 | 49 | } 50 | 51 | private void UnhandledException(object sender, RaiseThrowableEventArgs e) 52 | { 53 | 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /src/libs/QWeatherAPI/WeatherWarningAPI.cs: -------------------------------------------------------------------------------- 1 | using QWeatherAPI.Result.WeatherWarning; 2 | using QWeatherAPI.Tools; 3 | using QWeatherAPI.Tools.Net.Http; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace QWeatherAPI 11 | { 12 | public static class WeatherWarningAPI 13 | { 14 | /// 15 | /// 通过经度,纬度获取天气预警 API 数据。 16 | /// 17 | /// 地区经度。 18 | /// 地区纬度。 19 | /// 和风天气 API 密钥。 20 | /// 返回数据语言,默认采用中文。详情请参考:https://dev.qweather.com/docs/resource/language/ 21 | /// 天气预警 API 返回数据。 22 | public static async Task GetWeatherWarningAsync(double lon, double lat, string key, string lang = "zh") 23 | { 24 | var response = await WebRequests.GetRequestAsync($"https://devapi.qweather.com/v7/warning/now?location={lon},{lat}&lang={lang}&key={key}"); 25 | string jsonData = await response.Content.ReadAsStringAsync(); 26 | var weather = new WarningResult(jsonData); 27 | return weather; 28 | } 29 | 30 | /// 31 | /// 通过 LocationID 获取天气预警 API 数据。 32 | /// 33 | /// 地区 LocationID,可通过 GeoAPI.GetGeoAsync() 来获取。 34 | /// 和风天气 API 密钥。 35 | /// 返回数据语言,默认采用中文。详情请参考:https://dev.qweather.com/docs/resource/language/ 36 | /// 天气预警 API 返回数据。 37 | public static async Task GetWeatherWarningAsync(string id, string key, string lang = "zh") 38 | { 39 | var response = await WebRequests.GetRequestAsync($"https://devapi.qweather.com/v7/warning/now?location={id}&lang={lang}&key={key}"); 40 | string jsonData = await response.Content.ReadAsStringAsync(); 41 | var weather = new WarningResult(jsonData); 42 | return weather; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/MatoProductivity.EntityFrameworkCore/EntityFrameworkCore/MatoProductivityEntityFrameworkCoreModule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Transactions; 3 | using Abp.Dependency; 4 | using Abp.Domain.Uow; 5 | using Abp.EntityFrameworkCore; 6 | using Abp.EntityFrameworkCore.Configuration; 7 | using Abp.EntityFrameworkCore.Uow; 8 | using Abp.Modules; 9 | using Abp.Reflection.Extensions; 10 | using MatoProductivity.Core; 11 | using MatoProductivity.EntityFrameworkCore.Seed; 12 | using Microsoft.EntityFrameworkCore; 13 | 14 | namespace MatoProductivity.EntityFrameworkCore 15 | { 16 | [DependsOn( 17 | typeof(MatoProductivityCoreModule), 18 | typeof(AbpEntityFrameworkCoreModule))] 19 | public class MatoProductivityEntityFrameworkCoreModule : AbpModule 20 | { 21 | 22 | public static bool SkipDbSeed { get; set; } 23 | 24 | public override void PreInitialize() 25 | { 26 | Configuration.Modules.AbpEfCore().AddDbContext(options => 27 | { 28 | if (options.ExistingConnection != null) 29 | { 30 | DbContextOptionsConfigurer.Configure(options.DbContextOptions, options.ExistingConnection); 31 | } 32 | else 33 | { 34 | DbContextOptionsConfigurer.Configure(options.DbContextOptions, options.ConnectionString); 35 | } 36 | }); 37 | } 38 | public override void Initialize() 39 | { 40 | 41 | IocManager.RegisterAssemblyByConvention(typeof(MatoProductivityEntityFrameworkCoreModule).GetAssembly()); 42 | 43 | } 44 | 45 | public override void PostInitialize() 46 | { 47 | Helper.WithDbContextHelper.WithDbContext(IocManager, RunMigrate); 48 | if (!SkipDbSeed) 49 | { 50 | SeedHelper.SeedHostDb(IocManager); 51 | } 52 | } 53 | 54 | public static void RunMigrate(MatoProductivityDbContext dbContext) 55 | { 56 | dbContext.Database.Migrate(); 57 | } 58 | 59 | 60 | } 61 | } -------------------------------------------------------------------------------- /src/MatoProductivity/Views/PrivacyPolicyPopupPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 17 | 18 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/MatoProductivity.Core/Location/ReGeocodeLocation.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace MatoProductivity.Core.Location 4 | { 5 | /// 6 | /// 逆地址 7 | /// 8 | public class ReGeocodeLocation 9 | { 10 | /// 11 | /// 详细地址 12 | /// 13 | public string Address { get; set; } 14 | /// 15 | /// 格式化的地址描述 16 | /// 17 | public string FormattedAddress { get; set; } 18 | /// 19 | /// 国家 20 | /// 21 | public string Country { get; set; } 22 | /// 23 | /// 省份 24 | /// 25 | public string Province { get; set; } 26 | /// 27 | /// 城市 28 | /// 29 | public string City { get; set; } 30 | /// 31 | /// 区县 32 | /// 33 | public string District { get; set; } 34 | /// 35 | /// 街道 36 | /// 37 | public string Street { get; set; } 38 | /// 39 | /// adcode 40 | /// 41 | public string AdCode { get; set; } 42 | /// 43 | /// 乡镇 44 | /// 45 | public string Town { get; set; } 46 | /// 47 | /// 门牌号 48 | /// 49 | public string Number { get; set; } 50 | /// 51 | /// Poi信息列表 52 | /// 53 | public IEnumerable Pois { get; set; } 54 | /// 55 | /// 道路信息列表 56 | /// 57 | public IEnumerable Roads { get; set; } 58 | /// 59 | /// 附加信息 60 | /// 61 | public IDictionary Additionals { get; } 62 | 63 | public ReGeocodeLocation() 64 | { 65 | Pois = new Poi[0]; 66 | Roads = new Road[0]; 67 | Additionals = new Dictionary(); 68 | } 69 | 70 | public void AddAdditional(string key, object value) 71 | { 72 | Additionals.Add(key, value); 73 | } 74 | } 75 | } 76 | --------------------------------------------------------------------------------