├── .gitattributes ├── .gitignore ├── App ├── BeatmapListingActionsHandler.cs ├── CollectionEditor.cs ├── CollectionManagerApp.csproj ├── CommandLine.cs ├── GuiActionsHandler.cs ├── Initalizer.cs ├── Interfaces │ ├── Controls │ │ ├── IBeatmapListingModel.cs │ │ ├── IBeatmapListingPresenter.cs │ │ ├── IBeatmapThumbnailModel.cs │ │ ├── ICollectionAddRenameModel.cs │ │ ├── ICollectionListingModel.cs │ │ ├── ICollectionTextModel.cs │ │ ├── ICombinedBeatmapPreviewModel.cs │ │ ├── IDownloadManagerModel.cs │ │ ├── IInfoTextModel.cs │ │ ├── IMusicControlModel.cs │ │ ├── IUserTopGeneratorModel.cs │ │ └── IUsernameGeneratorModel.cs │ ├── Forms │ │ └── IMainFormModel.cs │ ├── IBeatmapListingBindingProvider.cs │ ├── IFormEvents.cs │ ├── IGenericMapSetterModel.cs │ └── IUpdateModel.cs ├── Misc │ ├── BeatmapListFilter.cs │ ├── CollectionEditArgsExtension.cs │ ├── GuiComponentsProvider.cs │ └── Helpers.cs ├── Models │ ├── Controls │ │ ├── BeatmapListingModel.cs │ │ ├── BeatmapThumbnailModel.cs │ │ ├── CollectionListingModel.cs │ │ ├── CollectionRenameModel.cs │ │ ├── CollectionTextModel.cs │ │ ├── CombinedBeatmapPreviewModel.cs │ │ ├── DownloadManagerModel.cs │ │ ├── InfoTextModel.cs │ │ ├── MusicControlModel.cs │ │ ├── UserTopGeneratorModel.cs │ │ └── UsernameGeneratorModel.cs │ ├── DownloadSource.cs │ ├── DownloaderSettings.cs │ ├── Forms │ │ └── MainFormModel.cs │ ├── GenericMapSetterModel.cs │ └── StartupSettings.cs ├── OsuDownloadManager.cs ├── Presenters │ ├── Controls │ │ ├── BeatmapListingPresenter.cs │ │ ├── BeatmapThumbnailPresenter.cs │ │ ├── CollectionAddRenamePresenter.cs │ │ ├── CollectionListingPresenter.cs │ │ ├── CollectionTextPresenter.cs │ │ ├── CombinedBeatmapPreviewPresenter.cs │ │ ├── CombinedListingPresenter.cs │ │ ├── DownloadManagerPresenter.cs │ │ ├── InfoTextPresenter.cs │ │ ├── MusicControlPresenter.cs │ │ ├── StartupPresenter.cs │ │ ├── UserTopGeneratorPresenter.cs │ │ └── UsernameGeneratorPresenter.cs │ └── Forms │ │ ├── BeatmapExportFormPresenter.cs │ │ ├── BeatmapListingFormPresenter.cs │ │ ├── CollectionAddRenameFormPresenter.cs │ │ ├── DownloadManagerFormPresenter.cs │ │ ├── MainFormPresenter.cs │ │ └── UserTopGeneratorFormPresenter.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ ├── Settings.settings │ └── launchSettings.json ├── Resources │ └── logo.ico ├── SidePanelActionsHandler.cs ├── UpdateChecker.cs ├── app.config └── downloadSources.json ├── CollectionGenerator ├── App.config ├── CollectionGenerator.csproj ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── CollectionManager.sln ├── CollectionManager.sln.DotSettings ├── CollectionManagerDll ├── CollectionManagerDll.csproj ├── DataTypes │ ├── Beatmap.cs │ ├── BeatmapExtension.cs │ ├── Beatmaps.cs │ ├── Collection.cs │ ├── Collections.cs │ ├── ICollection.cs │ ├── LazerBeatmap.cs │ ├── LazerFile.cs │ ├── LazerReplay.cs │ ├── Mods.cs │ ├── PlayModeStars.cs │ ├── RangeObservableCollection.cs │ ├── Replay.cs │ ├── Score.cs │ ├── Scores.cs │ ├── StarRating.cs │ └── WebCollection.cs ├── Enums │ ├── CollectionEdit.cs │ ├── OsuGrade.cs │ ├── PlayMode.cs │ ├── SortOrder.cs │ └── SubmissionStatus.cs ├── Example.cs ├── Exceptions │ ├── BeatmapCacherNotInitalizedException.cs │ ├── CorruptedFileException.cs │ └── NotOsuDirectoryException.cs ├── Extensions │ ├── BeatmapInfoExtensions.cs │ ├── BeatmapSetInfoExtensions.cs │ ├── CancellationTokenSourceExtensions.cs │ ├── EnumerableExtensions.cs │ ├── IScoreDataManagerExtensions.cs │ ├── RealmNamedFileUsageExtensions.cs │ ├── ScoreInfoExtensions.cs │ └── StringExtensions.cs ├── FodyWeavers.xml ├── FodyWeavers.xsd ├── Helpers.cs ├── Interfaces │ ├── ICollectionEditor.cs │ ├── ICollectionNameValidator.cs │ ├── ILazerReplay.cs │ ├── ILogger.cs │ ├── IMapDataManager.cs │ ├── IReplay.cs │ └── IScoreDataManager.cs ├── Modules │ ├── CollectionsManager │ │ ├── CollectionBeatmapComparer.cs │ │ ├── CollectionEditArgs.cs │ │ ├── CollectionsManager.cs │ │ └── CollectionsManagerWithCounts.cs │ ├── FileIO │ │ ├── FileCollections │ │ │ ├── CollectionLoader.cs │ │ │ ├── LazerCollectionHandler.cs │ │ │ ├── OsdbCollectionHandler.cs │ │ │ └── OsuCollectionHandler.cs │ │ ├── OsuBinaryReader.cs │ │ ├── OsuBinaryWriter.cs │ │ ├── OsuDb │ │ │ ├── LOsuDatabaseLoader.cs │ │ │ ├── MapCacher.cs │ │ │ ├── OsuDatabase.cs │ │ │ └── OsuDatabaseReader.cs │ │ ├── OsuFileIo.cs │ │ ├── OsuLazerDb │ │ │ ├── BeatmapOnlineStatus.cs │ │ │ ├── OsuLazerDatabase.cs │ │ │ └── RealmModels │ │ │ │ ├── BeatmapCollection.cs │ │ │ │ ├── BeatmapDifficulty.cs │ │ │ │ ├── BeatmapInfo.cs │ │ │ │ ├── BeatmapMetadata.cs │ │ │ │ ├── BeatmapSetInfo.cs │ │ │ │ ├── BeatmapUserSettings.cs │ │ │ │ ├── Enums │ │ │ │ ├── APIUser.cs │ │ │ │ ├── HitResult.cs │ │ │ │ ├── Mod.cs │ │ │ │ └── ScoreRank.cs │ │ │ │ ├── RealmFile.cs │ │ │ │ ├── RealmNamedFileUsage.cs │ │ │ │ ├── RealmUser.cs │ │ │ │ ├── RulesetInfo.cs │ │ │ │ └── ScoreInfo.cs │ │ ├── OsuPathResolver.cs │ │ ├── OsuRealmReader.cs │ │ ├── OsuScoresDb │ │ │ ├── ScoresCacher.cs │ │ │ └── ScoresDatabaseIO.cs │ │ └── OsuSettingsLoader.cs │ └── ModParser │ │ └── ModParser.cs └── Properties │ ├── Annotations.cs │ ├── Annotations1.cs │ └── AssemblyInfo.cs ├── CollectionManagerDllTests ├── CollectionManagerDllTests.csproj ├── Modules │ └── ModParser │ │ └── ModParserTests.cs └── Properties │ └── AssemblyInfo.cs ├── CollectionManagerExtensionsDll ├── CollectionManagerExtensionsDll.csproj ├── DataTypes │ ├── ApiScore.cs │ ├── CollectionGeneratorConfiguration.cs │ └── ScoreSaveConditions.cs ├── Enums │ └── CollectionListSaveType.cs ├── FodyWeavers.xml ├── FodyWeavers.xsd ├── Modules │ ├── API │ │ ├── BeatmapData.cs │ │ ├── BeatmapExtensionEx.cs │ │ ├── osu │ │ │ ├── OsuApi.cs │ │ │ └── OsuSite.cs │ │ └── osustats │ │ │ ├── OsuStatsApi.cs │ │ │ └── UserInformation.cs │ ├── BeatmapExporter │ │ ├── BeatmapExporter.cs │ │ ├── BeatmapSetExport.cs │ │ ├── BeatmapSetExportException.cs │ │ ├── LazerBeatmapSetExport.cs │ │ └── StableBeatmapSetExport.cs │ ├── BeatmapFilter │ │ └── BeatmapFilter.cs │ ├── CollectionApiGenerator │ │ ├── CollectionsGenerator.cs │ │ └── UserTopGenerator.cs │ ├── CollectionListGenerator │ │ ├── BeatmapType.cs │ │ ├── IListGenerator.cs │ │ ├── ListGenerator.cs │ │ └── ListTypes │ │ │ ├── BeatmapListGenerator.cs │ │ │ ├── GenericGenerator.cs │ │ │ ├── HtmlListGenerator.cs │ │ │ ├── OsuBbCodeGenerator.cs │ │ │ ├── RedditCodeGenerator.cs │ │ │ ├── TxtListGenerator.cs │ │ │ └── UserListGenerator.cs │ ├── DifficultyCalculator.cs │ ├── DownloadManager │ │ ├── API │ │ │ ├── CookieAwareWebClient.cs │ │ │ ├── CookieContainerExtensions.cs │ │ │ ├── DownloadItem.cs │ │ │ ├── DownloadManager.cs │ │ │ ├── DownloadProgress.cs │ │ │ ├── DownloadProgressReportEventArgs.cs │ │ │ ├── DownloadThrottler.cs │ │ │ └── LoginData.cs │ │ ├── GenericMapDownloader.cs │ │ ├── ILoginForm.cs │ │ └── OsuDownloader.cs │ └── TextProcessor │ │ └── TextProcessor.cs ├── Properties │ └── AssemblyInfo.cs └── Utils │ ├── BeatmapUtils.cs │ ├── CompilerServices.cs │ ├── ImpatientWebClient.cs │ ├── ListGeneratorUtils.cs │ └── RobotoFormatter.cs ├── CollectionManagerExtensionsDllTests ├── CollectionManagerExtensionsDllTests.csproj ├── Modules │ └── API │ │ └── osu │ │ └── OsuSiteTests.cs └── Properties │ └── AssemblyInfo.cs ├── Common ├── BeatmapListingAction.cs ├── Common.csproj ├── EventArgs │ ├── EventArgs.cs │ ├── FloatEventArgs.cs │ ├── IntEventArgs.cs │ └── StringEventArgs.cs ├── GuiHelpers.cs ├── Interfaces │ ├── Controls │ │ ├── IBeatmapListingView.cs │ │ ├── IBeatmapThumbnailView.cs │ │ ├── ICollectionAddView.cs │ │ ├── ICollectionListingView.cs │ │ ├── ICollectionRenameView.cs │ │ ├── ICollectionTextView.cs │ │ ├── ICombinedBeatmapPreviewView.cs │ │ ├── ICombinedListingView.cs │ │ ├── IDownloadManagerView.cs │ │ ├── IInfoTextView.cs │ │ ├── IMainSidePanelView.cs │ │ ├── IMusicControlView.cs │ │ ├── IStartupView.cs │ │ ├── IUserTopGenerator.cs │ │ └── IUsernameGeneratorView.cs │ ├── Forms │ │ ├── IBeatmapListingForm.cs │ │ ├── ICollectionAddRenameForm.cs │ │ ├── IDownloadManagerFormView.cs │ │ ├── IForm.cs │ │ ├── ILoginForm.cs │ │ ├── IMainFormView.cs │ │ ├── IOsustatsApiLoginFormView.cs │ │ ├── IProgressForm.cs │ │ ├── IStartupForm.cs │ │ ├── IUserTopGeneratorForm.cs │ │ └── IUsernameGeneratorForm.cs │ ├── IDownloadSource.cs │ ├── IOnlineCollectionList.cs │ └── IUserDialogs.cs ├── MRUFileCache.cs ├── MainSidePanelActions.cs ├── MessageBoxType.cs ├── Properties │ └── AssemblyInfo.cs ├── StartupCollectionAction.cs └── StartupDatabaseAction.cs ├── GuiComponents ├── Controls │ ├── BeatmapListingView.Designer.cs │ ├── BeatmapListingView.cs │ ├── BeatmapListingView.resx │ ├── BeatmapThumbnailView.Designer.cs │ ├── BeatmapThumbnailView.cs │ ├── BeatmapThumbnailView.resx │ ├── CollectionListingView.Designer.cs │ ├── CollectionListingView.cs │ ├── CollectionListingView.resx │ ├── CollectionRenameView.Designer.cs │ ├── CollectionRenameView.cs │ ├── CollectionRenameView.resx │ ├── CollectionTextView.Designer.cs │ ├── CollectionTextView.cs │ ├── CollectionTextView.resx │ ├── CombinedBeatmapPreviewView.Designer.cs │ ├── CombinedBeatmapPreviewView.cs │ ├── CombinedBeatmapPreviewView.resx │ ├── CombinedListingView.Designer.cs │ ├── CombinedListingView.cs │ ├── CombinedListingView.resx │ ├── DownloadManagerView.Designer.cs │ ├── DownloadManagerView.cs │ ├── DownloadManagerView.resx │ ├── InfoTextView.Designer.cs │ ├── InfoTextView.cs │ ├── InfoTextView.resx │ ├── MainSidePanelView.Designer.cs │ ├── MainSidePanelView.cs │ ├── MainSidePanelView.resx │ ├── MusicControlView.Designer.cs │ ├── MusicControlView.cs │ ├── MusicControlView.resx │ ├── StartupView.Designer.cs │ ├── StartupView.cs │ ├── StartupView.resx │ ├── TabControlEx.cs │ ├── UserTopGeneratorView.Designer.cs │ ├── UserTopGeneratorView.cs │ ├── UserTopGeneratorView.resx │ ├── UsernameGeneratorView.Designer.cs │ ├── UsernameGeneratorView.cs │ └── UsernameGeneratorView.resx ├── Forms │ ├── BaseForm.cs │ ├── BaseForm.resx │ ├── BeatmapListingForm.Designer.cs │ ├── BeatmapListingForm.cs │ ├── BeatmapListingForm.resx │ ├── CollectionAddRenameForm.Designer.cs │ ├── CollectionAddRenameForm.cs │ ├── CollectionAddRenameForm.resx │ ├── DownloadManagerFormView.Designer.cs │ ├── DownloadManagerFormView.cs │ ├── DownloadManagerFormView.resx │ ├── LoginFormView.Designer.cs │ ├── LoginFormView.cs │ ├── LoginFormView.resx │ ├── MainFormView.Designer.cs │ ├── MainFormView.cs │ ├── MainFormView.resx │ ├── OsustatsApiLoginFormView.Designer.cs │ ├── OsustatsApiLoginFormView.cs │ ├── OsustatsApiLoginFormView.resx │ ├── StartupForm.Designer.cs │ ├── StartupForm.cs │ ├── StartupForm.resx │ ├── UserTopGeneratorForm.Designer.cs │ ├── UserTopGeneratorForm.cs │ ├── UserTopGeneratorForm.resx │ ├── UsernameGeneratorForm.Designer.cs │ ├── UsernameGeneratorForm.cs │ └── UsernameGeneratorForm.resx ├── GuiComponents.csproj ├── Helpers.cs ├── ProgressForm.Designer.cs ├── ProgressForm.cs ├── ProgressForm.resx ├── Properties │ └── AssemblyInfo.cs ├── UserDialogs.cs ├── YesNoForm.Designer.cs ├── YesNoForm.cs └── YesNoForm.resx ├── InnoSetup ├── afterInstall.txt ├── beforeInstall.txt ├── license.txt └── script.iss ├── MusicPlayer ├── AudioFileReaderEx.cs ├── AudioPlayer.cs ├── IMusicPlayer.cs ├── MusicPlayer.csproj ├── MusicPlayerManager.cs ├── NAudio │ ├── NAudio.WindowsMediaFormat.dll │ ├── NAudio.dll │ ├── NAudio.xml │ ├── license.txt │ └── readme.txt ├── NAudioPlayer.cs ├── Properties │ └── AssemblyInfo.cs ├── SoundTouch │ ├── SoundTouch.cs │ ├── SoundTouchInterop32.cs │ ├── SoundTouchInterop64.cs │ ├── SoundTouchProfile.cs │ ├── SoundTouchSettings.cs │ ├── VarispeedSampleProvider.cs │ └── lib │ │ ├── COPYING.TXT │ │ ├── SoundTouch.dll │ │ └── SoundTouch_x64.dll ├── SoundTouchPlayer.cs └── WaveStreamExtensions.cs ├── ObjectListView ├── CellEditing │ ├── CellEditKeyEngine.cs │ ├── CellEditors.cs │ └── EditorRegistry.cs ├── CustomDictionary.xml ├── DataListView.cs ├── DataTreeListView.cs ├── DragDrop │ ├── DragSource.cs │ ├── DropSink.cs │ └── OLVDataObject.cs ├── FastDataListView.cs ├── FastObjectListView.cs ├── Filtering │ ├── Cluster.cs │ ├── ClusteringStrategy.cs │ ├── ClustersFromGroupsStrategy.cs │ ├── DateTimeClusteringStrategy.cs │ ├── FilterMenuBuilder.cs │ ├── Filters.cs │ ├── FlagClusteringStrategy.cs │ ├── ICluster.cs │ ├── IClusteringStrategy.cs │ └── TextMatchFilter.cs ├── FullClassDiagram.cd ├── Implementation │ ├── Attributes.cs │ ├── Comparers.cs │ ├── DataSourceAdapter.cs │ ├── Delegates.cs │ ├── DragSource.cs │ ├── DropSink.cs │ ├── Enums.cs │ ├── Events.cs │ ├── GroupingParameters.cs │ ├── Groups.cs │ ├── Munger.cs │ ├── NativeMethods.cs │ ├── NullableDictionary.cs │ ├── OLVListItem.cs │ ├── OLVListSubItem.cs │ ├── OlvListViewHitTestInfo.cs │ ├── TreeDataSourceAdapter.cs │ ├── VirtualGroups.cs │ └── VirtualListDataSource.cs ├── OLVColumn.cs ├── ObjectListView.DesignTime.cs ├── ObjectListView.FxCop ├── ObjectListView.cs ├── ObjectListView.shfb ├── ObjectListView2005.csproj ├── ObjectListView2008.csproj ├── ObjectListView2008.ncrunchproject ├── ObjectListView2010.csproj ├── ObjectListView2010.ncrunchproject ├── ObjectListView2012.csproj ├── ObjectListView2012.csproj.DotSettings ├── ObjectListView2012.ncrunchproject ├── ObjectListView2012.v2.ncrunchproject ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Rendering │ ├── Adornments.cs │ ├── Decorations.cs │ ├── Overlays.cs │ ├── Renderers.cs │ ├── Styles.cs │ └── TreeRenderer.cs ├── Resources │ ├── clear-filter.png │ ├── coffee.jpg │ ├── filter-icons3.png │ ├── filter.png │ ├── sort-ascending.png │ └── sort-descending.png ├── SubControls │ ├── GlassPanelForm.cs │ ├── HeaderControl.cs │ ├── ToolStripCheckedListBox.cs │ └── ToolTipControl.cs ├── TreeListView.cs ├── Utilities │ ├── ColumnSelectionForm.Designer.cs │ ├── ColumnSelectionForm.cs │ ├── ColumnSelectionForm.resx │ ├── Generator.cs │ ├── OLVExporter.cs │ └── TypedObjectListView.cs ├── VirtualObjectListView.cs └── olv-keyfile.snk └── README.md /App/Interfaces/Controls/IBeatmapListingModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using BrightIdeasSoftware; 3 | using CollectionManager.DataTypes; 4 | using Common; 5 | using Gui.Misc; 6 | 7 | namespace App.Interfaces 8 | { 9 | public interface IBeatmapListingModel 10 | { 11 | event EventHandler BeatmapsChanged; 12 | event EventHandler FilteringStarted; 13 | event EventHandler FilteringFinished; 14 | 15 | event EventHandler SelectedBeatmapChanged; 16 | event EventHandler SelectedBeatmapsChanged; 17 | event GuiHelpers.BeatmapListingActionArgs BeatmapOperation; 18 | event GuiHelpers.BeatmapsEventArgs BeatmapsDropped; 19 | 20 | Beatmaps SelectedBeatmaps { get; set; } 21 | Beatmap SelectedBeatmap { get; set; } 22 | ICollection CurrentCollection { get; } 23 | void EmitBeatmapOperation(BeatmapListingAction args); 24 | void EmitBeatmapsDropped(object sender,Beatmaps beatmaps); 25 | Beatmaps GetBeatmaps(); 26 | void SetBeatmaps(Beatmaps beatmaps); 27 | void SetCollection(ICollection collection); 28 | void FilterBeatmaps(string text); 29 | IModelFilter GetFilter(); 30 | } 31 | } -------------------------------------------------------------------------------- /App/Interfaces/Controls/IBeatmapListingPresenter.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | 3 | namespace App.Interfaces 4 | { 5 | public interface IBeatmapListingPresenter 6 | { 7 | Beatmaps Beatmaps { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /App/Interfaces/Controls/IBeatmapThumbnailModel.cs: -------------------------------------------------------------------------------- 1 | namespace App.Interfaces 2 | { 3 | public interface IBeatmapThumbnailModel : IGenericMapSetterModel 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /App/Interfaces/Controls/ICollectionAddRenameModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace App.Interfaces 4 | { 5 | public interface ICollectionAddRenameModel 6 | { 7 | event EventHandler Submited; 8 | Func IsCollectionNameValid { get; } 9 | string OrginalCollectionName { get; } 10 | string NewCollectionName { get; set; } 11 | bool NewCollectionNameIsValid { get; set; } 12 | bool UserCanceled { get; set; } 13 | void EmitSubmited(); 14 | } 15 | } -------------------------------------------------------------------------------- /App/Interfaces/Controls/ICollectionListingModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CollectionManager.DataTypes; 3 | using CollectionManager.Modules.CollectionsManager; 4 | 5 | namespace App.Interfaces 6 | { 7 | public interface ICollectionListingModel 8 | { 9 | event EventHandler CollectionsChanged; 10 | event EventHandler SelectedCollectionsChanged; 11 | event EventHandler CollectionEditing; 12 | Collections GetCollections(); 13 | Collections SelectedCollections { get; set; } 14 | 15 | void EmitCollectionEditing(CollectionEditArgs args); 16 | Collections GetCollectionsForBeatmaps(Beatmaps beatmaps); 17 | 18 | } 19 | } -------------------------------------------------------------------------------- /App/Interfaces/Controls/ICollectionTextModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CollectionManager.DataTypes; 3 | 4 | namespace App.Interfaces 5 | { 6 | public interface ICollectionTextModel 7 | { 8 | event EventHandler CollectionChanged; 9 | void SetCollections(Collections collections); 10 | Collections Collections { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /App/Interfaces/Controls/ICombinedBeatmapPreviewModel.cs: -------------------------------------------------------------------------------- 1 | namespace App.Interfaces 2 | { 3 | public interface ICombinedBeatmapPreviewModel : IGenericMapSetterModel 4 | { 5 | 6 | } 7 | } -------------------------------------------------------------------------------- /App/Interfaces/Controls/IDownloadManagerModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using CollectionManagerExtensionsDll.Modules.DownloadManager.API; 4 | using Gui.Misc; 5 | 6 | namespace App.Interfaces 7 | { 8 | public interface IDownloadManagerModel 9 | { 10 | event EventHandler DownloadItemsChanged; 11 | event EventHandler> DownloadItemUpdated; 12 | 13 | event EventHandler LogInStatusChanged; 14 | event EventHandler LogInRequest; 15 | event EventHandler StartDownloads; 16 | event EventHandler StopDownloads; 17 | void EmitStartDownloads(); 18 | void EmitStopDownloads(); 19 | void EmitLoginRequest(); 20 | ICollection DownloadItems { get; set; } 21 | bool IsLoggedIn { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /App/Interfaces/Controls/IInfoTextModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace App.Interfaces 4 | { 5 | public interface IInfoTextModel 6 | { 7 | int BeatmapCount { get; set; } 8 | int BeatmapsInCollectionsCount { get; set; } 9 | int MissingMapSetsCount { get; set; } 10 | int CollectionsCount { get; set; } 11 | int UnknownMapCount { get; set; } 12 | IUpdateModel GetUpdater(); 13 | void EmitUpdateTextClicked(); 14 | event EventHandler CountsUpdated; 15 | event EventHandler UpdateTextClicked; 16 | 17 | } 18 | } -------------------------------------------------------------------------------- /App/Interfaces/Controls/IMusicControlModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace App.Interfaces 4 | { 5 | public interface IMusicControlModel : IGenericMapSetterModel, IFormEvents 6 | { 7 | event EventHandler NextMapRequest; 8 | void EmitNextMapRequest(); 9 | } 10 | } -------------------------------------------------------------------------------- /App/Interfaces/Controls/IUserTopGeneratorModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CollectionManager.DataTypes; 3 | using CollectionManagerExtensionsDll.DataTypes; 4 | 5 | namespace App.Interfaces 6 | { 7 | public interface IUserTopGeneratorModel 8 | { 9 | string GenerationStatus { get; set; } 10 | double GenerationCompletionPrecentage { get; set; } 11 | Collections Collections { get; set; } 12 | CollectionGeneratorConfiguration GeneratorConfiguration { get; set; } 13 | event EventHandler CollectionsChanged; 14 | event EventHandler StatusChanged; 15 | event EventHandler Start; 16 | event EventHandler Abort; 17 | event EventHandler GenerateUsernames; 18 | event EventHandler SaveCollections; 19 | 20 | void EmitStart(); 21 | void EmitAbort(); 22 | void EmitGenerateUsernames(); 23 | void EmitSaveCollections(); 24 | string GetCollectionNameExample(string pattern); 25 | 26 | 27 | } 28 | } -------------------------------------------------------------------------------- /App/Interfaces/Controls/IUsernameGeneratorModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace App.Interfaces 5 | { 6 | public interface IUsernameGeneratorModel 7 | { 8 | 9 | event EventHandler Start; 10 | event EventHandler Abort; 11 | event EventHandler StatusChanged; 12 | event EventHandler Complete; 13 | List GeneratedUsernames { get; set; } 14 | string GeneratedUsernamesStr { get; } 15 | string Status { set; get; } 16 | int CompletionPrecentage { get; set; } 17 | int StartRank { get; set; } 18 | int EndRank { get; set; } 19 | void EmitStart(); 20 | void EmitAbort(); 21 | void EmitComplete(); 22 | 23 | } 24 | } -------------------------------------------------------------------------------- /App/Interfaces/Forms/IMainFormModel.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.Interfaces; 2 | using GuiComponents.Interfaces; 3 | 4 | namespace App.Interfaces.Forms 5 | { 6 | public interface IMainFormModel 7 | { 8 | ICollectionEditor GetCollectionEditor(); 9 | IUserDialogs GetUserDialogs(); 10 | } 11 | } -------------------------------------------------------------------------------- /App/Interfaces/IBeatmapListingBindingProvider.cs: -------------------------------------------------------------------------------- 1 | namespace App.Interfaces 2 | { 3 | public interface IBeatmapListingBindingProvider 4 | { 5 | void Bind(IBeatmapListingModel model); 6 | void UnBind(IBeatmapListingModel model); 7 | } 8 | } -------------------------------------------------------------------------------- /App/Interfaces/IFormEvents.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace App.Interfaces 4 | { 5 | public interface IFormEvents 6 | { 7 | event EventHandler FormClosed; 8 | event EventHandler FormClosing; 9 | void EmitFormClosing(); 10 | void EmitFormClosed(); 11 | } 12 | } -------------------------------------------------------------------------------- /App/Interfaces/IGenericMapSetterModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CollectionManager.DataTypes; 3 | 4 | namespace App.Interfaces 5 | { 6 | public interface IGenericMapSetterModel 7 | { 8 | void SetBeatmap(Beatmap beatmap); 9 | Beatmap CurrentBeatmap { get; } 10 | 11 | event EventHandler BeatmapChanged; 12 | } 13 | } -------------------------------------------------------------------------------- /App/Interfaces/IUpdateModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace App.Interfaces 4 | { 5 | public interface IUpdateModel 6 | { 7 | bool UpdateIsAvailable { get; } 8 | bool Error { get; } 9 | Version OnlineVersion { get; } 10 | string NewVersionLink { get; } 11 | Version CurrentVersion { get; } 12 | bool CheckForUpdates(); 13 | } 14 | } -------------------------------------------------------------------------------- /App/Misc/CollectionEditArgsExtension.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | using CollectionManager.Enums; 3 | using CollectionManager.Modules.CollectionsManager; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace App.Misc 11 | { 12 | internal class CollectionEditArgsExtension : CollectionEditArgs 13 | { 14 | public CollectionEditArgsExtension(CollectionEdit action) : base(action) 15 | { 16 | } 17 | 18 | public static CollectionEditArgs ExportBeatmaps(Collections collections) 19 | { 20 | return new CollectionEditArgsExtension(CollectionEdit.ExportBeatmaps) 21 | { 22 | Collections = collections 23 | }; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /App/Misc/GuiComponentsProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | 7 | namespace App.Misc 8 | { 9 | public sealed class GuiComponentsProvider 10 | { 11 | public static GuiComponentsProvider Instance = new GuiComponentsProvider(); 12 | 13 | private GuiComponentsProvider() 14 | { 15 | LoadGuiDll(); 16 | } 17 | private string GuiDllLocation { get; set; } 18 | private Assembly GuiDllAssembly { get; set; } 19 | private void LoadGuiDll() 20 | { 21 | GuiDllLocation = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "GuiComponents.dll"); 22 | GuiDllAssembly = Assembly.LoadFile(GuiDllLocation); 23 | } 24 | 25 | private IEnumerable GetTypesWithInterface(Assembly asm) 26 | { 27 | var it = typeof(T); 28 | return asm.GetLoadableTypes().Where(it.IsAssignableFrom).ToList(); 29 | } 30 | 31 | public T GetClassImplementing() 32 | { 33 | return GetClassImplementing(GuiDllAssembly); 34 | } 35 | 36 | private T GetClassImplementing(Assembly asm) 37 | { 38 | foreach (var tt in GetTypesWithInterface(asm)) 39 | { 40 | return (T)Activator.CreateInstance(tt); 41 | } 42 | return default(T); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /App/Models/Controls/BeatmapThumbnailModel.cs: -------------------------------------------------------------------------------- 1 | using App.Interfaces; 2 | 3 | namespace App.Models 4 | { 5 | public class BeatmapThumbnailModel : GenericMapSetterModel, IBeatmapThumbnailModel 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /App/Models/Controls/CollectionListingModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CollectionManager.DataTypes; 3 | using App.Interfaces; 4 | using CollectionManager.Modules.CollectionsManager; 5 | 6 | namespace App.Models 7 | { 8 | public class CollectionListingModel : ICollectionListingModel 9 | { 10 | private readonly ICollectionEditor _collectionEditor; 11 | public event EventHandler CollectionsChanged; 12 | public event EventHandler SelectedCollectionsChanged; 13 | public event EventHandler CollectionEditing; 14 | 15 | private Collections _collections; 16 | public CollectionListingModel(Collections collections, ICollectionEditor collectionEditor) 17 | { 18 | _collectionEditor = collectionEditor; 19 | SetCollections(collections); 20 | } 21 | public Collections GetCollections() 22 | { 23 | return _collections; 24 | } 25 | 26 | private Collections _selectedCollections; 27 | public Collections SelectedCollections 28 | { 29 | get { return _selectedCollections; } 30 | set 31 | { 32 | _selectedCollections = value; 33 | SelectedCollectionsChanged?.Invoke(this, EventArgs.Empty); 34 | } 35 | } 36 | 37 | public void EmitCollectionEditing(CollectionEditArgs args) 38 | { 39 | CollectionEditing?.Invoke(this, args); 40 | } 41 | 42 | public Collections GetCollectionsForBeatmaps(Beatmaps beatmaps) 43 | => _collectionEditor.GetCollectionsForBeatmaps(beatmaps); 44 | 45 | public void SetCollections(Collections collections) 46 | { 47 | _collections = collections; 48 | _collections.CollectionChanged += _collections_CollectionChanged; 49 | 50 | OnCollectionsChanged(); 51 | } 52 | 53 | private void _collections_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) 54 | { 55 | OnCollectionsChanged(); 56 | } 57 | 58 | protected virtual void OnCollectionsChanged() 59 | { 60 | CollectionsChanged?.Invoke(this, EventArgs.Empty); 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /App/Models/Controls/CollectionRenameModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using App.Interfaces; 3 | 4 | namespace App.Models 5 | { 6 | public class CollectionAddRenameModel : ICollectionAddRenameModel 7 | { 8 | public event EventHandler Submited; 9 | public Func IsCollectionNameValid { get; } 10 | public string OrginalCollectionName { get; } 11 | public string NewCollectionName { get; set; } = ""; 12 | private bool _newCollectionNameIsValid = true; 13 | public bool UserCanceled { get; set; } = false; 14 | 15 | public bool NewCollectionNameIsValid 16 | { 17 | get { return !UserCanceled && _newCollectionNameIsValid; } 18 | set { _newCollectionNameIsValid = value; } 19 | } 20 | 21 | public void EmitSubmited() 22 | { 23 | Submited?.Invoke(this, EventArgs.Empty); 24 | } 25 | 26 | public CollectionAddRenameModel(Func isCollectionNameValid, string orginalCollectionName="") 27 | { 28 | IsCollectionNameValid = isCollectionNameValid; 29 | OrginalCollectionName = orginalCollectionName; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /App/Models/Controls/CollectionTextModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CollectionManager.DataTypes; 3 | using App.Interfaces; 4 | 5 | namespace App.Models 6 | { 7 | public class CollectionTextModel: ICollectionTextModel 8 | { 9 | public event EventHandler CollectionChanged; 10 | public void SetCollections(Collections collections) 11 | { 12 | Collections = collections; 13 | } 14 | 15 | private Collections _collections; 16 | 17 | public Collections Collections 18 | { 19 | get 20 | { 21 | return _collections; 22 | } 23 | set 24 | { 25 | _collections = value; 26 | OnCollectionChanged(); 27 | } 28 | } 29 | 30 | protected virtual void OnCollectionChanged() 31 | { 32 | CollectionChanged?.Invoke(this, EventArgs.Empty); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /App/Models/Controls/CombinedBeatmapPreviewModel.cs: -------------------------------------------------------------------------------- 1 | using App.Interfaces; 2 | 3 | namespace App.Models 4 | { 5 | public class CombinedBeatmapPreviewModel : GenericMapSetterModel, ICombinedBeatmapPreviewModel 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /App/Models/Controls/InfoTextModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using App.Interfaces; 3 | 4 | namespace App.Models 5 | { 6 | public class InfoTextModel : IInfoTextModel 7 | { 8 | private int _beatmapCount; 9 | private int _beatmapsInCollectionsCount; 10 | private int _missingMapSetsCount; 11 | private int _collectionsCount; 12 | private int _unknownMapCount; 13 | 14 | public InfoTextModel(IUpdateModel updateModel) 15 | { 16 | UpdateModel = updateModel; 17 | } 18 | 19 | public int BeatmapCount 20 | { 21 | get => _beatmapCount; 22 | set 23 | { 24 | _beatmapCount = value; 25 | OnCountsUpdated(); 26 | } 27 | } 28 | 29 | public int BeatmapsInCollectionsCount 30 | { 31 | get => _beatmapsInCollectionsCount; 32 | set 33 | { 34 | _beatmapsInCollectionsCount = value; 35 | OnCountsUpdated(); 36 | } 37 | } 38 | 39 | public int MissingMapSetsCount 40 | { 41 | get => _missingMapSetsCount; 42 | set 43 | { 44 | _missingMapSetsCount = value; 45 | OnCountsUpdated(); 46 | } 47 | } 48 | 49 | public int CollectionsCount 50 | { 51 | get => _collectionsCount; 52 | set 53 | { 54 | _collectionsCount = value; 55 | OnCountsUpdated(); 56 | } 57 | } 58 | 59 | public int UnknownMapCount 60 | { 61 | get => _unknownMapCount; 62 | set 63 | { 64 | _unknownMapCount = value; 65 | OnCountsUpdated(); 66 | } 67 | } 68 | 69 | private IUpdateModel UpdateModel { get; } 70 | public IUpdateModel GetUpdater() 71 | { 72 | return UpdateModel; 73 | } 74 | 75 | public void EmitUpdateTextClicked() 76 | { 77 | UpdateTextClicked?.Invoke(this, EventArgs.Empty); 78 | } 79 | 80 | public event EventHandler CountsUpdated; 81 | public event EventHandler UpdateTextClicked; 82 | 83 | protected virtual void OnCountsUpdated() 84 | { 85 | CountsUpdated?.Invoke(this, EventArgs.Empty); 86 | } 87 | 88 | } 89 | } -------------------------------------------------------------------------------- /App/Models/Controls/MusicControlModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using App.Interfaces; 3 | 4 | namespace App.Models 5 | { 6 | public class MusicControlModel : GenericMapSetterModel, IMusicControlModel 7 | { 8 | public void EmitFormClosing() { FormClosing?.Invoke(this, EventArgs.Empty); } 9 | public void EmitFormClosed() { FormClosed?.Invoke(this, EventArgs.Empty); } 10 | public void EmitNextMapRequest() { NextMapRequest?.Invoke(this, EventArgs.Empty); } 11 | public event EventHandler FormClosed; 12 | public event EventHandler FormClosing; 13 | public event EventHandler NextMapRequest; 14 | } 15 | } -------------------------------------------------------------------------------- /App/Models/Controls/UsernameGeneratorModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using App.Interfaces; 4 | 5 | namespace App.Models 6 | { 7 | public class UsernameGeneratorModel : IUsernameGeneratorModel 8 | { 9 | public event EventHandler Start; 10 | public event EventHandler Abort; 11 | public event EventHandler StatusChanged; 12 | public event EventHandler Complete; 13 | public List GeneratedUsernames { get; set; } = new List(); 14 | 15 | public string GeneratedUsernamesStr => string.Join(",", GeneratedUsernames); 16 | 17 | public int StartRank { get; set; } 18 | public int EndRank { get; set; } 19 | 20 | private string _status; 21 | public string Status 22 | { 23 | get { return _status; } 24 | set 25 | { 26 | _status = value; 27 | StatusChanged?.Invoke(this, EventArgs.Empty); 28 | } 29 | } 30 | 31 | private int _completionPrecentage; 32 | public int CompletionPrecentage 33 | { 34 | get { return _completionPrecentage; } 35 | set 36 | { 37 | _completionPrecentage = value; 38 | StatusChanged?.Invoke(this, EventArgs.Empty); 39 | } 40 | } 41 | 42 | public void EmitStart() 43 | { 44 | Start?.Invoke(this, EventArgs.Empty); 45 | } 46 | 47 | public void EmitAbort() 48 | { 49 | Abort?.Invoke(this, EventArgs.Empty); 50 | } 51 | 52 | public void EmitComplete() 53 | { 54 | Complete?.Invoke(this, EventArgs.Empty); 55 | } 56 | 57 | } 58 | } -------------------------------------------------------------------------------- /App/Models/DownloadSource.cs: -------------------------------------------------------------------------------- 1 | using Common.Interfaces; 2 | 3 | namespace App.Models 4 | { 5 | public class DownloadSource : IDownloadSource 6 | { 7 | public string Name { get; set; } 8 | public string Description { get; set; } 9 | public string Referer { get; set; } 10 | public string BaseDownloadUrl { get; set; } 11 | public bool ThrottleDownloads { get; set; } 12 | public int DownloadsPerMinute { get; set; } 13 | public int DownloadsPerHour { get; set; } 14 | public int DownloadThreads { get; set; } 15 | public string FullyQualifiedHandlerName { get; set; } 16 | public bool RequiresLogin { get; set; } 17 | public bool UseCookiesLogin { get; set; } 18 | public int RequestTimeout { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /App/Models/DownloaderSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using CollectionManagerExtensionsDll.Modules.DownloadManager.API; 6 | using Common.Interfaces; 7 | 8 | namespace App.Models 9 | { 10 | public class DownloaderSettings 11 | { 12 | public string DownloadDirectory { get; set; } 13 | public bool? DownloadWithVideo { get; set; } 14 | public LoginData LoginData { get; set; } 15 | 16 | public bool IsValid(IReadOnlyList downloadSources) 17 | { 18 | var hasValidLoginData = LoginData.IsValid(); 19 | if (!hasValidLoginData) 20 | hasValidLoginData = !downloadSources.FirstOrDefault(s => s.Name == LoginData.DownloadSource)?.RequiresLogin ?? false; 21 | 22 | return !string.IsNullOrWhiteSpace(DownloadDirectory) 23 | && Directory.Exists(DownloadDirectory) 24 | && DownloadWithVideo.HasValue 25 | && hasValidLoginData; 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return $"Directory: \"{DownloadDirectory}\"{Environment.NewLine}" + 31 | $"With video: {DownloadWithVideo}{Environment.NewLine}" + 32 | $"{LoginData}"; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /App/Models/Forms/MainFormModel.cs: -------------------------------------------------------------------------------- 1 | using App.Interfaces; 2 | using App.Interfaces.Forms; 3 | using GuiComponents.Interfaces; 4 | 5 | namespace App.Models.Forms 6 | { 7 | public class MainFormModel : IMainFormModel 8 | { 9 | 10 | public MainFormModel(ICollectionEditor collectionEditor, IUserDialogs userDialogs) 11 | { 12 | UserDialogs = userDialogs; 13 | CollectionEditor = collectionEditor; 14 | } 15 | 16 | private ICollectionEditor CollectionEditor { get; } 17 | public ICollectionEditor GetCollectionEditor() 18 | { 19 | return CollectionEditor; 20 | } 21 | 22 | private IUserDialogs UserDialogs { get; } 23 | public IUserDialogs GetUserDialogs() 24 | { 25 | return UserDialogs; 26 | } 27 | 28 | } 29 | } -------------------------------------------------------------------------------- /App/Models/GenericMapSetterModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using App.Interfaces; 3 | using CollectionManager.DataTypes; 4 | 5 | namespace App.Models 6 | { 7 | public abstract class GenericMapSetterModel :IGenericMapSetterModel 8 | { 9 | public virtual void SetBeatmap(Beatmap beatmap) 10 | { 11 | CurrentBeatmap = beatmap; 12 | } 13 | 14 | private Beatmap _currentBeatmap; 15 | 16 | public virtual Beatmap CurrentBeatmap 17 | { 18 | get 19 | { 20 | return _currentBeatmap; 21 | } 22 | set 23 | { 24 | _currentBeatmap = value; 25 | OnBeatmapChanged(); 26 | } 27 | } 28 | 29 | public event EventHandler BeatmapChanged; 30 | 31 | protected virtual void OnBeatmapChanged() 32 | { 33 | BeatmapChanged?.Invoke(this, EventArgs.Empty); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /App/Models/StartupSettings.cs: -------------------------------------------------------------------------------- 1 | using Common; 2 | 3 | namespace App.Models 4 | { 5 | public class StartupSettings 6 | { 7 | public StartupDatabaseAction StartupDatabaseAction { get; set; } 8 | public StartupCollectionAction StartupCollectionAction { get; set; } 9 | public bool AutoLoadMode { get; set; } 10 | public string OsuLocation { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /App/Presenters/Controls/CollectionAddRenamePresenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using App.Interfaces; 3 | using GuiComponents.Interfaces; 4 | 5 | namespace App.Presenters.Controls 6 | { 7 | class CollectionAddRenamePresenter 8 | { 9 | private readonly ICollectionRenameView _view; 10 | private readonly ICollectionAddRenameModel _model; 11 | 12 | public CollectionAddRenamePresenter(ICollectionRenameView view, ICollectionAddRenameModel model) 13 | { 14 | _view = view; 15 | _model = model; 16 | 17 | _view.CollectionNameChanged += ViewOnCollectionNameChanged; 18 | _view.Submited += ViewOnSubmited; 19 | _view.Canceled += ViewOnCanceled; 20 | } 21 | 22 | private void Unbind() 23 | { 24 | _view.CollectionNameChanged -= ViewOnCollectionNameChanged; 25 | _view.Submited -= ViewOnSubmited; 26 | _view.Canceled -= ViewOnCanceled; 27 | } 28 | private void ViewOnCanceled(object sender, EventArgs eventArgs) 29 | { 30 | _model.UserCanceled = true; 31 | Unbind(); 32 | } 33 | 34 | private void ViewOnSubmited(object sender, EventArgs eventArgs) 35 | { 36 | _model.EmitSubmited(); 37 | Unbind(); 38 | } 39 | 40 | private void ViewOnCollectionNameChanged(object sender, EventArgs eventArgs) 41 | { 42 | bool isValid = _model.IsCollectionNameValid(_view.NewCollectionName); 43 | _view.CanSubmit = isValid; 44 | _view.ErrorText = isValid ? "" : "Collection name is invalid!"; 45 | 46 | _model.NewCollectionNameIsValid = isValid; 47 | _model.NewCollectionName = _view.NewCollectionName; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /App/Presenters/Controls/CollectionTextPresenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CollectionManagerExtensionsDll.Enums; 3 | using CollectionManagerExtensionsDll.Modules.CollectionListGenerator; 4 | using App.Interfaces; 5 | using GuiComponents.Interfaces; 6 | 7 | namespace App.Presenters.Controls 8 | { 9 | public class CollectionTextPresenter 10 | { 11 | private ICollectionTextView _view; 12 | private readonly ICollectionTextModel _model; 13 | private ListGenerator _listGenerator = new ListGenerator(); 14 | public CollectionTextPresenter(ICollectionTextView view, ICollectionTextModel model) 15 | { 16 | _view = view; 17 | _view.SetListTypes(Enum.GetValues(typeof(CollectionListSaveType))); 18 | _view.SaveTypeChanged += _view_SaveTypeChanged; 19 | 20 | _model = model; 21 | _model.CollectionChanged += ModelOnCollectionChanged; 22 | } 23 | 24 | private void _view_SaveTypeChanged(object sender, EventArgs e) 25 | { 26 | ModelOnCollectionChanged(this, null); 27 | } 28 | 29 | private void ModelOnCollectionChanged(object sender, EventArgs eventArgs) 30 | { 31 | CollectionListSaveType type; 32 | Enum.TryParse(_view.SelectedSaveType, out type); 33 | _view.GeneratedText = _listGenerator.GetAllMapsList(_model.Collections, type); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /App/Presenters/Controls/CombinedBeatmapPreviewPresenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using App.Interfaces; 3 | using App.Models; 4 | using GuiComponents.Interfaces; 5 | 6 | namespace App.Presenters.Controls 7 | { 8 | public class CombinedBeatmapPreviewPresenter 9 | { 10 | private readonly ICombinedBeatmapPreviewView _view; 11 | private readonly ICombinedBeatmapPreviewModel _model; 12 | 13 | private readonly IBeatmapThumbnailModel _beatmapThumbnailModel; 14 | public readonly IMusicControlModel MusicControlModel; 15 | public CombinedBeatmapPreviewPresenter(ICombinedBeatmapPreviewView view, ICombinedBeatmapPreviewModel model) 16 | { 17 | _view = view; 18 | _model = model; 19 | _model.BeatmapChanged+=ModelOnBeatmapChanged; 20 | _beatmapThumbnailModel = new BeatmapThumbnailModel(); 21 | new BeatmapThumbnailPresenter(_view.BeatmapThumbnailView, _beatmapThumbnailModel); 22 | 23 | MusicControlModel = new MusicControlModel(); 24 | new MusicControlPresenter(_view.MusicControlView, MusicControlModel); 25 | } 26 | 27 | private void ModelOnBeatmapChanged(object sender, EventArgs eventArgs) 28 | { 29 | var map = _model.CurrentBeatmap; 30 | _beatmapThumbnailModel.SetBeatmap(map); 31 | MusicControlModel.SetBeatmap(map); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /App/Presenters/Controls/UsernameGeneratorPresenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using App.Interfaces; 4 | using CollectionManagerExtensionsDll.Modules.API.osu; 5 | using Common.Interfaces.Controls; 6 | 7 | namespace App.Presenters.Controls 8 | { 9 | public class UsernameGeneratorPresenter 10 | { 11 | private readonly IUsernameGeneratorModel _model; 12 | private readonly IUsernameGeneratorView _view; 13 | private OsuSite osuSite = new OsuSite(); 14 | public UsernameGeneratorPresenter(IUsernameGeneratorModel model, IUsernameGeneratorView view) 15 | { 16 | _model = model; 17 | _view = view; 18 | _view.Start += ViewOnStart; 19 | _view.Abort += (s, a) => _model.EmitAbort(); 20 | //_view. += (s, a) => _model.EmitComplete(); 21 | _model.StatusChanged += _model_StatusChanged; 22 | _model.Complete += _model_Complete; 23 | } 24 | 25 | private void _model_Complete(object sender, EventArgs e) 26 | { 27 | _view.GeneratedUsernames = string.Join(",", _model.GeneratedUsernames); 28 | _view.StartEnabled = true; 29 | } 30 | 31 | private void _model_StatusChanged(object sender, EventArgs e) 32 | { 33 | _view.CompletionPrecentage = _model.CompletionPrecentage; 34 | _view.Status = _model.Status; 35 | } 36 | 37 | private void ViewOnStart(object sender, EventArgs eventArgs) 38 | { 39 | _view.StartEnabled = false; 40 | _view.AbortEnabled = false; 41 | _model.StartRank = _view.RankMin; 42 | _model.EndRank = _view.RankMax; 43 | _model.EmitStart(); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /App/Presenters/Forms/BeatmapListingFormPresenter.cs: -------------------------------------------------------------------------------- 1 | using App.Presenters.Controls; 2 | using App.Interfaces; 3 | using App.Models; 4 | using GuiComponents.Interfaces; 5 | 6 | namespace App.Presenters.Forms 7 | { 8 | public class BeatmapListingFormPresenter 9 | { 10 | private readonly IBeatmapListingForm _view; 11 | private ICombinedBeatmapPreviewModel _combinedBeatmapPreviewModel; 12 | public readonly IBeatmapListingModel BeatmapListingModel; 13 | public BeatmapListingFormPresenter(IBeatmapListingForm view) 14 | { 15 | _view = view; 16 | //_view.BeatmapListingView.SelectedBeatmapChanged += BeatmapListingView_SelectedBeatmapChanged; 17 | BeatmapListingModel = new BeatmapListingModel(Initalizer.LoadedBeatmaps); 18 | BeatmapListingModel.SelectedBeatmapChanged += BeatmapListingView_SelectedBeatmapChanged; 19 | new BeatmapListingPresenter(_view.BeatmapListingView, BeatmapListingModel); 20 | 21 | _combinedBeatmapPreviewModel = new CombinedBeatmapPreviewModel(); 22 | var presenter =new CombinedBeatmapPreviewPresenter(_view.CombinedBeatmapPreviewView, _combinedBeatmapPreviewModel); 23 | presenter.MusicControlModel.NextMapRequest += (s, a) => _view.BeatmapListingView.SelectNextOrFirst(); 24 | } 25 | 26 | private void BeatmapListingView_SelectedBeatmapChanged(object sender, System.EventArgs e) 27 | { 28 | _combinedBeatmapPreviewModel.SetBeatmap(BeatmapListingModel.SelectedBeatmap); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /App/Presenters/Forms/CollectionAddRenameFormPresenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using App.Interfaces; 3 | using App.Interfaces.Forms; 4 | using App.Models; 5 | using App.Presenters.Controls; 6 | using GuiComponents.Interfaces; 7 | 8 | namespace App.Presenters.Forms 9 | { 10 | public class CollectionAddRenameFormPresenter 11 | { 12 | private readonly ICollectionAddRenameForm _form; 13 | private readonly ICollectionAddRenameModel _model; 14 | 15 | public CollectionAddRenameFormPresenter(ICollectionAddRenameForm form, ICollectionAddRenameModel model) 16 | { 17 | _form = form; 18 | _model = model; 19 | 20 | new CollectionAddRenamePresenter(form.CollectionRenameView, model); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /App/Presenters/Forms/DownloadManagerFormPresenter.cs: -------------------------------------------------------------------------------- 1 | using App.Interfaces; 2 | using App.Presenters.Controls; 3 | using GuiComponents.Interfaces; 4 | 5 | namespace App.Presenters.Forms 6 | { 7 | public class DownloadManagerFormPresenter 8 | { 9 | private readonly IDownloadManagerFormView _formView; 10 | private readonly IDownloadManagerView _downloadManagerView; 11 | 12 | public DownloadManagerFormPresenter(IDownloadManagerFormView view, IDownloadManagerModel downloadManagerModel) 13 | { 14 | _formView = view; 15 | _downloadManagerView = _formView.DownloadManagerView; 16 | new DownloadManagerPresenter(_downloadManagerView, downloadManagerModel); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /App/Presenters/Forms/UserTopGeneratorFormPresenter.cs: -------------------------------------------------------------------------------- 1 | using App.Interfaces; 2 | using App.Presenters.Controls; 3 | using GuiComponents.Interfaces; 4 | 5 | namespace App.Presenters.Forms 6 | { 7 | public class UserTopGeneratorFormPresenter 8 | { 9 | private readonly IUserTopGeneratorModel _model; 10 | private readonly IUserTopGeneratorForm _form; 11 | 12 | public UserTopGeneratorFormPresenter(IUserTopGeneratorModel model, IUserTopGeneratorForm form) 13 | { 14 | _model = model; 15 | _form = form; 16 | form.Closing += (s, a) => 17 | { 18 | _model.EmitAbort(); 19 | if (_model.Collections != null) 20 | _model.EmitSaveCollections(); 21 | }; 22 | new UserTopGeneratorPresenter(model, form.UserTopGeneratorView); 23 | 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /App/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Runtime.InteropServices; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | using App.Misc; 7 | 8 | namespace App 9 | { 10 | static class Program 11 | { 12 | [DllImport("kernel32.dll", SetLastError = true)] 13 | private static extern bool AttachConsole(int dwProcessId); 14 | 15 | /// 16 | /// The main entry point for the application. 17 | /// 18 | [STAThread] 19 | static int Main(string[] args) 20 | { 21 | Application.EnableVisualStyles(); 22 | Application.SetCompatibleTextRenderingDefault(false); 23 | 24 | AppDomain.CurrentDomain.UnhandledException += (_, exArgs) => 25 | { 26 | if (exArgs.ExceptionObject is Exception exception) 27 | HandleException(exception); 28 | }; 29 | Application.ThreadException += (_, exArgs) 30 | => 31 | HandleException(exArgs.Exception); 32 | TaskScheduler.UnobservedTaskException += (_, exArgs) 33 | => 34 | HandleException(exArgs.Exception); 35 | 36 | if (args.Length > 0 && !File.Exists(args[0])) 37 | { 38 | //This somewhat breaks console interaction/output can't be easily piped 39 | AttachConsole(-1); 40 | 41 | return new CommandLine().Process(args) ? 0 : -1; 42 | } 43 | var app = new Initalizer(); 44 | app.Run(args); 45 | Application.Run(app); 46 | return 0; 47 | } 48 | 49 | public static void HandleException(Exception ex) 50 | { 51 | Helpers.SetClipboardText(ex.ToString()); 52 | MessageBox.Show( 53 | $"There was a problem with CollectionManager. It is recommended to save your edits and restart. {Environment.NewLine}{Environment.NewLine}Exception text was copied to your clipboard:{Environment.NewLine}{ex}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /App/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // Setting ComVisible to false makes the types in this assembly not visible 5 | // to COM components. If you need to access a type in this assembly from 6 | // COM, set the ComVisible attribute to true on that type. 7 | [assembly: ComVisible(false)] 8 | 9 | // The following GUID is for the ID of the typelib if this project is exposed to COM 10 | [assembly: Guid("f87a0f61-b6f3-4b5e-8a1a-c19c8c8feaa4")] 11 | [assembly: AssemblyVersion("1.0.0.0")] 12 | [assembly: AssemblyFileVersion("1.0.0.0")] 13 | -------------------------------------------------------------------------------- /App/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | {} 7 | 8 | 9 | False 10 | 11 | 12 | False 13 | 14 | 15 | 0.25 16 | 17 | 18 | 19 | 20 | 21 | {} 22 | 23 | 24 | False 25 | 26 | 27 | [] 28 | 29 | 30 | [] 31 | 32 | 33 | -------------------------------------------------------------------------------- /App/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "App": { 4 | "commandName": "Project" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /App/Resources/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/App/Resources/logo.ico -------------------------------------------------------------------------------- /App/UpdateChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Reflection; 4 | using App.Interfaces; 5 | using CollectionManagerExtensionsDll.Utils; 6 | using Newtonsoft.Json; 7 | using Newtonsoft.Json.Linq; 8 | 9 | namespace App 10 | { 11 | public class UpdateChecker : IUpdateModel 12 | { 13 | private const string baseGithubUrl = "https://api.github.com/repos/Piotrekol/CollectionManager"; 14 | private const string githubUpdateUrl = baseGithubUrl + "/releases/latest"; 15 | 16 | public UpdateChecker() 17 | { 18 | var version = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); 19 | CurrentVersion = new Version(version.FileVersion); 20 | } 21 | 22 | public bool Error { get; private set; } 23 | public Version OnlineVersion { get; private set; } 24 | public string NewVersionLink { get; private set; } 25 | public Version CurrentVersion { get; } 26 | 27 | public bool UpdateIsAvailable => OnlineVersion != null && OnlineVersion > CurrentVersion; 28 | 29 | public bool CheckForUpdates() 30 | { 31 | var data = GetStringData(githubUpdateUrl); 32 | if (string.IsNullOrEmpty(data)) 33 | { 34 | Error = true; 35 | return false; 36 | } 37 | 38 | JObject json; 39 | try 40 | { 41 | json = JObject.Parse(data); 42 | } 43 | catch (JsonReaderException) 44 | { 45 | return false; 46 | } 47 | 48 | var newestReleaseVersion = json["tag_name"].ToString(); 49 | OnlineVersion = new Version(newestReleaseVersion); 50 | NewVersionLink = json["html_url"].ToString(); 51 | 52 | return UpdateIsAvailable; 53 | } 54 | 55 | private string GetStringData(string url) 56 | { 57 | try 58 | { 59 | using (var wc = new ImpatientWebClient()) 60 | { 61 | wc.Headers.Add("user-agent", $"CollectionManager_Updater_{CurrentVersion}"); 62 | return wc.DownloadString(url); 63 | } 64 | } 65 | catch 66 | { 67 | return string.Empty; 68 | } 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /App/downloadSources.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Name": "osu!", 4 | "Description": "official map download source.\r\nIn order to download maps you need to login using osu! cookies.\r\nInstructions: https://streamable.com/lhlr3d \r\nIf you still need help join discord and read pinned message in #cm-help.\r\nhttps://discord.gg/N854wYZ", 5 | "Referer": "https://osu.ppy.sh/beatmapsets/", 6 | "BaseDownloadUrl": "https://osu.ppy.sh/beatmapsets/{0}/download", 7 | "ThrottleDownloads": true, 8 | "DownloadsPerMinute": 3, 9 | "DownloadsPerHour": 170, 10 | "DownloadThreads": 3, 11 | "RequestTimeout": 5000, 12 | "FullyQualifiedHandlerName": "CollectionManagerExtensionsDll.Modules.DownloadManager.OsuDownloader, CollectionManagerExtensionsDll", 13 | "RequiresLogin": true, 14 | "UseCookiesLogin": true 15 | } 16 | ] -------------------------------------------------------------------------------- /CollectionGenerator/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CollectionGenerator/CollectionGenerator.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Exe 4 | net48 5 | true 6 | CollectionGenerator 7 | CollectionGenerator 8 | Copyright © 2017 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /CollectionGenerator/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("3070a7aa-7493-42a7-9e0e-74878453abb4")] 12 | -------------------------------------------------------------------------------- /CollectionManager.sln.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | True 3 | True -------------------------------------------------------------------------------- /CollectionManagerDll/CollectionManagerDll.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | {533AB47A-D1B5-45DB-A37E-F053FA3699C4} 4 | CollectionManager 5 | CollectionManager 6 | netstandard20;netstandard21;net48 7 | CollectionManager 8 | 9 | Implements read/write access to osu! db & osdb collection files, along with ability to edit these in a reasonable manner 10 | Copyright © 2023 11 | Piotrekol 12 | 13 | MIT 14 | https://github.com/Piotrekol/CollectionManager/tree/master/CollectionManagerDll 15 | https://github.com/Piotrekol/CollectionManager/tree/master/CollectionManagerDll 16 | osu! 17 | true 18 | 1.0.9 19 | true 20 | snupkg 21 | latest 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /CollectionManagerDll/DataTypes/BeatmapExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CollectionManager.DataTypes 4 | { 5 | public class BeatmapExtension : Beatmap 6 | { 7 | #region ICeBeatmapProps 8 | public string Name { get { return this.ToString(); } } 9 | 10 | public bool DataDownloaded { get; set; } 11 | public bool LocalBeatmapMissing { get; set; } 12 | public bool LocalVersionDiffers { get; set; } 13 | public string UserComment { get; set; } = ""; 14 | 15 | #endregion 16 | } 17 | } -------------------------------------------------------------------------------- /CollectionManagerDll/DataTypes/Beatmaps.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace CollectionManager.DataTypes 5 | { 6 | public class Beatmaps : RangeObservableCollection 7 | { 8 | public Beatmaps() 9 | : base() { } 10 | 11 | public Beatmaps(IEnumerable collection) 12 | : base(collection) { } 13 | } 14 | } -------------------------------------------------------------------------------- /CollectionManagerDll/DataTypes/Collections.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.Specialized; 3 | using System.ComponentModel; 4 | 5 | namespace CollectionManager.DataTypes 6 | { 7 | /// 8 | /// Contents of this collection should be only modified by CollectionManager. 9 | /// Edits outside of it are not supported and things may break. 10 | /// 11 | public class Collections :RangeObservableCollection 12 | { 13 | public IEnumerable AllBeatmaps() 14 | { 15 | for (int i = 0; i < this.Count; i++) 16 | { 17 | foreach (var beatmap in this[i].AllBeatmaps()) 18 | { 19 | yield return beatmap; 20 | } 21 | } 22 | } 23 | 24 | public override event NotifyCollectionChangedEventHandler CollectionChanged 25 | { 26 | add { base.CollectionChanged += value; } 27 | remove { base.CollectionChanged -= value; } 28 | } 29 | 30 | protected override event PropertyChangedEventHandler PropertyChanged 31 | { 32 | add { base.PropertyChanged += value; } 33 | remove { base.PropertyChanged -= value; } 34 | } 35 | 36 | } 37 | } -------------------------------------------------------------------------------- /CollectionManagerDll/DataTypes/ICollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using CollectionManager.Modules.FileIO.OsuDb; 5 | 6 | namespace CollectionManager.DataTypes 7 | { 8 | public interface ICollection 9 | { 10 | /// 11 | /// Contains all beatmap hashes contained in this collection 12 | /// 13 | IReadOnlyCollection BeatmapHashes { get; } 14 | 15 | /// 16 | /// Contains beatmaps that did not find a match in LoadedMaps 17 | /// nor had additional data(MapSetId) 18 | /// 19 | Beatmaps UnknownBeatmaps { get; } 20 | 21 | /// 22 | /// Contains beatmaps that did not find a match in LoadedMaps 23 | /// but contain enough information(MapSetId) to be able to issue new download 24 | /// 25 | /// .osdb files contain this data since v2 26 | Beatmaps DownloadableBeatmaps { get; } 27 | 28 | /// 29 | /// Contains beatmap with data from LoadedMaps 30 | /// 31 | Beatmaps KnownBeatmaps { get; } 32 | 33 | /// 34 | /// Total number of beatmaps contained in this collection 35 | /// 36 | int NumberOfBeatmaps { get; } 37 | 38 | int NumberOfMissingBeatmaps { get; } 39 | 40 | /// 41 | /// Username of last person editing this collection 42 | /// 43 | string LastEditorUsername { get; set; } 44 | 45 | /// 46 | /// Collection name 47 | /// 48 | string Name { get; set; } 49 | 50 | /// 51 | /// Osu!Stats collection Id 52 | /// 53 | int OnlineId { get; set; } 54 | 55 | int Id { get; set; } 56 | 57 | Guid LazerId { get; set; } 58 | 59 | void SetLoadedMaps(MapCacher instance); 60 | IEnumerable AllBeatmaps(); 61 | IEnumerable NotKnownBeatmaps(); 62 | void AddBeatmap(Beatmap map); 63 | void AddBeatmap(BeatmapExtension map); 64 | void AddBeatmapByHash(string hash); 65 | void AddBeatmapByMapId(int mapId); 66 | void ReplaceBeatmap(string hash, Beatmap newBeatmap); 67 | void ReplaceBeatmap(int mapId, Beatmap newBeatmap); 68 | bool RemoveBeatmap(string hash); 69 | IEnumerator GetEnumerator(); 70 | } 71 | } -------------------------------------------------------------------------------- /CollectionManagerDll/DataTypes/LazerBeatmap.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.Extensions; 2 | using System.Linq; 3 | 4 | namespace CollectionManager.DataTypes; 5 | 6 | public class LazerBeatmap 7 | : BeatmapExtension 8 | { 9 | public string BackgroundFileName { get; set; } 10 | public string AudioRelativeFilePath => SetFiles.FirstOrDefault(f => f.FileName == Mp3Name)?.RelativeRealmFilePath; 11 | public string BackgroundRelativeFilePath => SetFiles.FirstOrDefault(f => f.FileName == BackgroundFileName)?.RelativeRealmFilePath; 12 | public string MapHash { get; set; } 13 | public LazerFile[] SetFiles { get; set; } 14 | } 15 | -------------------------------------------------------------------------------- /CollectionManagerDll/DataTypes/LazerFile.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace CollectionManager.DataTypes; 4 | 5 | public class LazerFile(string Hash, string FileName) 6 | { 7 | public string Hash { get; } = Hash; 8 | public string FileName { get; } = FileName; 9 | 10 | public string RelativeRealmFilePath => Path.Combine(Hash.Remove(1), Hash.Remove(2), Hash); 11 | } 12 | -------------------------------------------------------------------------------- /CollectionManagerDll/DataTypes/LazerReplay.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.Enums; 2 | using CollectionManager.Interfaces; 3 | 4 | namespace CollectionManager.DataTypes; 5 | 6 | public class LazerReplay 7 | : Replay, ILazerReplay 8 | { 9 | public string LazerVersion { get; set; } 10 | public int UserId { get; set; } 11 | public OsuGrade Grade { get; set; } 12 | } -------------------------------------------------------------------------------- /CollectionManagerDll/DataTypes/Mods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CollectionManager.DataTypes 4 | { 5 | [Flags] 6 | public enum Mods 7 | { 8 | Nm = 0, 9 | Nf = 1 << 0, 10 | Ez = 1 << 1, 11 | Td = 1 << 2, //Touch device 12 | Hd = 1 << 3, 13 | Hr = 1 << 4, 14 | Sd = 1 << 5, 15 | Dt = 1 << 6, 16 | RX = 1 << 7, 17 | Ht = 1 << 8, 18 | Nc = 1 << 9, 19 | Fl = 1 << 10, 20 | Au = 1 << 11, //auto play 21 | So = 1 << 12, 22 | Ap = 1 << 13, //Auto pilot 23 | Pf = 1 << 14, 24 | K4 = 1 << 15, 25 | K5 = 1 << 16, 26 | K6 = 1 << 17, 27 | K7 = 1 << 18, 28 | K8 = 1 << 19, 29 | Fi = 1 << 20, 30 | Rn = 1 << 21, 31 | Cm = 1 << 22, 32 | Tp = 1 << 23, 33 | K9 = 1 << 24, 34 | Coop = 1 << 25, 35 | K1 = 1 << 26, 36 | K3 = 1 << 27, 37 | K2 = 1 << 28, 38 | Sv2 = 1 << 29, 39 | Lm = 1 << 30, 40 | SpeedChanging = Dt | Ht | Nc, 41 | MapChanging = Hr | Ez | SpeedChanging 42 | } 43 | } -------------------------------------------------------------------------------- /CollectionManagerDll/DataTypes/RangeObservableCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Collections.Specialized; 5 | 6 | namespace CollectionManager.DataTypes 7 | { 8 | public class RangeObservableCollection : ObservableCollection 9 | { 10 | private bool _suppressNotification = false; 11 | 12 | public RangeObservableCollection() 13 | { 14 | } 15 | 16 | public RangeObservableCollection(IEnumerable collection) 17 | : base(collection) 18 | { 19 | } 20 | 21 | protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) 22 | { 23 | if (!_suppressNotification) 24 | { 25 | base.OnCollectionChanged(e); 26 | } 27 | } 28 | 29 | public void SilentRemove(T item) 30 | { 31 | _suppressNotification = true; 32 | Remove(item); 33 | _suppressNotification = false; 34 | } 35 | 36 | public void SilentAdd(T item) 37 | { 38 | _suppressNotification = true; 39 | Add(item); 40 | _suppressNotification = false; 41 | } 42 | 43 | public void CallReset() 44 | { 45 | OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); 46 | } 47 | public void SuspendEvents(bool suspend = true) 48 | { 49 | _suppressNotification = suspend; 50 | if (!suspend) 51 | CallReset(); 52 | } 53 | public void AddRange(IEnumerable list) 54 | { 55 | if (list == null) 56 | throw new ArgumentNullException("list"); 57 | 58 | _suppressNotification = true; 59 | 60 | foreach (T item in list) 61 | { 62 | Add(item); 63 | } 64 | _suppressNotification = false; 65 | //OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /CollectionManagerDll/DataTypes/Score.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using CollectionManager.Enums; 4 | using CollectionManager.Modules.FileIO; 5 | 6 | namespace CollectionManager.DataTypes 7 | { 8 | public class Score : Replay 9 | { 10 | public static Score ReadScore(OsuBinaryReader reader, bool minimalLoad = true, int? version = null) 11 | { 12 | return (Score)Read(reader, new Score(), minimalLoad, version); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /CollectionManagerDll/DataTypes/Scores.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.Interfaces; 2 | 3 | namespace CollectionManager.DataTypes; 4 | 5 | public class Scores : RangeObservableCollection 6 | { 7 | } -------------------------------------------------------------------------------- /CollectionManagerDll/DataTypes/StarRating.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | namespace CollectionManager.DataTypes 6 | { 7 | public class StarRating : IEnumerable> 8 | { 9 | public SortedList Values { get; } = new SortedList(); 10 | public void Add(int key, double value) 11 | => this[key] = value; 12 | 13 | public bool ContainsKey(int key) 14 | => Values.ContainsKey(key); 15 | 16 | public IEnumerator> GetEnumerator() 17 | { 18 | foreach (var kvPair in Values) 19 | { 20 | yield return kvPair; 21 | } 22 | } 23 | 24 | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); 25 | 26 | public override int GetHashCode() 27 | { 28 | unchecked 29 | { 30 | int hash = 17; 31 | foreach (var kvPair in Values) 32 | { 33 | hash = hash * 23 + kvPair.Key.GetHashCode(); 34 | hash = hash * 23 + kvPair.Value.GetHashCode(); 35 | } 36 | return hash; 37 | } 38 | } 39 | 40 | 41 | public double this[int key] 42 | { 43 | get 44 | { 45 | return Values[key]; 46 | } 47 | set { Values[key] = value; } 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Enums/CollectionEdit.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManager.Enums 2 | { 3 | public enum CollectionEdit 4 | { 5 | Add=0, 6 | Remove=1, 7 | Rename=2, 8 | Merge=3, 9 | Clear=4, 10 | AddBeatmaps=5, 11 | RemoveBeatmaps=6, 12 | AddOrMergeIfExists=7, 13 | Duplicate=8, 14 | Intersect=9, 15 | Inverse=10, 16 | Difference=11, 17 | Reorder=12, 18 | 19 | ExportBeatmaps=100, 20 | } 21 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Enums/OsuGrade.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManager.Enums 2 | { 3 | public enum OsuGrade 4 | { 5 | SSH, 6 | SH, 7 | SS, 8 | S, 9 | A, 10 | B, 11 | C, 12 | D, 13 | F, 14 | Null, 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Enums/PlayMode.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManager.Enums 2 | { 3 | public enum PlayMode 4 | { 5 | Osu = 0, 6 | Taiko = 1, 7 | CatchTheBeat = 2, 8 | OsuMania = 3 9 | } 10 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Enums/SortOrder.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManager.Enums 2 | { 3 | public enum SortOrder 4 | { 5 | Descending, 6 | Ascending, 7 | } 8 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Enums/SubmissionStatus.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManager.Enums 2 | { 3 | public enum SubmissionStatus 4 | { 5 | Unknown, 6 | NotSubmitted, 7 | Pending, 8 | EditableCutoff, 9 | Ranked, 10 | Approved, 11 | Qualified, 12 | Loved 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CollectionManagerDll/Exceptions/BeatmapCacherNotInitalizedException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CollectionManager.Exceptions 4 | { 5 | [Serializable] 6 | class BeatmapCacherNotInitalizedException :Exception 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /CollectionManagerDll/Exceptions/CorruptedFileException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CollectionManager.Exceptions 4 | { 5 | public class CorruptedFileException : Exception 6 | { 7 | public CorruptedFileException(string message) : base(message) 8 | { 9 | 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Exceptions/NotOsuDirectoryException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CollectionManager.Exceptions 4 | { 5 | [Serializable] 6 | public class NotOsuDirectoryException:Exception 7 | { 8 | 9 | } 10 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Extensions/BeatmapSetInfoExtensions.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | using CollectionManager.Interfaces; 3 | using CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | 7 | namespace CollectionManager.Extensions; 8 | internal static class BeatmapSetInfoExtensions 9 | { 10 | public static IEnumerable ToLazerBeatmaps(this BeatmapSetInfo beatmapSetInfo, IScoreDataManager scoreDataManager) 11 | { 12 | LazerFile[] setFiles = beatmapSetInfo.Files.Select(namedFile => namedFile.ToLazerFile()).ToArray(); 13 | 14 | return beatmapSetInfo.Beatmaps.Select(beatmap => beatmap.ToLazerBeatmap(scoreDataManager, setFiles)); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CollectionManagerDll/Extensions/CancellationTokenSourceExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | 4 | namespace CollectionManager.Extensions; 5 | 6 | public static class CancellationTokenSourceExtensions 7 | { 8 | public static bool TryCancel(this CancellationTokenSource cancellationTokenSource) 9 | { 10 | try 11 | { 12 | cancellationTokenSource?.Cancel(); 13 | 14 | return true; 15 | } 16 | catch (ObjectDisposedException) 17 | { 18 | return false; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CollectionManagerDll/Extensions/EnumerableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | 5 | namespace CollectionManager.Extensions; 6 | public static class EnumerableExtensions 7 | { 8 | #if NET48 || NETSTANDARD 9 | [DebuggerStepThrough] 10 | public static IEnumerable DistinctBy(this IEnumerable source, Func keySelector) 11 | { 12 | HashSet keys = []; 13 | 14 | foreach (TSource element in source) 15 | { 16 | if (keys.Contains(keySelector(element))) 17 | { 18 | continue; 19 | } 20 | 21 | _ = keys.Add(keySelector(element)); 22 | 23 | yield return element; 24 | } 25 | } 26 | #endif 27 | } 28 | -------------------------------------------------------------------------------- /CollectionManagerDll/Extensions/IScoreDataManagerExtensions.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.Enums; 2 | using CollectionManager.Interfaces; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace CollectionManager.Extensions; 7 | 8 | public static class IScoreDataManagerExtensions 9 | { 10 | public static IEnumerable GetReplays(this IScoreDataManager scoresManager, string mapHash, PlayMode playMode) 11 | => scoresManager 12 | .Scores 13 | .Where(score => 14 | score.MapHash.Equals(mapHash) 15 | && score.PlayMode == playMode); 16 | 17 | public static OsuGrade GetTopReplayGrade(this IScoreDataManager scoresManager, string mapHash, PlayMode playMode) 18 | { 19 | IReplay topReplay = GetTopReplay(scoresManager, mapHash, playMode); 20 | 21 | if (topReplay is not ILazerReplay lazerReplay) 22 | { 23 | return OsuGrade.Null; 24 | } 25 | 26 | return lazerReplay.Grade; 27 | } 28 | 29 | public static IReplay GetTopReplay(this IScoreDataManager scoresManager, string mapHash, PlayMode playMode) 30 | { 31 | IEnumerable replays = GetReplays(scoresManager, mapHash, playMode); 32 | 33 | if (!replays.Any()) 34 | { 35 | return null; 36 | } 37 | 38 | if (!replays.Skip(1).Any()) 39 | { 40 | return replays.First(); 41 | } 42 | 43 | return replays.Aggregate((first, second) 44 | => first.TotalScore > second.TotalScore ? first : second); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /CollectionManagerDll/Extensions/RealmNamedFileUsageExtensions.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | using CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; 3 | 4 | namespace CollectionManager.Extensions; 5 | internal static class RealmNamedFileUsageExtensions 6 | { 7 | public static LazerFile ToLazerFile(this RealmNamedFileUsage realmNamedFile) 8 | => new(realmNamedFile.File.Hash, realmNamedFile.Filename); 9 | } 10 | -------------------------------------------------------------------------------- /CollectionManagerDll/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using System.Linq; 4 | 5 | namespace CollectionManager.Extensions; 6 | 7 | public static class StringExtensions 8 | { 9 | public static string StripInvalidFileNameCharacters(this string fileName, string replacementString = "") 10 | { 11 | IEnumerable invalidCharacters = Path 12 | .GetInvalidFileNameChars() 13 | .Where(invalidChar => fileName.Contains(invalidChar)); 14 | 15 | foreach (var invalidChar in invalidCharacters) 16 | { 17 | fileName = fileName.Replace(invalidChar.ToString(), replacementString); 18 | } 19 | 20 | return fileName; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CollectionManagerDll/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /CollectionManagerDll/FodyWeavers.xsd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. 14 | 15 | 16 | 17 | 18 | A comma-separated list of error codes that can be safely ignored in assembly verification. 19 | 20 | 21 | 22 | 23 | 'false' to turn off automatic generation of the XML Schema file. 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /CollectionManagerDll/Helpers.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | using CollectionManager.Interfaces; 3 | using CollectionManager.Modules.FileIO; 4 | 5 | namespace CollectionManager 6 | { 7 | public static class Helpers 8 | { 9 | /// 10 | /// 11 | /// 12 | /// For whatever reason all of my replays before around 2015(mind you, I still have my 2011 replays) 13 | /// were treated by osu! as invalid, with as it turns out, invalidated whole database. 14 | /// 15 | private static void OsuOldReplayFix(this IReplay replay) 16 | { 17 | replay.Version = 20170503; 18 | } 19 | public static void Write(this IReplay replay, OsuBinaryWriter writer, bool dbMode = true) 20 | { 21 | if (dbMode) 22 | replay.OsuOldReplayFix(); 23 | writer.Write((byte)replay.PlayMode); 24 | writer.Write(replay.Version); 25 | writer.Write(replay.MapHash); 26 | writer.Write(replay.PlayerName); 27 | writer.Write(replay.ReplayHash); 28 | writer.Write(replay.C300); 29 | writer.Write(replay.C100); 30 | writer.Write(replay.C50); 31 | writer.Write(replay.Geki); 32 | writer.Write(replay.Katu); 33 | writer.Write(replay.Miss); 34 | writer.Write(replay.TotalScore); 35 | writer.Write(replay.MaxCombo); 36 | writer.Write(replay.Perfect); 37 | writer.Write(replay.Mods); 38 | writer.Write(dbMode ? "" : replay.ReplayData); 39 | writer.Write(replay.Date.Ticks); 40 | if (dbMode) 41 | { 42 | writer.Write(-1); 43 | } 44 | else 45 | { 46 | writer.Write(replay.CompressedReplayLength); 47 | if(replay.CompressedReplayLength>0) 48 | writer.Write(replay.ReplayData); 49 | } 50 | writer.Write(replay.OnlineScoreId); 51 | } 52 | 53 | public static Beatmap GetMap(this IReplay replay, IMapDataManager mapCacher) 54 | { 55 | return mapCacher.GetByHash(replay.MapHash); 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Interfaces/ICollectionEditor.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | using CollectionManager.Modules.CollectionsManager; 3 | 4 | namespace App.Interfaces 5 | { 6 | public interface ICollectionEditor 7 | { 8 | void EditCollection(CollectionEditArgs args); 9 | Collections GetCollectionsForBeatmaps(Beatmaps beatmaps); 10 | } 11 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Interfaces/ICollectionNameValidator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace CollectionManager.Interfaces 4 | { 5 | public interface ICollectionNameValidator 6 | { 7 | bool IsCollectionNameValid(string name); 8 | string GetValidCollectionName(string desiredName, List aditionalNames = null); 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Interfaces/ILazerReplay.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CollectionManager.Enums; 3 | using CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels.Enums; 4 | 5 | namespace CollectionManager.Interfaces; 6 | 7 | public interface ILazerReplay 8 | : IReplay 9 | { 10 | string LazerVersion { get; set; } 11 | int UserId { get; set; } 12 | OsuGrade Grade { get; set; } 13 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Interfaces/ILogger.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManager.Interfaces 2 | { 3 | public interface ILogger 4 | { 5 | void Log(string logMessage, params string[] vals); 6 | } 7 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Interfaces/IMapDataManager.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | 3 | namespace CollectionManager.Interfaces 4 | { 5 | public interface IMapDataManager 6 | { 7 | void StartMassStoring(); 8 | void EndMassStoring(); 9 | void StoreBeatmap(Beatmap beatmap); 10 | Beatmap GetByHash(string hash); 11 | Beatmap GetByMapId(int mapId); 12 | } 13 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Interfaces/IReplay.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CollectionManager.Enums; 3 | 4 | namespace CollectionManager.Interfaces 5 | { 6 | public interface IReplay 7 | { 8 | PlayMode PlayMode { get; set; } 9 | int Version { get; set; } 10 | string MapHash { get; set; } 11 | string PlayerName { get; set; } 12 | string ReplayHash { get; set; } 13 | int C300 { get; set; } 14 | int C100 { get; set; } 15 | int C50 { get; set; } 16 | int Geki { get; set; } 17 | int Katu { get; set; } 18 | int Miss { get; set; } 19 | long TotalScore { get; set; } 20 | int MaxCombo { get; set; } 21 | bool Perfect { get; set; } 22 | int Mods { get; set; } 23 | double AdditionalMods { get; set; } 24 | string ReplayData { get; set; } 25 | DateTimeOffset Date { get; set; } 26 | long DateTicks { get; set; } 27 | 28 | int CompressedReplayLength { get; set; } 29 | byte[] CompressedReplay { get; set; } 30 | long OnlineScoreId { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Interfaces/IScoreDataManager.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | 3 | namespace CollectionManager.Interfaces 4 | { 5 | public interface IScoreDataManager 6 | { 7 | Scores Scores { get; } 8 | void StartMassStoring(); 9 | void EndMassStoring(); 10 | void Clear(); 11 | void Store(IReplay replay); 12 | } 13 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/CollectionsManager/CollectionBeatmapComparer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CollectionManager.DataTypes; 3 | 4 | namespace CollectionManager.Modules.CollectionsManager 5 | { 6 | internal class CollectionBeatmapComparer : IEqualityComparer 7 | { 8 | public bool Equals(BeatmapExtension x, BeatmapExtension y) 9 | { 10 | return x != null && y != null && (x.Md5 == y.Md5 && x.MapId == y.MapId); 11 | } 12 | 13 | public int GetHashCode(BeatmapExtension obj) 14 | { 15 | unchecked 16 | { 17 | int hash = 17; 18 | hash = hash * 23 + obj.Md5.GetHashCode(); 19 | return hash * 23 + obj.MapId.GetHashCode(); 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/CollectionsManager/CollectionsManagerWithCounts.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CollectionManager.DataTypes; 3 | 4 | namespace CollectionManager.Modules.CollectionsManager 5 | { 6 | public class CollectionsManagerWithCounts : CollectionsManager 7 | { 8 | private readonly HashSet _missingBeatmapHashes = new HashSet(); 9 | private readonly HashSet _downloadableMapSetIds = new HashSet(); 10 | public int MissingMapSetsCount => _downloadableMapSetIds.Count; 11 | public int UnknownMapCount => _missingBeatmapHashes.Count; 12 | public int BeatmapsInCollectionsCount { get; private set; } 13 | public int CollectionsCount => LoadedCollections.Count; 14 | 15 | public CollectionsManagerWithCounts(Beatmaps loadedBeatmaps) : base(loadedBeatmaps) 16 | { 17 | } 18 | 19 | protected override void AfterCollectionsEdit() 20 | { 21 | var beatmapCount = 0; 22 | _missingBeatmapHashes.Clear(); 23 | _downloadableMapSetIds.Clear(); 24 | foreach (var collection in LoadedCollections) 25 | { 26 | foreach (var partialBeatmap in collection.UnknownBeatmaps) 27 | { 28 | if (!_missingBeatmapHashes.Contains(partialBeatmap.Md5)) 29 | _missingBeatmapHashes.Add(partialBeatmap.Md5); 30 | } 31 | foreach (var map in collection.DownloadableBeatmaps) 32 | { 33 | if (!_downloadableMapSetIds.Contains(map.MapSetId)) 34 | _downloadableMapSetIds.Add(map.MapSetId); 35 | } 36 | beatmapCount += collection.NumberOfBeatmaps; 37 | } 38 | BeatmapsInCollectionsCount = beatmapCount; 39 | 40 | base.AfterCollectionsEdit(); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/FileCollections/LazerCollectionHandler.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | using CollectionManager.Modules.FileIO.OsuDb; 3 | using CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; 4 | using Realms; 5 | using System; 6 | using System.Collections.Generic; 7 | 8 | namespace CollectionManager.Modules.FileIO.FileCollections; 9 | 10 | public class LazerCollectionHandler 11 | : OsuRealmReader 12 | { 13 | public IEnumerable Read(string realmFilePath, MapCacher mapCacher) 14 | { 15 | using Realm localRealm = GetRealm(realmFilePath); 16 | IRealmCollection allLazerCollections = localRealm.All().AsRealmCollection(); 17 | 18 | foreach (BeatmapCollection lazerCollection in allLazerCollections) 19 | { 20 | Collection collection = new(mapCacher) 21 | { 22 | Name = lazerCollection.Name, 23 | LazerId = lazerCollection.ID 24 | }; 25 | 26 | foreach (string hash in lazerCollection.BeatmapMD5Hashes) 27 | { 28 | collection.AddBeatmapByHash(hash); 29 | } 30 | 31 | yield return collection; 32 | } 33 | } 34 | 35 | public void Write(Collections collections, string realmFilePath) 36 | { 37 | using Realm localRealm = GetRealm(realmFilePath, false); 38 | 39 | localRealm.Write(() => 40 | { 41 | localRealm.RemoveRange(localRealm.All()); 42 | 43 | foreach (ICollection cmCollection in collections) 44 | { 45 | BeatmapCollection realmCollection = new() 46 | { 47 | ID = Guid.NewGuid(), 48 | Name = cmCollection.Name 49 | }; 50 | 51 | foreach (BeatmapExtension beatmap in cmCollection.AllBeatmaps()) 52 | { 53 | realmCollection.BeatmapMD5Hashes.Add(beatmap.Md5); 54 | } 55 | 56 | _ = localRealm.Add(realmCollection); 57 | } 58 | }); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuBinaryReader.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Text; 3 | using CollectionManager.Annotations; 4 | 5 | namespace CollectionManager.Modules.FileIO 6 | { 7 | public class OsuBinaryReader : BinaryReader 8 | { 9 | public OsuBinaryReader([NotNull] Stream input) : base(input) 10 | { 11 | } 12 | 13 | public OsuBinaryReader([NotNull] Stream input, [NotNull] Encoding encoding) : base(input, encoding) 14 | { 15 | } 16 | 17 | public override string ReadString() 18 | { 19 | if (ReadByte() == 11) 20 | return base.ReadString(); 21 | else 22 | return ""; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuBinaryWriter.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Text; 3 | 4 | namespace CollectionManager.Modules.FileIO 5 | { 6 | public class OsuBinaryWriter:BinaryWriter 7 | { 8 | public OsuBinaryWriter(Stream output) : base(output) 9 | { 10 | } 11 | 12 | public OsuBinaryWriter(Stream output, Encoding encoding) : base(output, encoding) 13 | { 14 | } 15 | 16 | public override void Write(string value) 17 | { 18 | if (string.IsNullOrEmpty(value)) 19 | Write((byte)0); 20 | else 21 | { 22 | Write((byte)11); 23 | base.Write(value); 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuDb/LOsuDatabaseLoader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using CollectionManager.DataTypes; 4 | using CollectionManager.Interfaces; 5 | 6 | namespace CollectionManager.Modules.FileIO.OsuDb 7 | { 8 | public class LOsuDatabaseLoader : OsuDatabaseLoader 9 | { 10 | private ILogger logger; 11 | public string status { get; private set; } 12 | public LOsuDatabaseLoader(IMapDataManager mapDataStorer, Beatmap tempBeatmap) : base(mapDataStorer, tempBeatmap) 13 | { 14 | } 15 | 16 | protected override bool FileExists(string fullPath) 17 | { 18 | var result = base.FileExists(fullPath); 19 | if (!result) 20 | logger?.Log($"File \"{fullPath}\" doesn't exist!"); 21 | return result; 22 | } 23 | 24 | public override void LoadDatabase(string fullOsuDbPath, IProgress progress, CancellationToken cancellationToken) 25 | { 26 | status = "Loading database"; 27 | base.LoadDatabase(fullOsuDbPath, progress, cancellationToken); 28 | status = $"Loaded {NumberOfLoadedBeatmaps} beatmaps"; 29 | } 30 | 31 | protected override void ReadDatabaseEntries(IProgress progress, CancellationToken cancellationToken) 32 | { 33 | try 34 | { 35 | base.ReadDatabaseEntries(progress, cancellationToken); 36 | } 37 | catch (Exception e) 38 | { 39 | logger?.Log("Something went wrong while processing beatmaps(database is corrupt or its format changed)"); 40 | logger?.Log("Try restarting your osu! first before reporting this problem."); 41 | logger?.Log("Exception: {0},{1}", e.Message, e.StackTrace); 42 | status = "Failed with exception " + $"Exception: {e.Message},{e.StackTrace}"; 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuDb/OsuDatabase.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | using CollectionManager.Interfaces; 3 | using CollectionManager.Modules.FileIO.OsuLazerDb; 4 | using System; 5 | using System.IO; 6 | using System.Threading; 7 | 8 | namespace CollectionManager.Modules.FileIO.OsuDb 9 | { 10 | public class OsuDatabase 11 | { 12 | public MapCacher LoadedMaps = new MapCacher(); 13 | private readonly OsuDatabaseLoader _osuDatabaseLoader; 14 | private readonly OsuLazerDatabase _lazerDatabaseLoader; 15 | private readonly IScoreDataManager _scoresDatabase; 16 | 17 | public string OsuFileLocation { get; private set; } 18 | public string SongsFolderLocation { get; set; } 19 | public int NumberOfBeatmapsWithoutId { get; set; } 20 | 21 | public bool DatabaseIsLoaded => _osuDatabaseLoader.LoadedSuccessfully; 22 | public string Status => ((LOsuDatabaseLoader)_osuDatabaseLoader).status; 23 | public int NumberOfBeatmaps => LoadedMaps.Beatmaps.Count; 24 | public string Username => _osuDatabaseLoader.Username; 25 | 26 | public OsuDatabase(Beatmap beatmapBase, IScoreDataManager scoresDatabase) 27 | { 28 | _osuDatabaseLoader = new LOsuDatabaseLoader(LoadedMaps, beatmapBase); 29 | _lazerDatabaseLoader = new OsuLazerDatabase(LoadedMaps, scoresDatabase); 30 | _scoresDatabase = scoresDatabase; 31 | } 32 | 33 | public bool Load(string fileDir, IProgress progress, CancellationToken cancellationToken) 34 | { 35 | var fileExtension = Path.GetExtension(fileDir)?.ToLower(); 36 | OsuFileLocation = fileDir; 37 | 38 | switch (fileExtension) 39 | { 40 | case ".db": 41 | _osuDatabaseLoader.LoadDatabase(fileDir, progress, cancellationToken); 42 | break; 43 | case ".realm": 44 | _lazerDatabaseLoader.Load(fileDir, progress, cancellationToken); 45 | break; 46 | default: 47 | OsuFileLocation = null; 48 | return false; 49 | } 50 | 51 | return true; 52 | } 53 | 54 | public void Load(string fileDir, IProgress progress = null) => Load(fileDir, progress, CancellationToken.None); 55 | 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuFileIo.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | using CollectionManager.Interfaces; 3 | using CollectionManager.Modules.FileIO.FileCollections; 4 | using CollectionManager.Modules.FileIO.OsuDb; 5 | using CollectionManager.Modules.FileIO.OsuScoresDb; 6 | 7 | namespace CollectionManager.Modules.FileIO 8 | { 9 | public class OsuFileIo 10 | { 11 | public OsuDatabase OsuDatabase; 12 | public OsuSettingsLoader OsuSettings = new OsuSettingsLoader(); 13 | public CollectionLoader CollectionLoader; 14 | public OsuPathResolver OsuPathResolver => OsuPathResolver.Instance; 15 | public MapCacher LoadedMaps => OsuDatabase.LoadedMaps; 16 | 17 | public ScoresDatabaseIo ScoresLoader; 18 | public IScoreDataManager ScoresDatabase = new ScoresCacher(); 19 | 20 | public OsuFileIo(Beatmap beatmapBase) 21 | { 22 | OsuDatabase = new OsuDatabase(beatmapBase, ScoresDatabase); 23 | CollectionLoader = new CollectionLoader(OsuDatabase.LoadedMaps); 24 | ScoresLoader = new ScoresDatabaseIo(ScoresDatabase); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/BeatmapOnlineStatus.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManager.Modules.FileIO.OsuLazerDb; 2 | 3 | internal enum BeatmapOnlineStatus 4 | { 5 | LocallyModified = -4, 6 | None = -3, 7 | Graveyard = -2, 8 | WIP = -1, 9 | Pending = 0, 10 | Ranked = 1, 11 | Approved = 2, 12 | Qualified = 3, 13 | Loved = 4, 14 | } 15 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/RealmModels/BeatmapCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Realms; 4 | 5 | namespace CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; 6 | internal partial class BeatmapCollection 7 | : IRealmObject 8 | { 9 | [PrimaryKey] 10 | public Guid ID { get; set; } 11 | 12 | public string Name { get; set; } = string.Empty; 13 | 14 | public IList BeatmapMD5Hashes { get; } 15 | 16 | public DateTimeOffset LastModified { get; set; } 17 | } 18 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/RealmModels/BeatmapDifficulty.cs: -------------------------------------------------------------------------------- 1 | using Realms; 2 | 3 | namespace CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; 4 | internal partial class BeatmapDifficulty 5 | : IEmbeddedObject 6 | { 7 | public const float DEFAULT_DIFFICULTY = 5; 8 | 9 | public float DrainRate { get; set; } 10 | public float CircleSize { get; set; } 11 | public float OverallDifficulty { get; set; } 12 | public float ApproachRate { get; set; } 13 | 14 | public double SliderMultiplier { get; set; } = 1.4; 15 | public double SliderTickRate { get; set; } = 1; 16 | } 17 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/RealmModels/BeatmapMetadata.cs: -------------------------------------------------------------------------------- 1 | using Realms; 2 | 3 | namespace CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; 4 | internal partial class BeatmapMetadata 5 | : IRealmObject 6 | { 7 | public string Title { get; set; } = string.Empty; 8 | 9 | public string TitleUnicode { get; set; } = string.Empty; 10 | 11 | public string Artist { get; set; } = string.Empty; 12 | 13 | public string ArtistUnicode { get; set; } = string.Empty; 14 | 15 | public RealmUser Author { get; set; } = null!; 16 | 17 | public string Source { get; set; } = string.Empty; 18 | 19 | public string Tags { get; set; } = string.Empty; 20 | 21 | public int PreviewTime { get; set; } = -1; 22 | 23 | public string AudioFile { get; set; } = string.Empty; 24 | 25 | public string BackgroundFile { get; set; } = string.Empty; 26 | } 27 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/RealmModels/BeatmapUserSettings.cs: -------------------------------------------------------------------------------- 1 | using Realms; 2 | 3 | namespace CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; 4 | internal partial class BeatmapUserSettings 5 | : IEmbeddedObject 6 | { 7 | /// 8 | /// An audio offset that can be used for timing adjustments. 9 | /// 10 | public double Offset { get; set; } 11 | } 12 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/RealmModels/Enums/APIUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels.Enums; 6 | internal class APIUser 7 | { 8 | } 9 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/RealmModels/Enums/HitResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | public enum HitResult 4 | { 5 | None, 6 | Miss, 7 | Meh, 8 | Ok, 9 | Good, 10 | Great, 11 | Perfect, 12 | SmallTickMiss, 13 | SmallTickHit, 14 | LargeTickMiss, 15 | LargeTickHit, 16 | SmallBonus, 17 | LargeBonus, 18 | IgnoreMiss, 19 | IgnoreHit, 20 | ComboBreak, 21 | SliderTailHit, 22 | [Obsolete("Do not use.")] 23 | LegacyComboIncrease = 99 24 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/RealmModels/Enums/Mod.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels.Enums; 2 | 3 | internal struct Mod 4 | { 5 | public string Name { get; set; } 6 | public string Acronym { get; set; } 7 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/RealmModels/Enums/ScoreRank.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels.Enums; 2 | public enum ScoreRank 3 | { 4 | F = -1, 5 | D, 6 | C, 7 | B, 8 | A, 9 | S, 10 | SH, 11 | X, 12 | XH, 13 | } 14 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/RealmModels/RealmFile.cs: -------------------------------------------------------------------------------- 1 | using Realms; 2 | using System.Linq; 3 | 4 | namespace CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; 5 | [MapTo("File")] 6 | internal partial class RealmFile 7 | : IRealmObject 8 | { 9 | [PrimaryKey] 10 | public string Hash { get; set; } = string.Empty; 11 | 12 | [Backlink(nameof(RealmNamedFileUsage.File))] 13 | public IQueryable Usages { get; } = null!; 14 | } 15 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/RealmModels/RealmNamedFileUsage.cs: -------------------------------------------------------------------------------- 1 | using Realms; 2 | 3 | namespace CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; 4 | internal partial class RealmNamedFileUsage 5 | : IEmbeddedObject 6 | { 7 | public RealmFile File { get; set; } = null!; 8 | 9 | public string Filename { get; set; } = null!; 10 | } 11 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/RealmModels/RealmUser.cs: -------------------------------------------------------------------------------- 1 | using Realms; 2 | using System; 3 | 4 | namespace CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; 5 | internal partial class RealmUser 6 | : IEmbeddedObject 7 | { 8 | public int OnlineID { get; set; } = 1; 9 | 10 | public string Username { get; set; } = string.Empty; 11 | 12 | [Ignored] 13 | public CountryCode CountryCode 14 | { 15 | get => Enum.TryParse(CountryString, out CountryCode country) ? country : CountryCode.Unknown; 16 | set => CountryString = value.ToString(); 17 | } 18 | 19 | [MapTo(nameof(CountryCode))] 20 | public string CountryString { get; set; } = "N/A"; 21 | 22 | public bool IsBot => false; 23 | } 24 | 25 | public enum CountryCode 26 | { 27 | Unknown = 0, 28 | 29 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuLazerDb/RealmModels/RulesetInfo.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.Annotations; 2 | using Realms; 3 | using System; 4 | 5 | namespace CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; 6 | [MapTo("Ruleset")] 7 | internal partial class RulesetInfo 8 | : IRealmObject 9 | { 10 | [PrimaryKey] 11 | public string ShortName { get; set; } = string.Empty; 12 | 13 | [Indexed] 14 | public int OnlineID { get; set; } = -1; 15 | 16 | public string Name { get; set; } = string.Empty; 17 | 18 | public string InstantiationInfo { get; set; } = string.Empty; 19 | 20 | /// 21 | /// Stores the last applied 22 | /// 23 | public int LastAppliedDifficultyVersion { get; set; } 24 | 25 | public RulesetInfo(string shortName, string name, string instantiationInfo, int onlineID) 26 | { 27 | ShortName = shortName; 28 | Name = name; 29 | InstantiationInfo = instantiationInfo; 30 | OnlineID = onlineID; 31 | } 32 | 33 | [UsedImplicitly] 34 | public RulesetInfo() 35 | { 36 | } 37 | 38 | public bool Available { get; set; } 39 | 40 | public bool Equals(RulesetInfo? other) 41 | { 42 | if (ReferenceEquals(this, other)) return true; 43 | if (other == null) return false; 44 | 45 | return ShortName == other.ShortName; 46 | } 47 | 48 | public int CompareTo(RulesetInfo? other) 49 | { 50 | if (OnlineID >= 0 && other?.OnlineID >= 0) 51 | return OnlineID.CompareTo(other.OnlineID); 52 | 53 | // Official rulesets are always given precedence for the time being. 54 | if (OnlineID >= 0) 55 | return -1; 56 | if (other?.OnlineID >= 0) 57 | return 1; 58 | 59 | return string.Compare(ShortName, other?.ShortName, StringComparison.Ordinal); 60 | } 61 | 62 | public override string ToString() => Name; 63 | 64 | public RulesetInfo Clone() => new RulesetInfo 65 | { 66 | OnlineID = OnlineID, 67 | Name = Name, 68 | ShortName = ShortName, 69 | InstantiationInfo = InstantiationInfo, 70 | Available = Available, 71 | LastAppliedDifficultyVersion = LastAppliedDifficultyVersion, 72 | }; 73 | } 74 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuRealmReader.cs: -------------------------------------------------------------------------------- 1 | using Realms; 2 | using Realms.Exceptions; 3 | using System; 4 | using System.Text.RegularExpressions; 5 | 6 | namespace CollectionManager.Modules.FileIO; 7 | 8 | public class OsuRealmReader 9 | { 10 | private const ulong _lastValidatedRealmSchemaVersion = 48; 11 | private static readonly Regex _lastNumber = new("(\\d+)(?!.*\\d)", RegexOptions.Compiled); 12 | 13 | protected static Realm GetRealm(string realmFilePath, bool readOnly = true) 14 | { 15 | RealmConfiguration config = new(realmFilePath) 16 | { 17 | IsReadOnly = readOnly, 18 | SchemaVersion = _lastValidatedRealmSchemaVersion 19 | }; 20 | 21 | try 22 | { 23 | return Realm.GetInstance(config); 24 | } 25 | catch (RealmException exception) 26 | { 27 | const string RealmFileVersionMismatchMessage = "because it has a file format version"; 28 | 29 | if (exception.Message.Contains(RealmFileVersionMismatchMessage)) 30 | { 31 | throw new RealmNotValidatedException($"Opening osu!lazer database failed. Consider reporting this on github. {exception.Message}"); 32 | } 33 | 34 | Match numberMatch = _lastNumber.Match(exception.Message); 35 | string schemaVersionOrMessage = numberMatch.Success 36 | ? numberMatch.Value 37 | : exception.Message; 38 | 39 | throw new RealmNotValidatedException($"Opening osu!lazer database failed. " + 40 | $"Expected schema version: '{_lastValidatedRealmSchemaVersion}', " + 41 | $"got: '{schemaVersionOrMessage}'. Consider reporting this on github."); 42 | } 43 | } 44 | 45 | public class RealmNotValidatedException(string message) 46 | : Exception(message) 47 | { 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuScoresDb/ScoresCacher.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using CollectionManager.DataTypes; 4 | using CollectionManager.Interfaces; 5 | 6 | namespace CollectionManager.Modules.FileIO.OsuScoresDb 7 | { 8 | public class ScoresCacher : IScoreDataManager 9 | { 10 | public Dictionary ScoreList = new Dictionary(); 11 | public Scores Scores { get; private set; } = new Scores(); 12 | public HashSet ScoreHashes { get; private set; } = new HashSet(); 13 | public void StartMassStoring() 14 | { 15 | } 16 | 17 | public void EndMassStoring() 18 | { 19 | } 20 | 21 | public void Clear() 22 | { 23 | ScoreList.Clear(); 24 | Scores.Clear(); 25 | ScoreHashes.Clear(); 26 | } 27 | 28 | public Scores GetScores(Beatmap map) 29 | => GetScores(map.Md5); 30 | 31 | public Scores GetScores(string mapHash) 32 | => ScoreList.FirstOrDefault(s => s.Key.Equals(mapHash)).Value; 33 | 34 | public void Remove(string mapHash) 35 | { 36 | if (ScoreList.ContainsKey(mapHash)) 37 | { 38 | foreach (var score in ScoreList[mapHash]) 39 | { 40 | Scores.Remove(score); 41 | ScoreHashes.Remove(score.ReplayHash); 42 | } 43 | ScoreList.Remove(mapHash); 44 | } 45 | } 46 | public void Store(IReplay replay) 47 | { 48 | if (ScoreHashes.Contains(replay.ReplayHash)) 49 | return; 50 | 51 | ScoreHashes.Add(replay.ReplayHash); 52 | 53 | if (ScoreList.ContainsKey(replay.MapHash)) 54 | ScoreList[replay.MapHash].Add(replay); 55 | else 56 | ScoreList.Add(replay.MapHash, new Scores() { replay }); 57 | Scores.Add(replay); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /CollectionManagerDll/Modules/FileIO/OsuSettingsLoader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace CollectionManager.Modules.FileIO 5 | { 6 | public sealed class OsuSettingsLoader 7 | { 8 | public string CustomBeatmapDirectoryLocation { get; private set; }= "Songs"; 9 | 10 | public OsuSettingsLoader() 11 | { 12 | 13 | } 14 | public void Load(string osuDirectory) 15 | { 16 | string FilePath = GetConfigFilePath(osuDirectory); 17 | var configFileExists = File.Exists(FilePath); 18 | if (configFileExists) 19 | ReadSettings(FilePath); 20 | 21 | var lazerFilesPath = Path.Combine(osuDirectory, "files"); 22 | var osuSongsPath = Path.Combine(osuDirectory, "Songs"); 23 | if (Path.IsPathRooted(osuDirectory) && Directory.Exists(lazerFilesPath)) 24 | { 25 | // Assuming osu!lazer 26 | CustomBeatmapDirectoryLocation = lazerFilesPath; 27 | } 28 | else if (CustomBeatmapDirectoryLocation == "Songs" && Directory.Exists(osuSongsPath)) 29 | { 30 | CustomBeatmapDirectoryLocation = osuSongsPath; 31 | } 32 | 33 | } 34 | private string GetConfigFilePath(string osuDirectory) 35 | { 36 | string filename = string.Format("osu!.{0}.cfg", StripInvalidCharacters(Environment.UserName)); 37 | return Path.Combine(osuDirectory, filename); 38 | } 39 | 40 | private string StripInvalidCharacters(string name) 41 | { 42 | foreach (var invalidChar in Path.GetInvalidFileNameChars()) 43 | { 44 | name = name.Replace(invalidChar.ToString(), string.Empty); 45 | } 46 | return name.Replace(".", string.Empty); 47 | } 48 | private void ReadSettings(string configPath) 49 | { 50 | foreach (var cfgLine in File.ReadLines(configPath)) 51 | { 52 | if (cfgLine.StartsWith("BeatmapDirectory")) 53 | { 54 | var splitedLines = cfgLine.Split(new[] { '=' }, 2); 55 | var songDirectory = splitedLines[1].Trim(' '); 56 | 57 | if (songDirectory != "Songs") 58 | CustomBeatmapDirectoryLocation = songDirectory; 59 | } 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /CollectionManagerDll/Properties/Annotations.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /CollectionManagerDll/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // Setting ComVisible to false makes the types in this assembly not visible 5 | // to COM components. If you need to access a type in this assembly from 6 | // COM, set the ComVisible attribute to true on that type. 7 | [assembly: ComVisible(false)] 8 | 9 | // The following GUID is for the ID of the typelib if this project is exposed to COM 10 | [assembly: Guid("533ab47a-d1b5-45db-a37e-f053fa3699c4")] 11 | -------------------------------------------------------------------------------- /CollectionManagerDllTests/CollectionManagerDllTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net472 4 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 7 | False 8 | UnitTest 9 | CollectionManagerDllTests 10 | CollectionManagerDllTests 11 | Copyright © 2017 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /CollectionManagerDllTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("4964f085-11b8-4ce0-bde8-2894e2b48ae0")] 12 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/CollectionManagerExtensionsDll.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | netstandard20;netstandard21 4 | CollectionManagerExtensionsDll 5 | CollectionManagerExtensionsDll 6 | Copyright © 2017 7 | 11.0 8 | 9 | 10 | true 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | Component 22 | 23 | 24 | Component 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/DataTypes/ApiScore.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace CollectionManagerExtensionsDll.DataTypes 7 | { 8 | public class ApiScore 9 | { 10 | public int BeatmapId { get; set; } 11 | public int Score { get; set; } 12 | public string Username { get; set; } 13 | public int Count300 { get; set; } 14 | public int Count100 { get; set; } 15 | public int Count50 { get; set; } 16 | public int Countmiss { get; set; } 17 | public int Maxcombo { get; set; } 18 | public int Countkatu { get; set; } 19 | public int Countgeki { get; set; } 20 | public int Perfect { get; set; } 21 | public int EnabledMods { get; set; } 22 | public int UserId { get; set; } 23 | public DateTime Date { get; set; } 24 | public string Rank { get; set; } 25 | public double Pp { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/DataTypes/CollectionGeneratorConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace CollectionManagerExtensionsDll.DataTypes 4 | { 5 | public class CollectionGeneratorConfiguration 6 | { 7 | /// 8 | /// string.format pattern target for saving collection name 9 | /// {0} - username 10 | /// {1} - Mods used in specific play 11 | /// 12 | public string CollectionNameSavePattern { get; set; } 13 | 14 | /// 15 | /// List of usernames to process. 16 | /// 17 | public List Usernames { get; set; } = new List(); 18 | 19 | /// 20 | /// api key that should be used to get data 21 | /// 22 | public string ApiKey { get; set; } = ""; 23 | 24 | /// 25 | /// Gamemode to get top scores from 26 | /// 27 | public int Gamemode { get; set; } 28 | 29 | public ScoreSaveConditions ScoreSaveConditions; 30 | 31 | } 32 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Enums/CollectionListSaveType.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManagerExtensionsDll.Enums 2 | { 3 | public enum CollectionListSaveType 4 | { 5 | Txt, 6 | Html, 7 | osuBBCode, 8 | RedditCode, 9 | BeatmapList, 10 | UserDefined 11 | } 12 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/API/BeatmapExtensionEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CollectionManager.DataTypes; 3 | 4 | namespace CollectionManagerExtensionsDll.Modules.API 5 | { 6 | public class BeatmapExtensionEx : BeatmapExtension 7 | { 8 | public DateTime ApprovedDate { get; set; } 9 | public int GenreId { get; set; } 10 | public int LanguageId { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/API/osustats/UserInformation.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManagerExtensionsDll.Modules.API.osustats 2 | { 3 | public class UserInformation 4 | { 5 | public string UserName { get; set; } 6 | public int OsuUserId { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/BeatmapExporter/BeatmapSetExport.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | using System.IO; 3 | 4 | namespace CollectionManagerExtensionsDll.Modules.BeatmapExporter; 5 | 6 | public abstract record BeatmapSetExport(Beatmap Source, string TargetFileName) 7 | { 8 | public string TargetFilePath(string saveDirectory) => Path.Combine(saveDirectory, TargetFileName); 9 | } 10 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/BeatmapExporter/BeatmapSetExportException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CollectionManagerExtensionsDll.Modules.BeatmapExporter; 4 | 5 | public class BeatmapSetExportException : Exception 6 | { 7 | public BeatmapSetExportException(string message, Exception innerException) 8 | : base(message, innerException) { } 9 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/BeatmapExporter/LazerBeatmapSetExport.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | 3 | namespace CollectionManagerExtensionsDll.Modules.BeatmapExporter; 4 | 5 | public record LazerBeatmapSetExport(Beatmap Source, string TargetFileName, LazerFile[] SetFiles) 6 | : BeatmapSetExport(Source, TargetFileName); 7 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/BeatmapExporter/StableBeatmapSetExport.cs: -------------------------------------------------------------------------------- 1 | using CollectionManager.DataTypes; 2 | 3 | namespace CollectionManagerExtensionsDll.Modules.BeatmapExporter; 4 | 5 | public record StableBeatmapSetExport(Beatmap Source, string TargetFileName, string SourceDirectory) 6 | : BeatmapSetExport(Source, TargetFileName); 7 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/CollectionListGenerator/BeatmapType.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManagerExtensionsDll.Modules.CollectionListGenerator 2 | { 3 | public enum BeatmapListType 4 | { 5 | All, Known, NotKnown, Downloadable 6 | } 7 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/CollectionListGenerator/IListGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using CollectionManager.DataTypes; 6 | 7 | namespace CollectionManagerExtensionsDll.Modules.CollectionListGenerator 8 | { 9 | public interface IListGenerator 10 | { 11 | void StartGenerating(); 12 | void EndGenerating(); 13 | string GetListHeader(Collections collections); 14 | string GetCollectionBody(ICollection collection, Dictionary mapSets, int collectionNumber); 15 | string GetListFooter(Collections collections); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/CollectionListGenerator/ListTypes/BeatmapListGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CollectionManagerExtensionsDll.Modules.CollectionListGenerator.ListTypes 4 | { 5 | internal class BeatmapListGenerator : GenericGenerator 6 | { 7 | protected override string MainHeader { get; } = "Name Difficulty ★" + Environment.NewLine; 8 | protected override string MainFooter { get; } = ""; 9 | protected override string CollectionBodyFormat { get; } = "{5} [{3}] {4}★" + Environment.NewLine; 10 | protected override string CollectionFooter { get; } = ""; 11 | protected override string CollectionHeaderTemplate { get; } = ""; 12 | } 13 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/CollectionListGenerator/ListTypes/OsuBbCodeGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using CollectionManager.DataTypes; 5 | 6 | namespace CollectionManagerExtensionsDll.Modules.CollectionListGenerator.ListTypes 7 | { 8 | internal class OsuBbCodeGenerator : GenericGenerator 9 | { 10 | protected override string CollectionBodyFormat { get; } = Environment.NewLine + "[*][url={0}]{1} ({2})[/url]"; 11 | 12 | protected override string CollectionFooter { get; } = "[/list]"; 13 | 14 | protected override string CollectionHeaderTemplate { get; } = Environment.NewLine + Environment.NewLine + "[centre][size=150][b]{0}[/b][/size][/centre][list]"; 15 | 16 | protected override string MainFooter { get; } = "[/notice]"; 17 | 18 | protected override string MainHeader { get; } = "[notice]"; 19 | } 20 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/CollectionListGenerator/ListTypes/RedditCodeGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CollectionManagerExtensionsDll.Modules.CollectionListGenerator.ListTypes 4 | { 5 | internal class RedditCodeGenerator : GenericGenerator 6 | { 7 | protected override string MainHeader { get; } = "|Name|Difficulty|BeatmapId|★|" + Environment.NewLine + "|---|---|---|:-:|"; 8 | protected override string MainFooter { get; } = ""; 9 | protected override string CollectionBodyFormat { get; } = Environment.NewLine + "{5}|{3}|{0}|{4}★"; 10 | protected override string CollectionFooter { get; } = ""; 11 | protected override string CollectionHeaderTemplate { get; } = ""; 12 | } 13 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/DownloadManager/API/CookieContainerExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Net; 5 | using System.Reflection; 6 | 7 | namespace CollectionManagerExtensionsDll.Modules.DownloadManager.API 8 | { 9 | public static class CookieContainerExtensions 10 | { 11 | /// 12 | /// Get List of s contained in using reflection 13 | /// 14 | /// 15 | /// 16 | public static List ToList(this CookieContainer container) 17 | { 18 | var cookies = new List(); 19 | 20 | var table = (Hashtable)container.GetType().InvokeMember("m_domainTable", 21 | BindingFlags.NonPublic | 22 | BindingFlags.GetField | 23 | BindingFlags.Instance, 24 | null, 25 | container, 26 | new object[] { }); 27 | 28 | foreach (var key in table.Keys) 29 | { 30 | 31 | Uri uri = null; 32 | 33 | var domain = key as string; 34 | 35 | if (domain == null) 36 | continue; 37 | 38 | if (domain.StartsWith(".")) 39 | domain = domain.Substring(1); 40 | 41 | var address = string.Format("http://{0}/", domain); 42 | 43 | if (Uri.TryCreate(address, UriKind.RelativeOrAbsolute, out uri) == false) 44 | continue; 45 | 46 | foreach (Cookie cookie in container.GetCookies(uri)) 47 | { 48 | cookies.Add(cookie); 49 | } 50 | } 51 | 52 | return cookies; 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/DownloadManager/API/DownloadProgress.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CollectionManagerExtensionsDll.Modules.DownloadManager.API 4 | { 5 | internal class DownloadProgress 6 | { 7 | public long SameValue = 0; 8 | public long LastBytesRecived { get; set; } = -2; 9 | public long bytesRecived { get; set; } = -1; 10 | public DownloadItem downloadItem { get; set; } = null; 11 | public bool IsStalled() 12 | { 13 | if (downloadItem == null) 14 | return false; 15 | if (bytesRecived == LastBytesRecived) 16 | { 17 | SameValue++; 18 | return SameValue > 1; 19 | } 20 | SameValue = 0; 21 | return false; 22 | } 23 | 24 | public void Process() 25 | { 26 | LastBytesRecived = bytesRecived; 27 | } 28 | 29 | public void Reset() 30 | { 31 | LastBytesRecived = -2; 32 | bytesRecived = -1; 33 | SameValue = 0; 34 | downloadItem = null; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/DownloadManager/API/DownloadProgressReportEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CollectionManagerExtensionsDll.Modules.DownloadManager.API 4 | { 5 | public class DownloadProgressReportEventArgs :EventArgs 6 | { 7 | public DownloadProgressReportEventArgs(long id) 8 | { 9 | this.Id = id; 10 | } 11 | public string Url { get; set; } 12 | public string FileName { get; set; } 13 | public long Id { get; private set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/DownloadManager/API/LoginData.cs: -------------------------------------------------------------------------------- 1 | namespace CollectionManagerExtensionsDll.Modules.DownloadManager.API 2 | { 3 | public class LoginData 4 | { 5 | public string Username { get; set; } 6 | public string Password { get; set; } 7 | public string SiteCookies { get; set; } 8 | public string DownloadSource { get; set; } 9 | 10 | public bool IsValid() 11 | { 12 | if ((string.IsNullOrWhiteSpace(Username) || string.IsNullOrWhiteSpace(Password)) && string.IsNullOrWhiteSpace(SiteCookies)) 13 | return false; 14 | 15 | return (Username?.Length > 2 && Password?.Length > 5) || !string.IsNullOrWhiteSpace(SiteCookies); 16 | } 17 | 18 | public override string ToString() 19 | { 20 | var cookiesSet = !string.IsNullOrEmpty(SiteCookies); 21 | var userAndPasswordSet = !(string.IsNullOrEmpty(Username) && string.IsNullOrEmpty(Username)); 22 | return $"Source: {DownloadSource}, {(cookiesSet ? "With cookies" : userAndPasswordSet ? "With user/pass" : "No login")}"; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/DownloadManager/GenericMapDownloader.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using CollectionManagerExtensionsDll.Modules.DownloadManager.API; 3 | 4 | namespace CollectionManagerExtensionsDll.Modules.DownloadManager 5 | { 6 | public class GenericMapDownloader : API.DownloadManager 7 | { 8 | public DownloadThrottler DownloadThrottler { get; private set; } 9 | 10 | public GenericMapDownloader(string saveLocation, int downloadThreads, int downloadsPerMinute, int downloadsPerHour) : base(saveLocation, downloadThreads) 11 | { 12 | DownloadThrottler = new DownloadThrottler(downloadsPerMinute, downloadsPerHour); 13 | } 14 | 15 | public override bool CanDownload(DownloadItem downloadItem) 16 | { 17 | if (DownloadThrottler.CanDownload()) 18 | { 19 | downloadItem.DownloadSlotStatus = null; 20 | return true; 21 | } 22 | 23 | downloadItem.DownloadSlotStatus = DownloadThrottler.GetStatus(); 24 | return false; 25 | } 26 | 27 | protected override void DownloadCompleted(object sender, AsyncCompletedEventArgs e) 28 | { 29 | if (e.Error == null) 30 | DownloadThrottler.RegisterDownload(); 31 | 32 | base.DownloadCompleted(sender, e); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Modules/DownloadManager/ILoginForm.cs: -------------------------------------------------------------------------------- 1 | using CollectionManagerExtensionsDll.Modules.DownloadManager.API; 2 | 3 | namespace CollectionManagerExtensionsDll.Modules.DownloadManager 4 | { 5 | public interface ILoginForm 6 | { 7 | LoginData GetLoginData(); 8 | } 9 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("2bdf5d5f-1cb0-47a6-8138-e4db961740f2")] 12 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Utils/CompilerServices.cs: -------------------------------------------------------------------------------- 1 | #if NET48 || NETSTANDARD 2 | namespace System.Runtime.CompilerServices 3 | { 4 | [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] 5 | internal static class IsExternalInit { } 6 | } 7 | #endif -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Utils/ImpatientWebClient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | 4 | namespace CollectionManagerExtensionsDll.Utils 5 | { 6 | public class ImpatientWebClient:WebClient 7 | { 8 | private int _timeout = 10000; 9 | /// 10 | /// 11 | /// 12 | /// After how many miliseconds stalled request should raise exception 13 | public ImpatientWebClient(int timeout=5000) : base() 14 | { 15 | _timeout = timeout; 16 | } 17 | protected override WebRequest GetWebRequest(Uri uri) 18 | { 19 | WebRequest w = base.GetWebRequest(uri); 20 | w.Timeout = _timeout;//Default time is 100s ... 21 | return w; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDll/Utils/ListGeneratorUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CollectionManager.DataTypes; 3 | using CollectionManagerExtensionsDll.Utils; 4 | 5 | namespace CollectionManagerExtensionsDll.Modules.CollectionListGenerator.ListTypes 6 | { 7 | public static class CollectionUtils 8 | { 9 | /// 10 | /// Returns grouped beatmaps using MapSetId 11 | /// 12 | /// 13 | /// Dictionary containing MapSetId as key and corresponding beatmaps in value. 14 | /// beatmaps with invalid MapSetId (less than 1) are placed under key "-1" 15 | /// 16 | public static Dictionary GetBeatmapSets(this ICollection collection) 17 | => BeatmapUtils.GetBeatmapSets(collection.AllBeatmaps()); 18 | } 19 | } -------------------------------------------------------------------------------- /CollectionManagerExtensionsDllTests/CollectionManagerExtensionsDllTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net472 4 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 7 | False 8 | UnitTest 9 | CollectionManagerExtensionsDllTests 10 | CollectionManagerExtensionsDllTests 11 | Copyright © 2017 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CollectionManagerExtensionsDllTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("0c2e6c9e-8fae-43ee-ba81-a66d44f97eb1")] 12 | -------------------------------------------------------------------------------- /Common/BeatmapListingAction.cs: -------------------------------------------------------------------------------- 1 | namespace Common 2 | { 3 | public enum BeatmapListingAction 4 | { 5 | DeleteBeatmapsFromCollection, //Remove maps from current collection 6 | DownloadBeatmaps, // Open download links using (?)default browser 7 | DownloadBeatmapsManaged, // Download selected beatmaps using internal downloader 8 | OpenBeatmapPages, // Open beatmap pages in (?)default browser 9 | OpenBeatmapFolder, //Open currently selected beatmap folder(s?) 10 | CopyBeatmapsAsText, //Copy text representation of selected beatmaps 11 | CopyBeatmapsAsUrls, //Copy map links of selected beatmaps 12 | PullWholeMapSet, //Finds all mapsets from selected maps and adds them to current collection 13 | ExportBeatmapSets, //Compress selected mapsets back to .osz archives 14 | } 15 | } -------------------------------------------------------------------------------- /Common/Common.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net48 4 | Common 5 | Common 6 | Copyright © 2017 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Common/EventArgs/EventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gui.Misc 4 | { 5 | public class EventArgs :EventArgs 6 | { 7 | public T Value { get; } 8 | 9 | public EventArgs(T value) 10 | { 11 | Value = value; 12 | } 13 | 14 | } 15 | } -------------------------------------------------------------------------------- /Common/EventArgs/FloatEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gui.Misc 4 | { 5 | public class FloatEventArgs : EventArgs 6 | { 7 | public FloatEventArgs(float value) 8 | { 9 | Value = value; 10 | } 11 | 12 | public float Value { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /Common/EventArgs/IntEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gui.Misc 4 | { 5 | public class IntEventArgs : EventArgs 6 | { 7 | public IntEventArgs(int value) 8 | { 9 | Value = value; 10 | } 11 | 12 | public int Value { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /Common/EventArgs/StringEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Gui.Misc 4 | { 5 | public class StringEventArgs : EventArgs 6 | { 7 | public StringEventArgs(string value) 8 | { 9 | Value = value; 10 | } 11 | public string Value { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Common/GuiHelpers.cs: -------------------------------------------------------------------------------- 1 | using BrightIdeasSoftware; 2 | using CollectionManager.DataTypes; 3 | using CollectionManager.Enums; 4 | using Common; 5 | 6 | namespace Gui.Misc 7 | { 8 | public static class GuiHelpers 9 | { 10 | public delegate void BeatmapsEventArgs(object sender, Beatmaps args); 11 | public delegate void CollectionBeatmapsEventArgs(object sender, Beatmaps args, string collectionName); 12 | public delegate void CollectionReorderEventArgs(object sender, Collections collections, Collection targetCollection, bool placeBefore, string sortColumn, SortOrder sortOrder); 13 | public delegate void BeatmapListingActionArgs(object sender, BeatmapListingAction args); 14 | public delegate void SidePanelActionsHandlerArgs(object sender, MainSidePanelActions args, object data = null); 15 | public delegate void LoadFileArgs(object sender, string[] filePaths); 16 | public delegate void StartupCollectionEventArgs(object sender, StartupCollectionAction args); 17 | public delegate void StartupDatabaseEventArgs(object sender, StartupDatabaseAction args); 18 | public delegate void ColumnsToggledEventArgs(object sender, string[] visibleCollumnAspectNames); 19 | } 20 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/IBeatmapListingView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using BrightIdeasSoftware; 5 | using CollectionManager.DataTypes; 6 | using CollectionManager.Enums; 7 | using Gui.Misc; 8 | 9 | namespace GuiComponents.Interfaces 10 | { 11 | public interface IBeatmapListingView 12 | { 13 | string SearchText { get; } 14 | string ResultText { get; set; } 15 | Beatmap SelectedBeatmap { get; } 16 | Beatmaps SelectedBeatmaps { get; } 17 | 18 | event EventHandler SearchTextChanged; 19 | event EventHandler SelectedBeatmapChanged; 20 | event EventHandler SelectedBeatmapsChanged; 21 | event GuiHelpers.BeatmapListingActionArgs BeatmapOperation; 22 | event GuiHelpers.BeatmapsEventArgs BeatmapsDropped; 23 | event GuiHelpers.ColumnsToggledEventArgs ColumnsToggled; 24 | 25 | void SetCurrentPlayMode(PlayMode playMode); 26 | void SetCurrentMods(Mods mods); 27 | void SetBeatmaps(IEnumerable beatmaps); 28 | void SetVisibleColumns(string[] visibleColumnsAspectNames); 29 | void SetFilter(IModelFilter filter); 30 | void FilteringStarted(); 31 | void FilteringFinished(); 32 | void ClearSelection(); 33 | void SelectNextOrFirst(); 34 | } 35 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/IBeatmapThumbnailView.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | 3 | namespace GuiComponents.Interfaces 4 | { 5 | public interface IBeatmapThumbnailView 6 | { 7 | Image beatmapImage { set; } 8 | string beatmapImageUrl { set; } 9 | string AR { set; } 10 | string CS { set; } 11 | string OD { set; } 12 | string Stars { set; } 13 | string BeatmapName { set; } 14 | 15 | } 16 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/ICollectionAddView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GuiComponents.Interfaces 4 | { 5 | public interface ICollectionAddView 6 | { 7 | event EventHandler CollectionNameChanged; 8 | event EventHandler Submited; 9 | event EventHandler Canceled; 10 | string NewCollectionName { get; set; } 11 | string ErrorText { set; } 12 | bool CanSubmit { set; } 13 | } 14 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/ICollectionListingView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using BrightIdeasSoftware; 4 | using CollectionManager.DataTypes; 5 | using Gui.Misc; 6 | 7 | namespace GuiComponents.Interfaces 8 | { 9 | public interface ICollectionListingView 10 | { 11 | event GuiHelpers.LoadFileArgs OnLoadFile; 12 | event GuiHelpers.CollectionReorderEventArgs OnCollectionReorder; 13 | 14 | string SearchText { get; } 15 | 16 | Collections Collections { set; } 17 | CollectionManager.DataTypes.ICollection SelectedCollection { get; set; } 18 | ArrayList SelectedCollections { get; } 19 | Collections HighlightedCollections { set; } 20 | 21 | event EventHandler SearchTextChanged; 22 | event EventHandler SelectedCollectionChanged; 23 | event EventHandler SelectedCollectionsChanged; 24 | event GuiHelpers.CollectionBeatmapsEventArgs BeatmapsDropped; 25 | event EventHandler RightClick; 26 | event GuiHelpers.ColumnsToggledEventArgs ColumnsToggled; 27 | 28 | void SetFilter(IModelFilter filter); 29 | void SetVisibleColumns(string[] visibleColumnsAspectNames); 30 | void FilteringStarted(); 31 | void FilteringFinished(); 32 | //void OnCollectionEditing(CollectionEditArgs e); 33 | 34 | } 35 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/ICollectionRenameView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GuiComponents.Interfaces 4 | { 5 | public interface ICollectionRenameView : ICollectionAddView 6 | { 7 | string OrginalCollectionName { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/ICollectionTextView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GuiComponents.Interfaces 4 | { 5 | public interface ICollectionTextView 6 | { 7 | string GeneratedText { set; } 8 | string SelectedSaveType { get; } 9 | event EventHandler SaveTypeChanged; 10 | void SetListTypes(Array types); 11 | } 12 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/ICombinedBeatmapPreviewView.cs: -------------------------------------------------------------------------------- 1 | namespace GuiComponents.Interfaces 2 | { 3 | public interface ICombinedBeatmapPreviewView 4 | { 5 | IBeatmapThumbnailView BeatmapThumbnailView { get; } 6 | IMusicControlView MusicControlView { get; } 7 | } 8 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/ICombinedListingView.cs: -------------------------------------------------------------------------------- 1 | namespace GuiComponents.Interfaces 2 | { 3 | public interface ICombinedListingView 4 | { 5 | IBeatmapListingView beatmapListingView { get; } 6 | ICollectionListingView CollectionListingView { get; } 7 | } 8 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/IDownloadManagerView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using CollectionManagerExtensionsDll.Modules.DownloadManager.API; 4 | 5 | namespace GuiComponents.Interfaces 6 | { 7 | public interface IDownloadManagerView 8 | { 9 | event EventHandler DownloadToggleClick; 10 | event EventHandler Disposed; 11 | 12 | bool DownloadButtonIsEnabled { set; } 13 | string DownloadButtonText { set; } 14 | void SetDownloadItems(ICollection downloadItems); 15 | void UpdateDownloadItem(DownloadItem downloadItem); 16 | } 17 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/IInfoTextView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GuiComponents.Interfaces 4 | { 5 | public interface IInfoTextView 6 | { 7 | bool ColorUpdateText { set; } 8 | string UpdateText { set; } 9 | string CollectionManagerStatus { set; } 10 | 11 | event EventHandler UpdateTextClicked; 12 | } 13 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/IMainSidePanelView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Gui.Misc; 3 | 4 | namespace GuiComponents.Interfaces 5 | { 6 | public interface IMainSidePanelView 7 | { 8 | event GuiHelpers.SidePanelActionsHandlerArgs SidePanelOperation; 9 | } 10 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/IMusicControlView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Gui.Misc; 3 | 4 | namespace GuiComponents.Interfaces 5 | { 6 | public interface IMusicControlView 7 | { 8 | event EventHandler PositionChanged; 9 | event EventHandler CheckboxChanged; 10 | event EventHandler PlayPressed; 11 | event EventHandler PausePressed; 12 | event EventHandler VolumeChanged; 13 | event EventHandler Disposed; 14 | 15 | float Volume { get; set; } 16 | int Position { get; set; } 17 | bool IsMusicPlayerMode { get; set; } 18 | bool IsAutoPlayEnabled { get; set; } 19 | bool IsDTEnabled { get; } 20 | bool IsUserSeeking { get; } 21 | 22 | void disableDt(); 23 | 24 | } 25 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/IStartupView.cs: -------------------------------------------------------------------------------- 1 | using Gui.Misc; 2 | 3 | namespace GuiComponents.Interfaces 4 | { 5 | public interface IStartupView 6 | { 7 | event GuiHelpers.StartupCollectionEventArgs StartupCollectionOperation; 8 | event GuiHelpers.StartupDatabaseEventArgs StartupDatabaseOperation; 9 | 10 | IInfoTextView InfoTextView { get; } 11 | 12 | string LoadDatabaseStatusText { get; set; } 13 | string CollectionStatusText { get; set; } 14 | bool UseSelectedOptionsOnStartup { get; set; } 15 | bool UseSelectedOptionsOnStartupEnabled { get; set; } 16 | bool CollectionButtonsEnabled { get; set; } 17 | bool DatabaseButtonsEnabled { get; set; } 18 | bool LoadOsuCollectionButtonEnabled { get; set; } 19 | bool LoadLazerDatabaseButtonEnabled { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/IUserTopGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CollectionManager.DataTypes; 3 | 4 | namespace GuiComponents.Interfaces 5 | { 6 | public interface IUserTopGenerator 7 | { 8 | event EventHandler Start; 9 | event EventHandler Abort; 10 | event EventHandler GenerateUsernames; 11 | event EventHandler CollectionNamingFormatChanged; 12 | bool IsRunning { set; } 13 | string ApiKey { get; } 14 | string Usernames { get; } 15 | string CollectionNamingFormat { get; } 16 | string CollectionNamingExample { set; } 17 | int AllowedScores { get; } 18 | string AllowedModCombinations { get; } 19 | double PpMin { get; } 20 | double PpMax { get; } 21 | double AccMin { get; } 22 | double AccMax { get; } 23 | int Gamemode { get; } 24 | 25 | ICollectionListingView CollectionListing { get; } 26 | 27 | string ProcessingStatus { set; } 28 | double ProcessingCompletionPrecentage { set; } 29 | } 30 | } -------------------------------------------------------------------------------- /Common/Interfaces/Controls/IUsernameGeneratorView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Common.Interfaces.Controls 7 | { 8 | public interface IUsernameGeneratorView 9 | { 10 | event EventHandler Start; 11 | event EventHandler Abort; 12 | string GeneratedUsernames { set; } 13 | int RankMin { get; } 14 | int RankMax { get; } 15 | int CompletionPrecentage { set; } 16 | string Status { set; } 17 | bool StartEnabled { set; } 18 | bool AbortEnabled { set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Common/Interfaces/Forms/IBeatmapListingForm.cs: -------------------------------------------------------------------------------- 1 | namespace GuiComponents.Interfaces 2 | { 3 | public interface IBeatmapListingForm : IForm 4 | { 5 | IBeatmapListingView BeatmapListingView { get; } 6 | ICombinedBeatmapPreviewView CombinedBeatmapPreviewView { get; } 7 | } 8 | } -------------------------------------------------------------------------------- /Common/Interfaces/Forms/ICollectionAddRenameForm.cs: -------------------------------------------------------------------------------- 1 | namespace GuiComponents.Interfaces 2 | { 3 | public interface ICollectionAddRenameForm :IForm 4 | { 5 | ICollectionRenameView CollectionRenameView { get; } 6 | bool IsRenameForm { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /Common/Interfaces/Forms/IDownloadManagerFormView.cs: -------------------------------------------------------------------------------- 1 | namespace GuiComponents.Interfaces 2 | { 3 | public interface IDownloadManagerFormView : IForm 4 | { 5 | IDownloadManagerView DownloadManagerView { get; } 6 | } 7 | } -------------------------------------------------------------------------------- /Common/Interfaces/Forms/IForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GuiComponents.Interfaces 4 | { 5 | public interface IForm 6 | { 7 | bool IsDisposed { get; } 8 | void ShowAndBlock(); 9 | void Show(); 10 | void Close(); 11 | event EventHandler Disposed; 12 | event EventHandler Closing; 13 | } 14 | } -------------------------------------------------------------------------------- /Common/Interfaces/Forms/ILoginForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Common.Interfaces; 4 | 5 | namespace GuiComponents.Interfaces 6 | { 7 | public interface ILoginFormView :IForm 8 | { 9 | string Login { get; } 10 | string Password { get; } 11 | string OsuCookies { get; } 12 | bool ClickedLogin { get; } 13 | string DownloadSource { get; } 14 | event EventHandler LoginClick; 15 | event EventHandler CancelClick; 16 | void SetDownloadSources(IReadOnlyList downloadSources); 17 | } 18 | } -------------------------------------------------------------------------------- /Common/Interfaces/Forms/IMainFormView.cs: -------------------------------------------------------------------------------- 1 | using Gui.Misc; 2 | 3 | namespace GuiComponents.Interfaces 4 | { 5 | public interface IMainFormView :IForm 6 | { 7 | event GuiHelpers.LoadFileArgs OnLoadFile; 8 | ICombinedListingView CombinedListingView { get; } 9 | ICombinedBeatmapPreviewView CombinedBeatmapPreviewView { get; } 10 | IMainSidePanelView SidePanelView { get; } 11 | ICollectionTextView CollectionTextView { get; } 12 | IInfoTextView InfoTextView { get; } 13 | 14 | } 15 | } -------------------------------------------------------------------------------- /Common/Interfaces/Forms/IOsustatsApiLoginFormView.cs: -------------------------------------------------------------------------------- 1 | namespace GuiComponents.Interfaces 2 | { 3 | public interface IOsustatsApiLoginFormView : IForm 4 | { 5 | string ApiKey { get; } 6 | } 7 | } -------------------------------------------------------------------------------- /Common/Interfaces/Forms/IProgressForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GuiComponents.Interfaces 4 | { 5 | public interface IProgressForm : IForm 6 | { 7 | event EventHandler AbortClicked; 8 | } 9 | } -------------------------------------------------------------------------------- /Common/Interfaces/Forms/IStartupForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Common.Interfaces; 4 | 5 | namespace GuiComponents.Interfaces 6 | { 7 | public interface IStartupForm : IForm 8 | { 9 | IStartupView StartupView { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /Common/Interfaces/Forms/IUserTopGeneratorForm.cs: -------------------------------------------------------------------------------- 1 | namespace GuiComponents.Interfaces 2 | { 3 | public interface IUserTopGeneratorForm : IForm 4 | { 5 | IUserTopGenerator UserTopGeneratorView { get; } 6 | } 7 | } -------------------------------------------------------------------------------- /Common/Interfaces/Forms/IUsernameGeneratorForm.cs: -------------------------------------------------------------------------------- 1 | using Common.Interfaces.Controls; 2 | 3 | namespace GuiComponents.Interfaces 4 | { 5 | public interface IUsernameGeneratorForm :IForm 6 | { 7 | IUsernameGeneratorView view { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /Common/Interfaces/IDownloadSource.cs: -------------------------------------------------------------------------------- 1 | namespace Common.Interfaces 2 | { 3 | public interface IDownloadSource 4 | { 5 | /// 6 | /// Download source name 7 | /// 8 | string Name { get; set; } 9 | /// 10 | /// Short-ish description about this source 11 | /// 12 | string Description { get; set; } 13 | /// 14 | /// Url template to use for setting HTTP referer header in download requests, {0} is replaced with mapId 15 | /// 16 | string Referer { get; set; } 17 | /// 18 | /// Url template used for generating download links, {0} is replaced with mapId 19 | /// 20 | string BaseDownloadUrl { get; set; } 21 | /// 22 | /// Should downloads be throttled? 23 | /// 24 | bool ThrottleDownloads { get; set; } 25 | /// 26 | /// How many beatmaps user can download in a minute window 27 | /// 28 | int DownloadsPerMinute { get; set; } 29 | /// 30 | /// How many beatmaps user can download in a hourly window 31 | /// 32 | int DownloadsPerHour { get; set; } 33 | /// 34 | /// How many beatmaps user can download at the same time 35 | /// 36 | int DownloadThreads { get; set; } 37 | /// 38 | /// After how many ms of waiting for download to start download request should be aborted 39 | /// 40 | int RequestTimeout { get; set; } 41 | /// 42 | /// Full path to manager class for this source. "namespace, className" 43 | /// 44 | string FullyQualifiedHandlerName { get; set; } 45 | /// 46 | /// Does this source require user to be logged in? 47 | /// 48 | bool RequiresLogin { get; set; } 49 | /// 50 | /// Should site cookies be required instead of user and password for logging in? 51 | /// 52 | bool UseCookiesLogin { get; set; } 53 | } 54 | } -------------------------------------------------------------------------------- /Common/Interfaces/IOnlineCollectionList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using CollectionManager.DataTypes; 3 | using CollectionManagerExtensionsDll.Modules.API.osustats; 4 | 5 | namespace GuiComponents.Interfaces 6 | { 7 | public interface IOnlineCollectionList 8 | { 9 | RangeObservableCollection WebCollections { get; } 10 | RangeObservableCollection Collections { set; } 11 | UserInformation UserInformation { set; } 12 | } 13 | } -------------------------------------------------------------------------------- /Common/Interfaces/IUserDialogs.cs: -------------------------------------------------------------------------------- 1 | using Common; 2 | using System; 3 | 4 | namespace GuiComponents.Interfaces 5 | { 6 | public interface IUserDialogs 7 | { 8 | bool IsThisPathCorrect(string path); 9 | string SelectDirectory(string text); 10 | string SelectDirectory(string text, bool showNewFolder = false); 11 | string SelectFile(string text, string types = "", string filename = ""); 12 | string SaveFile(string title, string types = "all|*.*"); 13 | bool YesNoMessageBox(string text, string caption, MessageBoxType messageBoxType = MessageBoxType.Info); 14 | (bool Result, bool doNotAskAgain) YesNoMessageBox(string text, string caption, MessageBoxType messageBoxType = MessageBoxType.Info,string doNotAskAgainText = null); 15 | IProgressForm ProgressForm(Progress userProgressMessage, Progress completionPercentage); 16 | void OkMessageBox(string text, string caption, MessageBoxType messageBoxType = MessageBoxType.Info); 17 | } 18 | } -------------------------------------------------------------------------------- /Common/MainSidePanelActions.cs: -------------------------------------------------------------------------------- 1 | namespace Common 2 | { 3 | public enum MainSidePanelActions 4 | { 5 | LoadCollection, 6 | LoadDefaultCollection, 7 | ClearCollections, 8 | SaveCollections, 9 | SaveInvidualCollections, 10 | ListMissingMaps, 11 | ShowBeatmapListing, 12 | ShowDownloadManager, 13 | DownloadAllMissing, 14 | GenerateCollections, 15 | GetMissingMapData, 16 | ListAllBeatmaps, 17 | OsustatsLogin, 18 | AddCollections, 19 | UploadCollectionChanges, 20 | UploadNewCollections, 21 | RemoveWebCollection, 22 | SaveDefaultCollection, 23 | ResetApplicationSettings, 24 | } 25 | } -------------------------------------------------------------------------------- /Common/MessageBoxType.cs: -------------------------------------------------------------------------------- 1 | namespace Common 2 | { 3 | public enum MessageBoxType 4 | { 5 | Info, Question, Error, Success, Warning 6 | } 7 | } -------------------------------------------------------------------------------- /Common/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("14768636-102a-4a27-ab5a-9b5d1ba316a6")] 12 | -------------------------------------------------------------------------------- /Common/StartupCollectionAction.cs: -------------------------------------------------------------------------------- 1 | namespace Common 2 | { 3 | public enum StartupCollectionAction 4 | { 5 | None, 6 | LoadCollectionFromFile, 7 | LoadOsuCollection, 8 | } 9 | } -------------------------------------------------------------------------------- /Common/StartupDatabaseAction.cs: -------------------------------------------------------------------------------- 1 | namespace Common 2 | { 3 | public enum StartupDatabaseAction 4 | { 5 | None, 6 | Unload, 7 | LoadFromDifferentLocation, 8 | LoadLazer, 9 | } 10 | } -------------------------------------------------------------------------------- /GuiComponents/Controls/BeatmapThumbnailView.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Forms; 3 | using GuiComponents.Interfaces; 4 | 5 | namespace GuiComponents.Controls 6 | { 7 | public partial class BeatmapThumbnailView : UserControl, IBeatmapThumbnailView 8 | { 9 | public BeatmapThumbnailView() 10 | { 11 | InitializeComponent(); 12 | } 13 | 14 | public Image beatmapImage 15 | { 16 | set 17 | { 18 | var oldImage = pictureBox1.Image; 19 | pictureBox1.Image = value; 20 | if(pictureBox1.ImageLocation==null) 21 | oldImage?.Dispose(); 22 | } 23 | } 24 | 25 | public string beatmapImageUrl 26 | { 27 | set 28 | { 29 | if (pictureBox1.Image == null) 30 | { 31 | pictureBox1.ImageLocation = value; 32 | } 33 | } 34 | } 35 | 36 | public string AR { set { Invoke((MethodInvoker)(() => { label_AR.Text = value; })); } } 37 | public string CS { set { Invoke((MethodInvoker)(() => { label_CS.Text = value; })); } } 38 | public string OD { set { Invoke((MethodInvoker)(() => { label_OD.Text = value; })); } } 39 | public string Stars { set { Invoke((MethodInvoker)(() => { label_Stars.Text = value; })); } } 40 | public string BeatmapName { set { Invoke((MethodInvoker)(() => { label_BeatmapName.Text = value; })); } } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /GuiComponents/Controls/CollectionTextView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using GuiComponents.Interfaces; 4 | 5 | namespace GuiComponents.Controls 6 | { 7 | public partial class CollectionTextView : UserControl, ICollectionTextView 8 | { 9 | 10 | public event EventHandler SaveTypeChanged; 11 | public void SetListTypes(Array types) 12 | { 13 | comboBox_textType.DataSource = types; 14 | } 15 | 16 | public string GeneratedText { set { textBox1.Text = value; } } 17 | public CollectionTextView() 18 | { 19 | InitializeComponent(); 20 | textBox1.KeyDown += textBox1_KeyDown; 21 | comboBox_textType.SelectedIndexChanged += delegate 22 | { 23 | SaveTypeChanged?.Invoke(this, EventArgs.Empty); 24 | }; 25 | } 26 | 27 | public string SelectedSaveType => comboBox_textType.SelectedValue.ToString(); 28 | private void textBox1_KeyDown(object sender, KeyEventArgs e) 29 | { 30 | if (e.KeyData == (Keys.Control | Keys.A)) 31 | { 32 | textBox1.SelectAll(); 33 | e.Handled = e.SuppressKeyPress = true; 34 | } 35 | } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /GuiComponents/Controls/CombinedBeatmapPreviewView.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | using GuiComponents.Interfaces; 3 | 4 | namespace GuiComponents.Controls 5 | { 6 | public partial class CombinedBeatmapPreviewView : UserControl, ICombinedBeatmapPreviewView 7 | { 8 | public CombinedBeatmapPreviewView() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | public IBeatmapThumbnailView BeatmapThumbnailView => beatmapThumbnailView1; 14 | public IMusicControlView MusicControlView => musicControlView1; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /GuiComponents/Controls/CombinedListingView.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | using GuiComponents.Interfaces; 3 | 4 | namespace GuiComponents.Controls 5 | { 6 | public partial class CombinedListingView : UserControl, ICombinedListingView 7 | { 8 | public CombinedListingView() 9 | { 10 | InitializeComponent(); 11 | splitContainer1.Paint += Helpers.SplitterPaint; 12 | } 13 | 14 | public IBeatmapListingView beatmapListingView => beatmapListingView1; 15 | public ICollectionListingView CollectionListingView => collectionListingView1; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /GuiComponents/Controls/DownloadManagerView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | using CollectionManagerExtensionsDll.Modules.DownloadManager.API; 5 | using GuiComponents.Interfaces; 6 | 7 | namespace GuiComponents.Controls 8 | { 9 | public partial class DownloadManagerView : UserControl, IDownloadManagerView 10 | { 11 | public DownloadManagerView() 12 | { 13 | InitializeComponent(); 14 | 15 | button_ToggleDownloads.Click += (s, a) => DownloadToggleClick?.Invoke(this, EventArgs.Empty); 16 | ListViewDownload.FullRowSelect = true; 17 | } 18 | 19 | public event EventHandler DownloadToggleClick; 20 | 21 | public bool DownloadButtonIsEnabled 22 | { 23 | get { return this.button_ToggleDownloads.Enabled; } 24 | set { button_ToggleDownloads.Enabled = value; } 25 | } 26 | 27 | public string DownloadButtonText 28 | { 29 | set { button_ToggleDownloads.Text = value; } 30 | } 31 | 32 | public void SetDownloadItems(ICollection downloadItems) 33 | { 34 | ListViewDownload.SetObjects(downloadItems); 35 | } 36 | 37 | public void UpdateDownloadItem(DownloadItem downloadItem) 38 | { 39 | try 40 | { 41 | ListViewDownload.RefreshObject(downloadItem); 42 | } 43 | catch 44 | { 45 | // ignored 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /GuiComponents/Controls/TabControlEx.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using System.Windows.Forms; 3 | 4 | namespace GuiComponents.Controls 5 | { 6 | public class TabControlEx : TabControl 7 | { 8 | //tab border fix 9 | protected override void WndProc(ref Message m) 10 | { 11 | if (m.Msg == 0x1300 + 40) 12 | { 13 | RECT rc = (RECT)m.GetLParam(typeof(RECT)); 14 | rc.Left -= 4; 15 | rc.Right += 2; 16 | rc.Top -= 2; 17 | rc.Bottom += 3; 18 | Marshal.StructureToPtr(rc, m.LParam, true); 19 | } 20 | base.WndProc(ref m); 21 | } 22 | 23 | } 24 | internal struct RECT { public int Left, Top, Right, Bottom; } 25 | } -------------------------------------------------------------------------------- /GuiComponents/Forms/BaseForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | using GuiComponents.Interfaces; 5 | 6 | namespace GuiComponents.Forms 7 | { 8 | public class BaseForm : Form, IForm 9 | { 10 | protected BaseForm() 11 | { 12 | FormClosing += (s, e) => Closing?.Invoke(this, e); 13 | StartPosition = FormStartPosition.CenterParent; 14 | Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); 15 | Font = new Font("Segoe UI", 9f); 16 | } 17 | 18 | public void ShowAndBlock() 19 | { 20 | ShowDialog(); 21 | } 22 | 23 | public event EventHandler Closing; 24 | } 25 | } -------------------------------------------------------------------------------- /GuiComponents/Forms/BeatmapListingForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using GuiComponents.Interfaces; 4 | 5 | namespace GuiComponents.Forms 6 | { 7 | public partial class BeatmapListingForm : BaseForm, IBeatmapListingForm 8 | { 9 | public BeatmapListingForm() 10 | { 11 | InitializeComponent(); 12 | } 13 | 14 | public IBeatmapListingView BeatmapListingView => beatmapListingView1; 15 | public ICombinedBeatmapPreviewView CombinedBeatmapPreviewView => combinedBeatmapPreviewView1; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /GuiComponents/Forms/CollectionAddRenameForm.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | using GuiComponents.Interfaces; 3 | 4 | namespace GuiComponents.Forms 5 | { 6 | public partial class CollectionAddRenameForm : BaseForm, ICollectionAddRenameForm 7 | { 8 | public CollectionAddRenameForm() 9 | { 10 | InitializeComponent(); 11 | IsRenameForm = collectionRenameView1.IsRenameView; 12 | 13 | AcceptButton = collectionRenameView1.button_rename; 14 | CancelButton = collectionRenameView1.button_cancel; 15 | } 16 | 17 | public ICollectionRenameView CollectionRenameView => collectionRenameView1; 18 | private bool _isRenameForm; 19 | 20 | public bool IsRenameForm 21 | { 22 | get 23 | { 24 | return _isRenameForm; 25 | } 26 | set 27 | { 28 | _isRenameForm = value; 29 | collectionRenameView1.IsRenameView = value; 30 | if (value) 31 | Text = "Collection Manager - Rename collection"; 32 | else 33 | Text = "Collection Manager - Add collection"; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /GuiComponents/Forms/DownloadManagerFormView.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace GuiComponents.Forms 2 | { 3 | partial class DownloadManagerFormView 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.downloadManagerView1 = new GuiComponents.Controls.DownloadManagerView(); 32 | this.SuspendLayout(); 33 | // 34 | // downloadManagerView1 35 | // 36 | this.downloadManagerView1.Dock = System.Windows.Forms.DockStyle.Fill; 37 | this.downloadManagerView1.DownloadButtonIsEnabled = true; 38 | this.downloadManagerView1.Location = new System.Drawing.Point(0, 0); 39 | this.downloadManagerView1.Name = "downloadManagerView1"; 40 | this.downloadManagerView1.Size = new System.Drawing.Size(514, 461); 41 | this.downloadManagerView1.TabIndex = 0; 42 | // 43 | // DownloadManagerFormView 44 | // 45 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 46 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 47 | this.ClientSize = new System.Drawing.Size(514, 461); 48 | this.Controls.Add(this.downloadManagerView1); 49 | this.Name = "DownloadManagerFormView"; 50 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 51 | this.Text = "Collection Manager - Download list"; 52 | this.ResumeLayout(false); 53 | 54 | } 55 | 56 | #endregion 57 | 58 | private Controls.DownloadManagerView downloadManagerView1; 59 | } 60 | } -------------------------------------------------------------------------------- /GuiComponents/Forms/DownloadManagerFormView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using GuiComponents.Interfaces; 4 | 5 | namespace GuiComponents.Forms 6 | { 7 | public partial class DownloadManagerFormView : BaseForm, IDownloadManagerFormView 8 | { 9 | public DownloadManagerFormView() 10 | { 11 | InitializeComponent(); 12 | } 13 | 14 | public IDownloadManagerView DownloadManagerView => downloadManagerView1; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /GuiComponents/Forms/MainFormView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Windows.Forms; 4 | using Gui.Misc; 5 | using GuiComponents.Interfaces; 6 | 7 | namespace GuiComponents.Forms 8 | { 9 | public partial class MainFormView : BaseForm, IMainFormView 10 | { 11 | public MainFormView() 12 | { 13 | InitializeComponent(); 14 | splitContainer1.Paint += Helpers.SplitterPaint; 15 | AllowDrop = true; 16 | DragEnter += Form1_DragEnter; 17 | DragDrop += Form1_DragDrop; 18 | } 19 | 20 | public event GuiHelpers.LoadFileArgs OnLoadFile; 21 | public ICombinedListingView CombinedListingView => combinedListingView1; 22 | public ICombinedBeatmapPreviewView CombinedBeatmapPreviewView => combinedBeatmapPreviewView1; 23 | public IMainSidePanelView SidePanelView => mainSidePanelView1; 24 | public ICollectionTextView CollectionTextView => collectionTextView1; 25 | public IInfoTextView InfoTextView => infoTextView1; 26 | 27 | private void Form1_DragEnter(object sender, DragEventArgs e) 28 | { 29 | if (e.Data.GetDataPresent(DataFormats.FileDrop) && e.Data.GetFormats().Any(f => f == "FileDrop")) 30 | { 31 | e.Effect = DragDropEffects.Copy; 32 | } 33 | } 34 | 35 | private void Form1_DragDrop(object sender, DragEventArgs e) 36 | { 37 | if (e.Data.GetFormats().All(f => f != "FileDrop")) 38 | { 39 | return; 40 | } 41 | 42 | var files = (string[]) e.Data.GetData(DataFormats.FileDrop); 43 | OnLoadFile?.Invoke(this, files); 44 | } 45 | 46 | protected override void OnShown(EventArgs e) 47 | { 48 | Activate(); 49 | base.OnShown(e); 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /GuiComponents/Forms/OsustatsApiLoginFormView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Diagnostics; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | using GuiComponents.Interfaces; 12 | 13 | namespace GuiComponents.Forms 14 | { 15 | public partial class OsustatsApiLoginFormView : BaseForm, IOsustatsApiLoginFormView 16 | { 17 | public OsustatsApiLoginFormView() 18 | { 19 | InitializeComponent(); 20 | } 21 | public string ApiKey => textBox_apiKey.Text; 22 | 23 | private void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 24 | { 25 | Process.Start("https://osustats.ppy.sh/collections/apikey"); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /GuiComponents/Forms/StartupForm.cs: -------------------------------------------------------------------------------- 1 | using GuiComponents.Interfaces; 2 | using System.Windows.Forms; 3 | 4 | namespace GuiComponents.Forms 5 | { 6 | public partial class StartupForm : BaseForm, IStartupForm 7 | { 8 | public StartupForm() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | public IStartupView StartupView => startupView1; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /GuiComponents/Forms/UserTopGeneratorForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace GuiComponents.Forms 2 | { 3 | partial class UserTopGeneratorForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.userTopGenerator1 = new GuiComponents.Controls.UserTopGeneratorView(); 32 | this.SuspendLayout(); 33 | // 34 | // userTopGenerator1 35 | // 36 | this.userTopGenerator1.Dock = System.Windows.Forms.DockStyle.Fill; 37 | this.userTopGenerator1.Location = new System.Drawing.Point(0, 0); 38 | this.userTopGenerator1.Name = "userTopGenerator1"; 39 | this.userTopGenerator1.Size = new System.Drawing.Size(526, 681); 40 | this.userTopGenerator1.TabIndex = 0; 41 | // 42 | // UserTopGeneratorForm 43 | // 44 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 45 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 46 | this.ClientSize = new System.Drawing.Size(526, 681); 47 | this.Controls.Add(this.userTopGenerator1); 48 | this.Name = "UserTopGeneratorForm"; 49 | this.Text = "Collection Manager - Collection Generator"; 50 | this.ResumeLayout(false); 51 | 52 | } 53 | 54 | #endregion 55 | 56 | private Controls.UserTopGeneratorView userTopGenerator1; 57 | } 58 | } -------------------------------------------------------------------------------- /GuiComponents/Forms/UserTopGeneratorForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using GuiComponents.Interfaces; 10 | 11 | namespace GuiComponents.Forms 12 | { 13 | public partial class UserTopGeneratorForm : BaseForm, IUserTopGeneratorForm 14 | { 15 | public UserTopGeneratorForm() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | public IUserTopGenerator UserTopGeneratorView => userTopGenerator1; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /GuiComponents/Forms/UsernameGeneratorForm.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace GuiComponents.Forms 2 | { 3 | partial class UsernameGeneratorForm 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.usernameGeneratorView1 = new GuiComponents.Controls.UsernameGeneratorView(); 32 | this.SuspendLayout(); 33 | // 34 | // usernameGeneratorView1 35 | // 36 | this.usernameGeneratorView1.Dock = System.Windows.Forms.DockStyle.Fill; 37 | this.usernameGeneratorView1.Location = new System.Drawing.Point(0, 0); 38 | this.usernameGeneratorView1.Name = "usernameGeneratorView1"; 39 | this.usernameGeneratorView1.Size = new System.Drawing.Size(382, 261); 40 | this.usernameGeneratorView1.Status = null; 41 | this.usernameGeneratorView1.TabIndex = 0; 42 | // 43 | // UsernameGeneratorForm 44 | // 45 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 46 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 47 | this.ClientSize = new System.Drawing.Size(382, 261); 48 | this.Controls.Add(this.usernameGeneratorView1); 49 | this.Name = "UsernameGeneratorForm"; 50 | this.Text = "Collection Manager - Username generator"; 51 | this.ResumeLayout(false); 52 | 53 | } 54 | 55 | #endregion 56 | 57 | private Controls.UsernameGeneratorView usernameGeneratorView1; 58 | } 59 | } -------------------------------------------------------------------------------- /GuiComponents/Forms/UsernameGeneratorForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using Common.Interfaces.Controls; 10 | using GuiComponents.Interfaces; 11 | 12 | namespace GuiComponents.Forms 13 | { 14 | public partial class UsernameGeneratorForm : BaseForm, IUsernameGeneratorForm 15 | { 16 | public UsernameGeneratorForm() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | public IUsernameGeneratorView view => usernameGeneratorView1; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /GuiComponents/Helpers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | using BrightIdeasSoftware; 5 | 6 | namespace GuiComponents 7 | { 8 | internal static class Helpers 9 | { 10 | 11 | public static void EnsureSelectionIsVisible(this FastObjectListView list) 12 | { 13 | if (list.InvokeRequired) 14 | { 15 | list.Invoke((Action)(() => 16 | { 17 | list.EnsureSelectionIsVisible(); 18 | })); 19 | return; 20 | } 21 | var obj = list.SelectedObject; 22 | if (obj!=null) 23 | list.EnsureModelVisible(obj); 24 | } 25 | public static void SelectNextOrFirst(this FastObjectListView list) 26 | { 27 | if (list.InvokeRequired) 28 | { 29 | list.Invoke((Action)(() => 30 | { 31 | list.SelectNextOrFirst(); 32 | })); 33 | return; 34 | } 35 | var nextItem = list.GetNextItem(list.SelectedItem); 36 | if (nextItem == null) 37 | nextItem = list.GetNextItem(null); 38 | list.SelectedItem = nextItem; 39 | } 40 | public static void SplitterPaint(object sender, PaintEventArgs e) 41 | { 42 | SplitContainer s = sender as SplitContainer; 43 | if (s != null) 44 | { 45 | int top = 5; 46 | int bottom = s.Height - 5; 47 | int left = s.SplitterDistance; 48 | int right = left + s.SplitterWidth - 1; 49 | e.Graphics.DrawLine(Pens.Silver, left, top, left, bottom); 50 | e.Graphics.DrawLine(Pens.Silver, right, top, right, bottom); 51 | int halfWidth = s.SplitterWidth / 2; 52 | 53 | for (int CurrBottom = bottom; CurrBottom > top; CurrBottom -= 10) 54 | { 55 | //e.Graphics.DrawLine(Pens.Silver, left, top, left, bottom); 56 | e.Graphics.DrawLine(Pens.Silver, left, CurrBottom, left + halfWidth, CurrBottom + 5); 57 | } 58 | } 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /GuiComponents/ProgressForm.cs: -------------------------------------------------------------------------------- 1 | using GuiComponents.Forms; 2 | using GuiComponents.Interfaces; 3 | using System; 4 | using System.Windows.Forms; 5 | 6 | namespace GuiComponents 7 | { 8 | public partial class ProgressForm : BaseForm, IProgressForm 9 | { 10 | public event EventHandler AbortClicked; 11 | public ProgressForm() 12 | { 13 | InitializeComponent(); 14 | } 15 | 16 | private const int CP_NOCLOSE_BUTTON = 0x200; 17 | protected override CreateParams CreateParams 18 | { 19 | get 20 | { 21 | CreateParams myCp = base.CreateParams; 22 | myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON; 23 | return myCp; 24 | } 25 | } 26 | internal static IProgressForm ShowDialog(Progress userProgressMessage, Progress completionPercentage) 27 | { 28 | var form = new ProgressForm(); 29 | userProgressMessage.ProgressChanged += (_, message) => form.label_text.Text = message; 30 | completionPercentage.ProgressChanged += form.CompletionPercentage_ProgressChanged; 31 | form.button_cancel.Click += (_, __) => form.AbortClicked?.Invoke(form, EventArgs.Empty); 32 | 33 | form.Text = $"Collection Manager - Beatmap Export"; 34 | return form; 35 | } 36 | 37 | private void CompletionPercentage_ProgressChanged(object sender, int percentage) 38 | { 39 | progressBar1.Value = percentage; 40 | if (percentage == progressBar1.Maximum) 41 | button_cancel.Text = "Close"; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /GuiComponents/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("9f6c4bfe-5696-4513-bb06-90dc14a56ccf")] 12 | -------------------------------------------------------------------------------- /GuiComponents/YesNoForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Runtime.CompilerServices; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | using GuiComponents.Forms; 12 | 13 | namespace GuiComponents 14 | { 15 | public partial class YesNoForm : BaseForm 16 | { 17 | public bool DoNotAskAgain { get; private set; } 18 | public YesNoForm() 19 | { 20 | InitializeComponent(); 21 | } 22 | 23 | internal static (DialogResult dialogResult, bool doNotAskAgain) ShowDialog(string text, string caption, 24 | string doNotAskAgainText) 25 | { 26 | using (var f = new YesNoForm()) 27 | { 28 | f.label_text.Text = text; 29 | f.Text = $"Collection Manager - {caption}"; 30 | f.checkBox_doNotAskAgain.Text = doNotAskAgainText; 31 | 32 | return (f.ShowDialog(), f.DoNotAskAgain); 33 | } 34 | } 35 | 36 | private void CheckBox_doNotAskAgain_CheckedChanged(object sender, EventArgs e) 37 | { 38 | this.DoNotAskAgain = checkBox_doNotAskAgain.Checked; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /InnoSetup/afterInstall.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/InnoSetup/afterInstall.txt -------------------------------------------------------------------------------- /InnoSetup/beforeInstall.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/InnoSetup/beforeInstall.txt -------------------------------------------------------------------------------- /InnoSetup/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/InnoSetup/license.txt -------------------------------------------------------------------------------- /MusicPlayer/AudioFileReaderEx.cs: -------------------------------------------------------------------------------- 1 | using NAudio.Wave; 2 | 3 | namespace MusicPlayer 4 | { 5 | public class AudioFileReaderEx : AudioFileReader 6 | { 7 | public AudioFileReaderEx(string fileName) : base(fileName) 8 | { 9 | AudioFileLocation = fileName; 10 | } 11 | 12 | public string AudioFileLocation { get; } 13 | public bool Reused { get; private set; } = false; 14 | public AudioFileReaderEx GetAudio(string fileName) 15 | { 16 | if (fileName == AudioFileLocation) 17 | { 18 | this.Reused = true; 19 | this.SetPosition(0d); 20 | return this; 21 | } 22 | return new AudioFileReaderEx(fileName); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /MusicPlayer/IMusicPlayer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MusicPlayer 4 | { 5 | public interface IMusicPlayer :IDisposable 6 | { 7 | void Seek(double position); 8 | void SetVolume(float volume); 9 | void SetSpeed(float speed); 10 | void Play(string audioFileOrUrl, int startTime); 11 | void Pause(); 12 | void Resume(); 13 | bool IsPlaying { get; } 14 | double TotalTime { get; } 15 | double CurrentTime { get; } 16 | bool IsSpeedControlAvaliable { get; } 17 | bool IsPaused { get; } 18 | float SoundVolume { get; } 19 | event EventHandler PlaybackFinished; 20 | } 21 | } -------------------------------------------------------------------------------- /MusicPlayer/MusicPlayer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net48 4 | MusicPlayer 5 | MusicPlayer 6 | Copyright © 2017 7 | 8 | 9 | 10 | NAudio\NAudio.dll 11 | False 12 | 13 | 14 | NAudio\NAudio.WindowsMediaFormat.dll 15 | False 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /MusicPlayer/MusicPlayerManager.cs: -------------------------------------------------------------------------------- 1 | using Common; 2 | using System; 3 | using System.IO; 4 | 5 | namespace MusicPlayer 6 | { 7 | public class MusicPlayerManager : IMusicPlayer 8 | { 9 | 10 | public bool IsPlaying => musicPlayer.IsPlaying; 11 | public double TotalTime => musicPlayer.TotalTime; 12 | public double CurrentTime => musicPlayer.CurrentTime; 13 | public bool IsSpeedControlAvaliable => musicPlayer.IsSpeedControlAvaliable; 14 | public bool IsPaused => musicPlayer.IsPaused; 15 | public float SoundVolume => musicPlayer.SoundVolume; 16 | 17 | private readonly IMusicPlayer musicPlayer; 18 | private readonly MRUFileCache fileCache; 19 | 20 | public event EventHandler PlaybackFinished 21 | { 22 | add { musicPlayer.PlaybackFinished += value; } 23 | remove { musicPlayer.PlaybackFinished -= value; } 24 | } 25 | 26 | public MusicPlayerManager() 27 | { 28 | if (File.Exists("SoundTouch.dll") && File.Exists("SoundTouch_x64.dll")) 29 | musicPlayer = new SoundTouchPlayer(); 30 | else 31 | musicPlayer = new NAudioPlayer(); 32 | 33 | fileCache = new MRUFileCache(Path.Combine(Path.GetTempPath(), "CM-audio-previews")); 34 | } 35 | public void Seek(double position) 36 | { 37 | musicPlayer.Seek(position); 38 | } 39 | 40 | public void SetVolume(float volume) 41 | { 42 | musicPlayer.SetVolume(volume); 43 | } 44 | 45 | public void SetSpeed(float speed) 46 | { 47 | musicPlayer.SetSpeed(speed); 48 | } 49 | 50 | public void Play(string audioFileOrUrl, int startTime) 51 | { 52 | Uri uri = new Uri(audioFileOrUrl); 53 | 54 | if (uri.HostNameType == UriHostNameType.Dns) 55 | audioFileOrUrl = fileCache.DownloadAndAdd(audioFileOrUrl); 56 | 57 | if (string.IsNullOrEmpty(audioFileOrUrl)) 58 | return; 59 | 60 | musicPlayer.Play(audioFileOrUrl, startTime); 61 | } 62 | 63 | public void Pause() 64 | { 65 | musicPlayer.Pause(); 66 | } 67 | 68 | public void Resume() 69 | { 70 | musicPlayer.Resume(); 71 | } 72 | 73 | public void Dispose() 74 | { 75 | musicPlayer.Dispose(); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /MusicPlayer/NAudio/NAudio.WindowsMediaFormat.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/MusicPlayer/NAudio/NAudio.WindowsMediaFormat.dll -------------------------------------------------------------------------------- /MusicPlayer/NAudio/NAudio.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/MusicPlayer/NAudio/NAudio.dll -------------------------------------------------------------------------------- /MusicPlayer/NAudio/readme.txt: -------------------------------------------------------------------------------- 1 | NAudio is an open source .NET audio library written by Mark Heath (mark.heath@gmail.com) 2 | For more information, visit http://naudio.codeplex.com 3 | 4 | THANKS 5 | ====== 6 | The following list includes some of the people who have contributed in various ways to NAudio, such as code contributions, 7 | bug fixes, documentation, helping out on the forums and even donations. I haven't finished compiling this list yet, so 8 | if your name should be on it but isn't please let me know and I will include it. Also, some people I only know by their forum 9 | id, so if you want me to put your full name here, please also get in touch. 10 | 11 | in alphabetical order: 12 | Alan Jordan 13 | Alexandre Mutel 14 | Alexander Binkert 15 | AmandaTarafaMas 16 | balistof 17 | biermeester 18 | borman11 19 | bradb 20 | Brandon Hansen (kg6ypi) 21 | csechet 22 | ChunkWare Music Software 23 | CKing 24 | DaMacc 25 | Du10 26 | eejake52 27 | Florian Rosmann (filoe) 28 | Giawa 29 | Harald Petrovitsch 30 | Hfuy 31 | Iain McCowan 32 | Idael Cardaso 33 | ioctlLR 34 | Jamie Michael Ewins 35 | jannera 36 | jbaker8935 37 | jcameron23 38 | JoeGaggler 39 | jonahoffmann 40 | jontdelorme 41 | Justin Frankel 42 | K24A3 43 | Kassoul 44 | kevinxxx 45 | kzych 46 | LionCash 47 | Lustild 48 | Lucian Wischik (ljw1004) 49 | ManuN 50 | MeelMarcel 51 | Michael Chadwick 52 | Michael Feld 53 | Michael J 54 | Michael Lehenbauer 55 | milligan22963 56 | myrkle 57 | nelsonkidd 58 | Nigel Redmon 59 | Nikolaos Georgiou 60 | Owen Skriloff 61 | owoudenb 62 | painmailer 63 | PPavan 64 | Pygmy 65 | Ray Molenkamp 66 | Roadz 67 | Robert Bristow-Johnson 68 | Scott Fleischman 69 | Simon Clark 70 | Sirish Bajpai 71 | sporn 72 | Steve Underwood 73 | Ted Murphy 74 | Tiny Simple Tools 75 | Tobias Fleming 76 | TomBogle 77 | Tony Cabello 78 | Tony Sistemas 79 | TuneBlade 80 | topher3683 81 | volmart 82 | Vladimir Rokovanov 83 | Ville Koskinen 84 | Wyatt Rice 85 | Yuval Naveh 86 | Zsb 87 | -------------------------------------------------------------------------------- /MusicPlayer/NAudioPlayer.cs: -------------------------------------------------------------------------------- 1 | namespace MusicPlayer 2 | { 3 | internal class NAudioPlayer : AudioPlayer 4 | { 5 | 6 | } 7 | } -------------------------------------------------------------------------------- /MusicPlayer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("573a1557-c916-4abe-bd52-94760d19cc29")] 12 | -------------------------------------------------------------------------------- /MusicPlayer/SoundTouch/SoundTouchProfile.cs: -------------------------------------------------------------------------------- 1 | namespace Collection_Editor.code.Modules.MusicPlayer.SoundTouch 2 | { 3 | public class SoundTouchProfile 4 | { 5 | public bool UseTempo { get; set; } 6 | public bool UseAntiAliasing { get; set; } 7 | public bool UseQuickSeek { get; set; } 8 | 9 | public SoundTouchProfile(bool useTempo, bool useAntiAliasing) 10 | { 11 | UseTempo = useTempo; 12 | UseAntiAliasing = useAntiAliasing; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /MusicPlayer/SoundTouch/SoundTouchSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Collection_Editor.code.Modules.MusicPlayer.SoundTouch 2 | { 3 | enum SoundTouchSettings 4 | { 5 | /// 6 | /// Available setting IDs for the 'setSetting' and 'get_setting' functions. 7 | /// Enable/disable anti-alias filter in pitch transposer (0 = disable) 8 | /// 9 | UseAaFilter = 0, 10 | 11 | /// 12 | /// Pitch transposer anti-alias filter length (8 .. 128 taps, default = 32) 13 | /// 14 | AaFilterLength = 1, 15 | 16 | /// 17 | /// Enable/disable quick seeking algorithm in tempo changer routine 18 | /// (enabling quick seeking lowers CPU utilization but causes a minor sound 19 | /// quality compromising) 20 | /// 21 | UseQuickSeek = 2, 22 | 23 | /// 24 | /// Time-stretch algorithm single processing sequence length in milliseconds. This determines 25 | /// to how long sequences the original sound is chopped in the time-stretch algorithm. 26 | /// See "STTypes.h" or README for more information. 27 | /// 28 | SequenceMs = 3, 29 | 30 | /// 31 | /// Time-stretch algorithm seeking window length in milliseconds for algorithm that finds the 32 | /// best possible overlapping location. This determines from how wide window the algorithm 33 | /// may look for an optimal joining location when mixing the sound sequences back together. 34 | /// See "STTypes.h" or README for more information. 35 | /// 36 | SeekWindowMs = 4, 37 | 38 | /// 39 | /// Time-stretch algorithm overlap length in milliseconds. When the chopped sound sequences 40 | /// are mixed back together, to form a continuous sound stream, this parameter defines over 41 | /// how long period the two consecutive sequences are let to overlap each other. 42 | /// See "STTypes.h" or README for more information. 43 | /// 44 | OverlapMs = 5 45 | }; 46 | } -------------------------------------------------------------------------------- /MusicPlayer/SoundTouch/lib/SoundTouch.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/MusicPlayer/SoundTouch/lib/SoundTouch.dll -------------------------------------------------------------------------------- /MusicPlayer/SoundTouch/lib/SoundTouch_x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/MusicPlayer/SoundTouch/lib/SoundTouch_x64.dll -------------------------------------------------------------------------------- /MusicPlayer/WaveStreamExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NAudio.Wave; 3 | 4 | namespace MusicPlayer 5 | { 6 | public static class WaveStreamExtensions 7 | { 8 | // Set position of WaveStream to nearest block to supplied position 9 | public static void SetPosition(this WaveStream strm, long position) 10 | { 11 | // distance from block boundary (may be 0) 12 | long adj = position % strm.WaveFormat.BlockAlign; 13 | // adjust position to boundary and clamp to valid range 14 | long newPos = Math.Max(0, Math.Min(strm.Length, position - adj)); 15 | // set playback position 16 | strm.Position = newPos; 17 | } 18 | 19 | // Set playback position of WaveStream by seconds 20 | public static void SetPosition(this WaveStream strm, double seconds) 21 | { 22 | strm.SetPosition((long)(seconds * strm.WaveFormat.AverageBytesPerSecond)); 23 | } 24 | 25 | // Set playback position of WaveStream by time (as a TimeSpan) 26 | public static void SetPosition(this WaveStream strm, TimeSpan time) 27 | { 28 | strm.SetPosition(time.TotalSeconds); 29 | } 30 | 31 | // Set playback position of WaveStream relative to current position 32 | public static void Seek(this WaveStream strm, double offset) 33 | { 34 | strm.SetPosition(strm.Position + (long)(offset * strm.WaveFormat.AverageBytesPerSecond)); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /ObjectListView/CustomDictionary.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | br 6 | Canceled 7 | Center 8 | Color 9 | Colors 10 | f 11 | fmt 12 | g 13 | gdi 14 | hti 15 | i 16 | lightbox 17 | lv 18 | lvi 19 | lvsi 20 | m 21 | multi 22 | Munger 23 | n 24 | olv 25 | olvi 26 | p 27 | parms 28 | r 29 | Renderer 30 | s 31 | SubItem 32 | Unapply 33 | Unpause 34 | x 35 | y 36 | 37 | 38 | ComPlus 39 | 40 | 41 | 42 | 43 | OLV 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /ObjectListView/Filtering/ICluster.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * ICluster - A cluster is a group of objects that can be included or excluded as a whole 3 | * 4 | * Author: Phillip Piper 5 | * Date: 4-March-2011 11:59 pm 6 | * 7 | * Change log: 8 | * 2011-03-04 JPP - First version 9 | * 10 | * Copyright (C) 2011-2014 Phillip Piper 11 | * 12 | * This program is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 3 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with this program. If not, see . 24 | * 25 | * If you wish to use this code in a closed source application, please contact phillip_piper@bigfoot.com. 26 | */ 27 | 28 | using System; 29 | using System.Collections.Generic; 30 | using System.Text; 31 | 32 | namespace BrightIdeasSoftware { 33 | 34 | /// 35 | /// A cluster is a like collection of objects that can be usefully filtered 36 | /// as whole using the filtering UI provided by the ObjectListView. 37 | /// 38 | public interface ICluster : IComparable { 39 | /// 40 | /// Gets or sets how many items belong to this cluster 41 | /// 42 | int Count { get; set; } 43 | 44 | /// 45 | /// Gets or sets the label that will be shown to the user to represent 46 | /// this cluster 47 | /// 48 | string DisplayLabel { get; set; } 49 | 50 | /// 51 | /// Gets or sets the actual data object that all members of this cluster 52 | /// have commonly returned. 53 | /// 54 | object ClusterKey { get; set; } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ObjectListView/ObjectListView.shfb: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | All ObjectListView appears in this namespace 8 | 9 | 10 | ObjectListViewDemo demonstrates helpful techniques when using an ObjectListView 11 | Summary, Parameter, Returns, AutoDocumentCtors, Namespace 12 | InheritedMembers, Protected, SealedProtected 13 | 14 | 15 | .\Help\ 16 | 17 | 18 | True 19 | True 20 | HtmlHelp1x 21 | True 22 | False 23 | 2.0.50727 24 | True 25 | False 26 | True 27 | False 28 | 29 | ObjectListView Reference 30 | Documentation 31 | en-US 32 | 33 | (c) Copyright 2006-2008 Phillip Piper All Rights Reserved 34 | phillip_piper@bigfoot.com 35 | 36 | 37 | Local 38 | Msdn 39 | Blank 40 | Prototype 41 | Guid 42 | CSharp 43 | False 44 | AboveNamespaces 45 | 46 | 47 | -------------------------------------------------------------------------------- /ObjectListView/ObjectListView2008.ncrunchproject: -------------------------------------------------------------------------------- 1 | 2 | false 3 | false 4 | false 5 | false 6 | false 7 | true 8 | true 9 | false 10 | true 11 | true 12 | 60000 13 | 14 | 15 | AutoDetect 16 | -------------------------------------------------------------------------------- /ObjectListView/ObjectListView2010.ncrunchproject: -------------------------------------------------------------------------------- 1 | 2 | false 3 | false 4 | false 5 | true 6 | false 7 | false 8 | false 9 | false 10 | true 11 | true 12 | false 13 | true 14 | true 15 | 60000 16 | 17 | 18 | 19 | AutoDetect 20 | STA 21 | x86 22 | 23 | 24 | .* 25 | 26 | 27 | -------------------------------------------------------------------------------- /ObjectListView/ObjectListView2012.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | False -------------------------------------------------------------------------------- /ObjectListView/ObjectListView2012.ncrunchproject: -------------------------------------------------------------------------------- 1 | 2 | false 3 | false 4 | false 5 | true 6 | false 7 | false 8 | false 9 | false 10 | true 11 | true 12 | false 13 | true 14 | true 15 | 60000 16 | 17 | 18 | 19 | AutoDetect 20 | STA 21 | x86 22 | -------------------------------------------------------------------------------- /ObjectListView/ObjectListView2012.v2.ncrunchproject: -------------------------------------------------------------------------------- 1 | 2 | false 3 | false 4 | false 5 | true 6 | false 7 | false 8 | false 9 | false 10 | true 11 | true 12 | false 13 | true 14 | true 15 | 60000 16 | 17 | 18 | 19 | AutoDetect 20 | STA 21 | x86 22 | -------------------------------------------------------------------------------- /ObjectListView/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // Setting ComVisible to false makes the types in this assembly not visible 5 | // to COM components. If you need to access a type in this assembly from 6 | // COM, set the ComVisible attribute to true on that type. 7 | [assembly: ComVisible(false)] 8 | 9 | // The following GUID is for the ID of the typelib if this project is exposed to COM 10 | [assembly: Guid("ef28c7a8-77ae-442d-abc3-bb023fa31e57")] 11 | [assembly: System.CLSCompliant(true)] 12 | -------------------------------------------------------------------------------- /ObjectListView/Resources/clear-filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/ObjectListView/Resources/clear-filter.png -------------------------------------------------------------------------------- /ObjectListView/Resources/coffee.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/ObjectListView/Resources/coffee.jpg -------------------------------------------------------------------------------- /ObjectListView/Resources/filter-icons3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/ObjectListView/Resources/filter-icons3.png -------------------------------------------------------------------------------- /ObjectListView/Resources/filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/ObjectListView/Resources/filter.png -------------------------------------------------------------------------------- /ObjectListView/Resources/sort-ascending.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/ObjectListView/Resources/sort-ascending.png -------------------------------------------------------------------------------- /ObjectListView/Resources/sort-descending.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/ObjectListView/Resources/sort-descending.png -------------------------------------------------------------------------------- /ObjectListView/olv-keyfile.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Piotrekol/CollectionManager/338df689c770e6a38f1034c132fa433df3f38444/ObjectListView/olv-keyfile.snk --------------------------------------------------------------------------------