public MissionLibrarySetup(MissionLibraryViewModel library, Game game, IContentManager missionList, UserSettings settings, IEventAggregator eventBus) { if (game == null) { throw new ArgumentNullException(nameof(game)); } if (!(game.SupportsMissions())) { throw new NotSupportedException("game.SupportsMissions()"); } if (missionList == null) { throw new ArgumentNullException(nameof(missionList)); } _library = library; _game = game; _missionList = missionList; _eventBus = eventBus; _settings = settings; OnlineGroup = new MissionLibraryGroupViewModel(library, "Repositories", icon: SixIconFont.withSIX_icon_Cloud) { IsRoot = true, SortOrder = 13 }; LocalGroup = new MissionLibraryGroupViewModel(library, "Local", "add folder", SixIconFont.withSIX_icon_System) { IsRoot = true, SortOrder = 12 }; CollectionsGroup = new MissionLibraryGroupViewModel(library, "Collections", "new collection", SixIconFont.withSIX_icon_Folder) { IsRoot = true, SortOrder = 11 }; BuiltInGroup = new MissionLibraryGroupViewModel(library, null) { IsRoot = true, SortOrder = 0 }; Groups = new LibraryGroupViewModel <MissionLibraryViewModel>[] { null, BuiltInGroup, LocalGroup }; // , OnlineGroup _eventBus.Subscribe(this); Items.AddRange(Groups.Where(x => x != null && x != BuiltInGroup)); if (_game.SupportsMissions()) { Setup(); } CreateItemsView(); }
public ServerLibrarySetup(ServerLibraryViewModel library, IServerList serverList) { _library = library; _serverList = serverList; BuiltInGroup = new ServerLibraryGroupViewModel(library, null) { IsRoot = true, SortOrder = 0 }; _builtinFeatured = new ServerLibraryItemViewModel <BuiltInServerContainer>(library, new BuiltInServerContainer("Featured"), new CleanServerFilter(), null, SixIconFont.withSIX_icon_Ribbon, BuiltInGroup, true) { IconForeground = SixColors.SixOrange, IsRoot = true, SortOrder = 7, IsHead = true }; _builtinFavorites = new ServerLibraryItemViewModel <BuiltInServerContainer>(library, new BuiltInServerContainer("Favorites"), new CleanServerFilter(), null, SixIconFont.withSIX_icon_Star, BuiltInGroup, true) { IconForeground = SixColors.SixOrange, IsRoot = true, SortOrder = 8 }; _builtinRecent = new ServerLibraryItemViewModel <BuiltInServerContainer>(library, new BuiltInServerContainer("Recent"), new CleanServerFilter(), null, SixIconFont.withSIX_icon_Clock, BuiltInGroup, true) { IsRoot = true, SortOrder = 9 }; Groups = new LibraryGroupViewModel <ServerLibraryViewModel>[] { null, BuiltInGroup }; if (serverList != null) { Setup(); } Items.AddRange(Groups.Where(x => x != null && x != BuiltInGroup)); CreateItemsView(); }
public ModLibrarySetup(ModLibraryViewModel library, Game game, IContentManager contentList, UserSettings settings, IEventAggregator eventBus) { if (!(game.SupportsMods())) { throw new ArgumentException("game.SupportsMods()"); } _library = library; _game = game; _modding = game.Modding(); _settings = settings; _eventBus = eventBus; _contentList = contentList; OnlineGroup = new ModLibraryGroupViewModel(library, "Repositories", "add repo", SixIconFont.withSIX_icon_Cloud) { IsRoot = true, SortOrder = 13 }; LocalGroup = new ModLibraryGroupViewModel(library, "Local", "add folder", SixIconFont.withSIX_icon_System) { IsRoot = true, SortOrder = 12 }; CollectionsGroup = new ModLibraryGroupViewModel(library, "Collections", "new collection", SixIconFont.withSIX_icon_Folder) { IsRoot = true, SortOrder = 11 }; BuiltInGroup = new ModLibraryGroupViewModel(library, null) { IsRoot = true, SortOrder = 0 }; Groups = new LibraryGroupViewModel <ModLibraryViewModel>[] { null, BuiltInGroup, CollectionsGroup, LocalGroup, OnlineGroup }; _aIa = new BrowseContentLibraryItemViewModel <BuiltInContentContainer>(library, new BuiltInContentContainer("AllInArma"), @group: LocalGroup, isFeatured: true); SetupItems(); Items.AddRange(Groups.Where(x => x != null && x != BuiltInGroup)); CreateItemsView(); _eventBus.Subscribe(this); }