public PixelChatActionEditorControlViewModel(PixelChatActionModel action) : base(action) { this.SelectedActionType = action.ActionType; if (this.ShowScenes) { this.sceneID = action.SceneID; this.sceneComponentID = action.ComponentID; this.SceneComponentVisible = action.SceneComponentVisible; } if (this.ShowOverlays) { this.overlayID = action.OverlayID; } if (this.ShowTargetUsernameGrid) { this.TargetUsername = action.TargetUsername; } if (this.ShowTimeAmountGrid) { this.TimeAmount = action.TimeAmount; } }
protected override Task <ActionModelBase> GetActionInternal() { if (this.ShowScenes) { return(Task.FromResult <ActionModelBase>(PixelChatActionModel.CreateShowHideSceneComponent(this.SelectedScene.id, this.SelectedSceneComponent.ID, this.SceneComponentVisible))); } else if (this.ShowOverlays) { if (this.ShowTargetUsernameGrid) { return(Task.FromResult <ActionModelBase>(PixelChatActionModel.CreateOverlayTargetUser(this.SelectedActionType, this.SelectedOverlay.id, this.TargetUsername))); } else if (this.ShowTimeAmountGrid) { return(Task.FromResult <ActionModelBase>(PixelChatActionModel.CreateOverlayTimeAmount(this.SelectedActionType, this.SelectedOverlay.id, this.TimeAmount))); } else { return(Task.FromResult <ActionModelBase>(PixelChatActionModel.CreateBasicOverlay(this.SelectedActionType, this.SelectedOverlay.id))); } } return(Task.FromResult <ActionModelBase>(null)); }