protected override Task <ActionModelBase> GetActionInternal() { if (this.ShowTweetGrid) { return(Task.FromResult <ActionModelBase>(TwitterActionModel.CreateTweetAction(this.TweetText, this.TweetImageURL))); } else if (this.ShowUpdateNameGrid) { return(Task.FromResult <ActionModelBase>(TwitterActionModel.CreateUpdateProfileNameAction(this.UpdateNameText))); } return(Task.FromResult <ActionModelBase>(null)); }
public TwitterActionEditorControlViewModel(TwitterActionModel action) : base(action) { this.SelectedActionType = action.ActionType; if (this.ShowTweetGrid) { this.TweetText = action.TweetText; this.TweetImageURL = action.ImagePath; } else if (this.ShowUpdateNameGrid) { this.UpdateNameText = action.NameUpdate; } }
public override Task <Result> Validate() { if (this.ShowTweetGrid) { if (string.IsNullOrEmpty(this.TweetText)) { return(Task.FromResult(new Result(MixItUp.Base.Resources.TwitterActionMissingTweet))); } if (TwitterActionModel.CheckIfTweetContainsTooManyTags(this.TweetText)) { return(Task.FromResult(new Result(MixItUp.Base.Resources.TwitterActionInvalidTweet))); } } else if (this.ShowUpdateNameGrid) { if (string.IsNullOrEmpty(this.UpdateNameText)) { return(Task.FromResult(new Result(MixItUp.Base.Resources.TwitterActionMissingNameUpdate))); } } return(Task.FromResult(new Result())); }