void Awake() { Instance = this; m_idle = true; m_idleUIVisible = false; m_swipeIndicatorVisible = false; m_indicatorSwipeUp.SetActive(false); // 방향 표시는 우선은 전부 감춰둔다 m_indicatorSwipeDown.SetActive(false); m_indicatorSwipeLeft.SetActive(false); m_indicatorSwipeRight.SetActive(false); FSNEngine.Instance.ControlSystem.AddSwipeHandler(gameObject); // 핸들러 등록. 임시방편에 가깝다.... // 다이얼로그 스택 초기화 m_dialogStack = new DialogStack(); int dialogCount = m_dialogs.Length; for (int i = 0; i < dialogCount; i++) // 다이얼로그들 스택에 미리 등록 { m_dialogs[i].RegisterDialogProtocol(m_dialogStack); } }
public async Task ComposeMessage() { if (!DialogStack.Push(new ComposeMessageData())) { return; } await ShowHostedDialog <MessageDialog, IComposeMessageViewModel>(); }
public async Task ViewProfile(string screenName) { if (!DialogStack.Push(new ProfileDialogData(screenName))) { return; } await ShowHostedDialog <ProfileDialog, IProfileDialogViewModel, object>(); }
public async Task QuoteTweet(StatusViewModel status, IEnumerable <ulong> preSelectedAccounts = null) { if (!DialogStack.Push(new QuoteTweetData(status, preSelectedAccounts?.ToArray() ?? new ulong[0]))) { return; } await ShowHostedDialog <TweetComposer, IComposeTweetViewModel>(); }
public async Task ViewImage(IList <Uri> imageSet, Uri selectedImage) { if (!DialogStack.Push(new ImageData(imageSet, selectedImage))) { return; } await ShowHostedDialog <ImageDialog, IImageDialogViewModel>(); }
public async Task ViewProfile(ulong userId) { if (!DialogStack.Push(new ProfileDialogData(userId))) { return; } await ShowHostedDialog <ProfileDialog, IProfileDialogViewModel, object>(); }
public async Task ViewDirectMessage(MessageViewModel msg) { if (!DialogStack.Push(new MessageData(msg))) { return; } await ShowHostedDialog <MessageDetailsDialog, IMessageDetailsViewModel>(); }
public async Task ReplyToTweet(StatusViewModel status, bool toAll) { if (!DialogStack.Push(new ComposeTweetData(status, toAll))) { return; } await ShowHostedDialog <TweetComposer, IComposeTweetViewModel>(); }
public async Task ReplyToMessage(MessageViewModel message) { if (!DialogStack.Push(new ComposeMessageData(message.Partner.ScreenName, message))) { return; } await ShowHostedDialog <MessageDialog, IComposeMessageViewModel>(); }
public async Task ComposeTweet(string text = null) { if (!DialogStack.Push(new ComposeTweetData(null, false, text))) { return; } await ShowHostedDialog <TweetComposer, IComposeTweetViewModel>(); }
private void PopDialog() { if (DialogStack.Count > 0) { DialogStack.Pop(); } UpdateDialogView(); }
public async Task OpenSearch(string query = null) { if (!DialogStack.Push(new SearchDialogData(query))) { return; } await ShowHostedDialog <SearchDialog, ISearchDialogViewModel, object>(); }
public void EndDialog(FrameworkElement dialog, string dialogResult) { if (dialog != DialogStack.Peek()) { throw new InvalidOperationException(); } GetDialogAwaitable(dialog).NotifyCompletion(dialogResult); }
private DialogResult BeginDialog(FrameworkElement dialog) { var result = new DialogResult(); result.Dialog = dialog; result.Completed += PopDialog; SetDialogAwaitable(dialog, result); DialogStack.Push(dialog); UpdateDialogView(); return(result); }
public async Task ViewStatus(StatusViewModel status) { if (status == null) { return; } if (!DialogStack.Push(new StatusData(status))) { return; } await ShowHostedDialog <TweetDetailsDialog, ITweetDetailsViewModel>(); }
private void Awake() { // 다이얼로그 스택 초기화 m_dialogStack = new DialogStack(); var dialogCount = m_dialogs.Length; for (var i = 0; i < dialogCount; i++) // 다이얼로그들 스택에 미리 등록 { var dialog = m_dialogs[i]; dialog.RegisterDialogProtocol(m_dialogStack); // 강제로 활성화->비활성화해서 다이얼로그 오브젝트 워밍업, 그리고 다이얼로그가 전부 비활성 상태로 시작하도록 강제한다 dialog.gameObject.SetActive(true); dialog.gameObject.SetActive(false); } Initialize(); // 그외 초기화 코드 호출 }
private async Task <TResult> ShowHostedDialog <TControl, TViewModel, TResult>() where TViewModel : class where TResult : class where TControl : UserControl, new() { var ctrl = new TControl(); var vm = ctrl.DataContext as TViewModel; bool newHost = false; DialogWindowHost host = CurrentDialogHost; if (host == null) { host = new DialogWindowHost { Owner = Window, Content = ctrl }; host.Closed += (s, e) => { DialogStack.Clear(); CurrentDialogHost = null; }; CurrentDialogHost = host; newHost = true; } else { host.Content = ctrl; } var hostVm = host.DataContext as IDialogHostViewModel; await hostVm.Setup(vm); TResult result = null; await Dispatcher.RunAsync(() => { bool shouldSetupResult = false; if (newHost) { try { shouldSetupResult = host.ShowDialog() == true; } catch (InvalidOperationException) { // Window was closed during setup } } if (shouldSetupResult) { result = DialogStack.ResultSetup <TViewModel, TResult>(vm); } }); return(result); }