public PublishCollectionCommand(Guid id, CollectionScope scope = CollectionScope.Unlisted, Guid?forkedCollectionId = null) { Id = id; Scope = scope; ForkedCollectionId = forkedCollectionId; }
void UpdatePublishInfo(CollectionScope scope, Version version, CollectionPublishInfo publishInfo) { PublishedId = publishInfo.Id; _publishedAccountId = publishInfo.AccountId; PublishingScope = scope; UpdatePublishInfo(version); }
public async Task Publish(IConnectApiHandler api, IContentManager modList, CollectionScope scope = CollectionScope.Unlisted, Guid?forkedCollectionId = null) { if (string.IsNullOrWhiteSpace(Name)) { throw new CollectionNameMissingException(); } //if (scope != CollectionScope.Private && string.IsNullOrWhiteSpace(Description)) // throw new CollectionDescriptionMissingException(); if (!Items.Any()) { throw new CollectionEmptyException(); } var version = defaultVersion; List <CollectionVersionDependencyModel> dependencies; lock (Items) dependencies = GetMods() .Select(Convert) .ToList(); var hasCustomRepo = HasCustomRepo(); if (hasCustomRepo) { UpdateRepositoriesFromCustomRepo(); } var servers = GetServersForPublishing(); var publishInfo = await api.PublishCollection(new CreateCollectionModel { GameId = GameId, Name = Name, Scope = scope, ForkedCollectionId = forkedCollectionId, InitialVersion = new CreateCollectionVersionModel { Description = Description, Version = version, Dependencies = dependencies, Repositories = Repositories.ToList(), Servers = servers } }).ConfigureAwait(false); if (hasCustomRepo) { CleanupRepo(); } UpdatePublishInfo(scope, version, publishInfo); HandleModsetMods(modList); if (hasCustomRepo) { await UploadImageIfAvailable(api).ConfigureAwait(false); } }
public async Task ChangeScope(IConnectApiHandler api, CollectionScope desiredScope) { await api.ChangeCollectionScope(PublishedId.Value, desiredScope).ConfigureAwait(false); PublishingScope = desiredScope; if (desiredScope == CollectionScope.Private) { Subscribers = null; } }
public async Task<bool> Publish(CustomCollectionLibraryItemViewModel collection, CollectionScope scope) { if (!await DealWithCustomRepo(collection.Model)) return false; return await WrapAsync(collection, () => _mediator.RequestAsyncWrapped(new PublishCollectionCommand(collection.Model.Id, scope, collection.Model.ForkedCollectionId))) .ConfigureAwait(false); }
protected sealed override IEnumerator ProcessPayload(VisualPayload payload) { var window = GetWindowVisualizer(payload); var disasmsEntries = new List <DisasmEntryDescriptor>(); foreach (var entry in CollectionScope.GetEntries(payload.Data)) { var index = InstructionIndex.GetValue(entry); var disasmText = DisasmText.GetValue(entry); disasmsEntries.Add(new DisasmEntryDescriptor(index, disasmText)); } window.DisasmEntries = disasmsEntries; yield return(null); }
protected sealed override IEnumerator ProcessPayload(VisualPayload payload) { var window = GetWindowVisualizer(payload); var commsEntries = new List <CommsEntryDescriptor>(); foreach (var entry in CollectionScope.GetEntries(payload.Data)) { var index = InstructionIndexField.GetValue(entry); var message = MessageField.GetValue(entry); var isFromRequestSide = IsFromRequestSideField.GetValue(entry); var color = ColorField.GetValue(entry); commsEntries.Add(new CommsEntryDescriptor(index, message, isFromRequestSide, color)); } window.CommsEntries = commsEntries; yield return(null); }
public Task<bool> ChangeScope(CustomCollectionLibraryItemViewModel collection, CollectionScope scope) { return WrapAsync(collection, () => _mediator.RequestAsyncWrapped(new ChangeCollectionScopeCommand(collection.Model.Id, scope))); }
public async Task ChangeCollectionScope(Guid collectionId, CollectionScope scope) { ConfirmConnected(); await _connectionManager.CollectionsHub.ChangeScope(collectionId, scope).ConfigureAwait(false); }
public async Task <bool> Publish(CustomCollectionLibraryItemViewModel collection, CollectionScope scope) { if (!await DealWithCustomRepo(collection.Model)) { return(false); } return (await WrapAsync(collection, () => _mediator.RequestAsyncWrapped(new PublishCollectionCommand(collection.Model.Id, scope, collection.Model.ForkedCollectionId))) .ConfigureAwait(false)); }
public Task <bool> ChangeScope(CustomCollectionLibraryItemViewModel collection, CollectionScope scope) => WrapAsync(collection, () => _mediator.RequestAsyncWrapped(new ChangeCollectionScopeCommand(collection.Model.Id, scope)));
Task ChangeState(CustomCollectionLibraryItemViewModel collection, CollectionScope scope) => _uploadCollection.ChangeScope(collection, scope);
public ChangeCollectionScopeCommand(Guid id, CollectionScope scope) { Id = id; Scope = scope; }