public ConfirmationDialog(ConfirmationMessage msg)
 {
     Content             = msg.Content;
     Title               = msg.Title;
     PrimaryButtonText   = msg.PrimaryText;
     SecondaryButtonText = msg.SecondaryText;
 }
Exemplo n.º 2
0
        public void ConfirmReception(Guid guid, IPEndPoint endPoint)
        {
            ConfirmationMessage confirmation = new ConfirmationMessage(_name, guid);

            byte[] bytes = SerializeMessage(confirmation);
            _udpClient.Send(bytes, bytes.Length, endPoint);
        }
Exemplo n.º 3
0
 private void DeleteConfirm(ConfirmationMessage parameter)
 {
     if (parameter.Response.GetValueOrDefault())
     {
         Delete();
     }
 }
Exemplo n.º 4
0
 protected bool ConfirmDialog(String text, String title)
 {
     var message = new ConfirmationMessage(text, title
                 , MessageBoxImage.Question, MessageBoxButton.YesNo, "Confirm");
     Messenger.Raise(message);
     return message.Response.HasValue && message.Response.Value;
 }
Exemplo n.º 5
0
 public void RetweetThisTabAll()
 {
     Task.Factory.StartNew(() =>
     {
         IEnumerable <TabDependentTweetViewModel> tweets;
         using (NotifyStorage.NotifyManually("タイムラインの内容を取得しています..."))
         {
             tweets = this.CurrentForegroundTimeline.CoreViewModel.TweetsSource.ToArrayVolatile();
         }
         var msg = new ConfirmationMessage(
             "このタブに含まれるすべてのツイートをRetweetします。" + Environment.NewLine +
             "(対象ツイート: " + tweets.Count() + "件)" + Environment.NewLine +
             "よろしいですか?", "全てRetweet",
             System.Windows.MessageBoxImage.Warning,
             System.Windows.MessageBoxButton.OKCancel,
             "Confirm");
         this.Parent.Messenger.Raise(msg);
         if (msg.Response.GetValueOrDefault())
         {
             var lai = this.TabProperty.LinkAccountInfos.ToArray();
             tweets.OrderBy(t => t.Tweet.CreatedAt)
             .ForEach(t => PostOffice.Retweet(lai, t.Tweet));
         }
     });
 }
Exemplo n.º 6
0
        public void DeleteMarkedItems()
        {
            ConfirmationMessage cm = new ConfirmationMessage(this, "Are you sure you want to delete the marked items?", async(selection) =>
            {
                if (selection == true)
                {
                    try
                    {
                        this.IsBusy        = true;
                        int deletedPhrases = await this.phraseDataService.DeleteAsync(this.GetMarkedPhrases());
                        await this.RemoveMarkedItemsAsync();
                        this.IsBusy = false;
                        NotificationMessage deletedMessage = new NotificationMessage(this, $"{deletedPhrases} phrases have been deleted.");
                        Messenger.Default.Send(deletedMessage);
                    }
                    catch (Exception ex)
                    {
                        ErrorMessage errorMessage = new ErrorMessage(this, ex.Message);
                        Messenger.Default.Send(errorMessage);
                    }
                    finally
                    {
                        this.IsBusy = false;
                    }
                }
            });

            Messenger.Default.Send(cm);
        }
Exemplo n.º 7
0
 private void PrintAtenaSeal(ConfirmationMessage parameter)
 {
     if (parameter.Response == true)
     {
         PrintAtenaSealCore();
     }
 }
Exemplo n.º 8
0
 private void PrintKokyakuDaicho(ConfirmationMessage parameter)
 {
     if (parameter.Response == true)
     {
         PrintKokyakuDaichoCore();
     }
 }
Exemplo n.º 9
0
        protected bool ConfirmDialog(String text, String title)
        {
            var message = new ConfirmationMessage(text, title, MessageBoxImage.Question, MessageBoxButton.YesNo, "Confirm");

            Messenger.Raise(message);
            return(message.Response.Value);
        }
Exemplo n.º 10
0
        public async void RemoveCompletedAll(IEnumerable selectedItems)
        {
            if (ShiftDown)
            {
                var items = Model.QueueItems
                            .Where(item => item.Model.State == QueueState.Complete && item.Model.IsBatch).ToArray();
                await RemoveTS(items);

                return;
            }
            var candidates = Model.QueueItems
                             .Select(item => item.Model)
                             .Where(s => s.State == QueueState.Complete || s.State == QueueState.PreFailed).ToArray();

            if (candidates.Length > 0)
            {
                var message = new ConfirmationMessage(
                    candidates.Length + "個のアイテムを削除します。",
                    "Amatsukaze アイテム削除",
                    MessageBoxImage.Question,
                    MessageBoxButton.OKCancel,
                    "Confirm");

                await Messenger.RaiseAsync(message);

                if (message.Response == true)
                {
                    Model.Server?.ChangeItem(new ChangeItemData()
                    {
                        ChangeType = ChangeItemType.RemoveCompleted
                    });
                }
            }
        }
Exemplo n.º 11
0
        public void DeleteSelectedOperations()
        {
            ConfirmationMessage cm = new ConfirmationMessage(this, "Are you sure you want to delete the selected operations?", async(selection) =>
            {
                if (selection == true)
                {
                    try
                    {
                        this.IsBusy           = true;
                        int deletedOperations = await this.operationDataService.DeleteAsync(this.GetSelectedOperations());
                        await this.LoadAllOperationsAsync();
                        await this.RefreshItemsAsync();
                        this.IsBusy = false;
                        NotificationMessage deletedMessage = new NotificationMessage(this, $"{deletedOperations} operations have been deleted.");
                        Messenger.Default.Send(deletedMessage);
                    }
                    catch (Exception ex)
                    {
                        ErrorMessage errorMessage = new ErrorMessage(this, ex.Message);
                        Messenger.Default.Send(errorMessage);
                    }
                    finally
                    {
                        this.IsBusy = false;
                    }
                }
            });

            Messenger.Default.Send(cm);
        }
Exemplo n.º 12
0
        private async Task <bool> GetOutPath()
        {
            Item.Outputs[0].DstPath = Item.Outputs[0].DstPath.TrimEnd(Path.DirectorySeparatorChar);
            if (System.IO.Directory.Exists(Item.Outputs[0].DstPath) == false)
            {
                var message = new ConfirmationMessage(
                    "出力先フォルダが存在しません。作成しますか?",
                    "Amatsukaze フォルダ作成",
                    System.Windows.MessageBoxImage.Information,
                    System.Windows.MessageBoxButton.OKCancel,
                    "Confirm");

                await Messenger.RaiseAsync(message);

                if (message.Response != true)
                {
                    return(false);
                }

                try
                {
                    Directory.CreateDirectory(Item.Outputs[0].DstPath);
                }
                catch (Exception e)
                {
                    Description = "フォルダの作成に失敗しました: " + e.Message;
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 13
0
        public Task <bool> ShowMessage(ConfirmationMessage confirmationMessage)
        {
            var modal = new MainModalViewModel(confirmationMessage);

            Modal = modal;
            return(modal.CompletionTask);
        }
Exemplo n.º 14
0
        public void FileExport()
        {
            var cm = new ConfirmationMessage(
                "色設定をエクスポートすると、現在の設定内容がKrileの設定に反映されます。" +
                "よろしいですか?", "色設定保存", System.Windows.MessageBoxImage.Warning,
                System.Windows.MessageBoxButton.YesNo, "Confirm");

            this.Messenger.Raise(cm);
            if (cm.Response.GetValueOrDefault())
            {
                var sfm = new SavingFileSelectionMessage("SaveFile");
                sfm.Title  = "色設定ファイルの保存";
                sfm.Filter = "色設定ファイル|*.kcx";
                this.Messenger.Raise(sfm);
                if (sfm.Response != null)
                {
                    try
                    {
                        Apply();
                        XMLSerializer.SaveXML <ColoringProperty>(sfm.Response, Setting.Instance.ColoringProperty);
                    }
                    catch
                    {
                        this.Messenger.Raise(new InformationMessage("ファイルを読み込めません。",
                                                                    "色設定ファイルのロードエラー", System.Windows.MessageBoxImage.Error, "Message"));
                    }
                }
            }
        }
Exemplo n.º 15
0
 public void RequestClose(ConfirmationMessage message)
 {
     if (message.Response == true)
     {
         Messenger.Raise(new WindowActionMessage("Close", WindowAction.Close));
     }
 }
Exemplo n.º 16
0
        public async void Remove(IEnumerable selectedItems)
        {
            if (ShiftDown)
            {
                var selected = selectedItems.OfType <DisplayQueueItem>().ToArray();
                var items    = selected.Where(item => item.Model.State == QueueState.Complete && item.Model.IsBatch).ToArray();
                if (selected.Length - items.Length > 0)
                {
                    var message = new ConfirmationMessage(
                        "TSファイルを削除できるのは、通常または自動追加のアイテムのうち\r\n" +
                        "完了した項目だけです。" + (selected.Length - items.Length) + "件のアイテムがこれに該当しないため除外\r\nされます",
                        "Amatsukaze TSファイル削除除外",
                        MessageBoxImage.Information,
                        MessageBoxButton.OK,
                        "Confirm");

                    await Messenger.RaiseAsync(message);
                }
                await RemoveTS(items);

                return;
            }
            foreach (var item in selectedItems.OfType <DisplayQueueItem>().ToArray())
            {
                var file = item.Model;
                Model.Server?.ChangeItem(new ChangeItemData()
                {
                    ItemId     = file.Id,
                    ChangeType = ChangeItemType.RemoveItem
                });
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// 確認ダイアログを表示する
        /// 使用するにはView側に、InteractionMessageTriggerの定義が必要
        /// <param name="message"></param>
        /// <param name="title"></param>
        /// <returns>OKが押された場合はtrue</returns>
        public bool ShowConfirmDialog(string message, string title = "Confirm")
        {
            var confirmationMessage = new ConfirmationMessage(message, title, MessageBoxImage.Question, MessageBoxButton.OKCancel, ConfirmMessageKey);

            Messenger.Raise(confirmationMessage);
            return(confirmationMessage.Response ?? false);
        }
Exemplo n.º 18
0
 private void Delete(ConfirmationMessage message)
 {
     if (message.Response.HasValue && message.Response.Value)
     {
         _model.DeleteMap();
         _model.UpdateParent();
     }
 }
Exemplo n.º 19
0
 private void AllStop(ConfirmationMessage message)
 {
     if (message.Response.HasValue && message.Response.Value)
     {
         RecordersViewModel.StopAllRecorders();
         PlayersViewModel.StopAllPlayers();
     }
 }
Exemplo n.º 20
0
 private void AllStop(ConfirmationMessage message)
 {
     if (message.Response.HasValue && message.Response.Value)
     {
         RecordersViewModel.StopAllRecorders();
         PlayersViewModel.StopAllPlayers();
     }
 }
    protected override void AddAttributesToRender(HtmlTextWriter writer)
    {
        base.AddAttributesToRender(writer);
        string script = "confirmAsync('" + ConfirmationMessage.Replace("'", "\\'") + "', " + Callback() + ");" +
                        "return false;";

        writer.AddAttribute(HtmlTextWriterAttribute.Onclick, script, false);
    }
Exemplo n.º 22
0
//        #region FolderDialogKind変更通知プロパティ
//        private FolderSelectionDialogPreference _FolderDialogKind;

//        public FolderSelectionDialogPreference FolderDialogKind
//        {
//            get
//            { return _FolderDialogKind; }
//            set
//            {
//                if (EqualityComparer<FolderSelectionDialogPreference>.Default.Equals(_FolderDialogKind, value))
//                    return;
//                _FolderDialogKind = value;
//#if NET4
//                RaisePropertyChanged("FolderDialogKind");
//#elif NET45
//                RaisePropertyChanged();
//#endif
//            }
//        }
//        #endregion

        public void RequestClose(ConfirmationMessage message)
        {
            if (message.Response.HasValue && message.Response.Value)
            {
                CanClose = true;
                Messenger.Raise(new WindowActionMessage(WindowAction.Close, "Close"));
            }
        }
Exemplo n.º 23
0
 public void SetDefaultColor(ConfirmationMessage parameter)
 {
     if (parameter.Response.GetValueOrDefault())
     {
         // デフォルトカラーを設定
         ApplyColoringProperty(new ColoringProperty());
     }
 }
Exemplo n.º 24
0
        /// <summary>
        /// 任意の形式の確認メッセージを非同期で表示します。
        /// </summary>
        /// <param name="self">ViewModel</param>
        /// <param name="messageBoxText">メッセージ本文</param>
        /// <param name="title">タイトル</param>
        /// <param name="buttonKinds">表示するボタンの種類</param>
        /// <param name="defaultResult">初期フォーカスをあてるボタン</param>
        /// <param name="messageKey">メッセージキー</param>
        /// <returns>結果</returns>
        private async static Task <ConfirmationMessage> ShowConfirmationTargetMessageAsync(ViewModel self, string messageBoxText, string title, MessageBoxButton buttonKinds, MessageBoxResult defaultResult, string messageKey)
        {
            var mes = new ConfirmationMessage(messageBoxText, title, MessageBoxImage.Question, buttonKinds, defaultResult, messageKey);

            mes = await self.Messenger.GetResponseAsync(mes); // Messenger.RaiseAsync() しつつ、戻り値を取得している?

            return(mes);
        }
Exemplo n.º 25
0
        public void Delete(ConfirmationMessage message)
        {
            if (message.Response != true)
            {
                return;
            }

            this.Model.Master.Delete(this.SelectedPerson.Value.Model.ID);
        }
Exemplo n.º 26
0
        public void ConfirmFromView([NotNull] ConfirmationMessage message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            OutputMessage = $"{DateTime.Now}: ConfirmFromView: {message.Response ?? false}";
        }
Exemplo n.º 27
0
        /// <summary>
        /// Confirmationメッセージを表示させ、どのボタンを押したかをキャッチする
        /// </summary>
        private void ConfirmationMethod()
        {
            // Yes Noボタンを表示させた場合
            // Yes:result.Response=true No:result.Response=false
            ConfirmationMessage result = ShowConfirmationDialog("メッセージ", "タイトル", MessageBoxButton.YesNo, MessageBoxImage.Question);

            // OK キャンセルを表示させた場合
            // OK:result.Response=true Cancel:result.Response=null
            result = ShowConfirmationDialog("メッセージ", "タイトル", MessageBoxButton.OKCancel, MessageBoxImage.Question);
        }
Exemplo n.º 28
0
        public async void ConfirmFromViewModel()
        {
            var message = new ConfirmationMessage("これはテスト用メッセージです。", "テスト", "MessageKey_Confirm")
            {
                Button = MessageBoxButton.OKCancel
            };
            await Messenger.RaiseAsync(message);

            OutputMessage = $"{DateTime.Now}: ConfirmFromViewModel: {message.Response ?? false}";
        }
Exemplo n.º 29
0
        private async void DoRestart()
        {
            var message = new ConfirmationMessage(Resource.ConfirmationNeeded, Resource.DoYouWantToRestartApplication);
            var res     = await _MessageBox.ShowMessage(message);

            if (res)
            {
                _Application.Restart();
            }
        }
Exemplo n.º 30
0
        protected bool ShowRetryCancel(Exception e)
        {
            var msg = new ConfirmationMessage(e.Message, XwtMessager.Retry);

            msg.Buttons.Clear();
            msg.Buttons.Add(XwtMessager.Abort);
            msg.ConfirmButton = XwtMessager.Retry;
            msg.Icon          = StockIcons.Error;
            return(MessageDialog.Confirm(msg));
        }
Exemplo n.º 31
0
        public void ClearCount()
        {
            var msg = new ConfirmationMessage("開始回数データをすべて消去します。よろしいですか?", "警告", System.Windows.MessageBoxImage.Warning, System.Windows.MessageBoxButton.YesNo, "Confirmation");

            Messenger.Raise(msg);
            if (msg.Response ?? false)
            {
                LauncherCoreViewModel.ClearCount();
                Initialize();
            }
        }
        public async void OnClosing(CancelEventArgs cancelEvent)
        {
            cancelEvent.Cancel = true;
            var confirmationMessage = new ConfirmationMessage(Resource.ConfirmationNeeded, Resource.DoYouWantToCloseApplication, Resource.Ok, Resource.Cancel);
            var close = await _MessageBox.ShowMessage(confirmationMessage);

            if (close)
            {
                _Application.ForceClose();
            }
        }
Exemplo n.º 33
0
        private static async Task ShowConfirmationDialogAsync(ConfirmationMessage message)
        {
            var window = new ConfirmationWindow()
            {
                VM = message.VM
            };

            await window.ShowDialog(MainWindow);

            message.Process(message.VM.Result);
        }
Exemplo n.º 34
0
 private void Delete()
 {
     if (!this.Tweet.ShowDeleteButton) return;
     var conf = new ConfirmationMessage("ツイート @" + this.Tweet.Status.User.ScreenName + ": " + this.Tweet.Status.Text + " を削除してもよろしいですか?",
         "ツイートの削除", System.Windows.MessageBoxImage.Warning, System.Windows.MessageBoxButton.OKCancel, "Confirm");
     this.Messenger.Raise(conf);
     if (conf.Response.GetValueOrDefault())
     {
         PostOffice.RemoveTweet(AccountStorage.Get(this.Tweet.Status.User.ScreenName), this.Tweet.Status.Id);
     }
 }
		public override void DeleteMultipleItems ()
		{
			Set<SolutionEntityItem> projects = new Set<SolutionEntityItem> ();
			
			ConfirmationMessage confirmMsg = new ConfirmationMessage ();
			confirmMsg.ConfirmButton = AlertButton.Delete;
			confirmMsg.AllowApplyToAll = CurrentNodes.Length > 1;
			
			foreach (ITreeNavigator node in CurrentNodes) {
				ProjectFolder folder = (ProjectFolder) node.DataItem as ProjectFolder;
				Project project = folder.Project;
				ProjectFile[] files = project != null ? project.Files.GetFilesInPath (folder.Path) : null;
				
				if (files != null && files.Length == 0) {
					confirmMsg.Text = GettextCatalog.GetString ("Are you sure you want to permanently delete the folder {0}?", folder.Path);
					bool yes = MessageService.Confirm (confirmMsg);
					if (!yes) 
						return;
	
					bool removeFiles = false;
					try {
						if (Directory.Exists (folder.Path))
							// Indirect events will remove the files from the project
							FileService.DeleteDirectory (folder.Path);
						else
							removeFiles = true;
					} catch (Exception ex) {
						MessageService.ShowError (GettextCatalog.GetString ("The folder {0} could not be deleted from disk: {1}", folder.Path, ex.Message));
						removeFiles = true;
					}
					if (removeFiles && project != null) {
						List<ProjectFile> list = new List<ProjectFile>();
						list.AddRange (project.Files.GetFilesInVirtualPath (folder.Path.ToRelative (project.BaseDirectory)));
						ProjectFile pf = project.Files.GetFileWithVirtualPath (folder.Path.ToRelative (project.BaseDirectory));
						if (pf != null) list.Add (pf);
						foreach (var f in list)
							project.Files.Remove (f);
					}
				}
				else {
					bool yes = MessageService.Confirm (GettextCatalog.GetString ("Do you really want to remove folder {0}?", folder.Name), AlertButton.Remove);
					if (!yes) return;
					
					ProjectFile[] inParentFolder = project.Files.GetFilesInPath (Path.GetDirectoryName (folder.Path));
					
					if (inParentFolder.Length == files.Length) {
						// This is the last folder in the parent folder. Make sure we keep
						// a reference to the folder, so it is not deleted from the tree.
						ProjectFile folderFile = new ProjectFile (Path.GetDirectoryName (folder.Path));
						folderFile.Subtype = Subtype.Directory;
						project.Files.Add (folderFile);
					}
					
					foreach (ProjectFile file in files)
						project.Files.Remove (file);
					
					projects.Add (project);
				}
			}
			IdeApp.ProjectOperations.Save (projects);
		}
Exemplo n.º 36
0
 private void Delete()
 {
     if (!this.Tweet.ShowDeleteButton) return;
     ConfirmationMessage conf = null;
     if (!User32.IsKeyPressed(VirtualKey.VK_SHIFT))
     {
         var msg = String.Format("ツイート @{0}: {1} を削除してもよろしいですか?", this.Tweet.Status.User.ScreenName, this.Tweet.Status.Text);
         conf = new ConfirmationMessage(msg, "ツイートの削除", System.Windows.MessageBoxImage.Warning, System.Windows.MessageBoxButton.OKCancel, "Confirm");
         this.RaiseMessage(conf);
     }
     if ((conf == null) || (conf.Response.GetValueOrDefault()))
     {
         if (this.Tweet.IsDirectMessage)
         {
             PostOffice.RemoveDirectMessage(AccountStorage.Get(this.Tweet.Status.User.ScreenName), this.Tweet.Status.Id);
         }
         else
         {
             PostOffice.RemoveTweet(AccountStorage.Get(this.Tweet.Status.User.ScreenName), this.Tweet.Status.Id);
         }
     }
 }
Exemplo n.º 37
0
 private void DeleteConfirm(ConfirmationMessage parameter)
 {
     if (parameter.Response.GetValueOrDefault())
     {
         Delete();
     }
 }
Exemplo n.º 38
0
 public void FileExport()
 {
     var cm = new ConfirmationMessage(
         "色設定をエクスポートすると、現在の設定内容がKrileの設定に反映されます。" +
         "よろしいですか?", "色設定保存", System.Windows.MessageBoxImage.Warning,
          System.Windows.MessageBoxButton.YesNo, "Confirm");
     this.Messenger.Raise(cm);
     if (cm.Response.GetValueOrDefault())
     {
         var sfm = new SavingFileSelectionMessage("SaveFile");
         sfm.Title = "色設定ファイルの保存";
         sfm.Filter = "色設定ファイル|*.kcx";
         this.Messenger.Raise(sfm);
         if (sfm.Response != null)
         {
             try
             {
                 Apply();
                 XMLSerializer.SaveXML<ColoringProperty>(sfm.Response, Setting.Instance.ColoringProperty);
             }
             catch
             {
                 this.Messenger.Raise(new InformationMessage("ファイルを読み込めません。",
                     "色設定ファイルのロードエラー", System.Windows.MessageBoxImage.Error, "Message"));
             }
         }
     }
 }
Exemplo n.º 39
0
 public void SetDefaultColor(ConfirmationMessage parameter)
 {
     if (parameter.Response.GetValueOrDefault())
     {
         // デフォルトカラーを設定
         ApplyColoringProperty(new ColoringProperty());
     }
 }
Exemplo n.º 40
0
 public void RetweetThisTabAll()
 {
     Task.Factory.StartNew(() =>
     {
         IEnumerable<TabDependentTweetViewModel> tweets;
         using (NotifyStorage.NotifyManually("タイムラインの内容を取得しています..."))
         {
             tweets = this.CurrentForegroundTimeline.CoreViewModel.TweetsSource.ToArrayVolatile();
         }
         var msg = new ConfirmationMessage(
             "このタブに含まれるすべてのツイートをRetweetします。" + Environment.NewLine +
             "(対象ツイート: " + tweets.Count() + "件)" + Environment.NewLine +
             "よろしいですか?", "全てFavorite",
             System.Windows.MessageBoxImage.Warning,
             System.Windows.MessageBoxButton.OKCancel,
             "Confirm");
         this.Parent.Messenger.Raise(msg);
         if (msg.Response.GetValueOrDefault())
         {
             var lai = this.TabProperty.LinkAccountInfos.ToArray();
             tweets.OrderBy(t => t.Tweet.CreatedAt)
                 .ForEach(t => PostOffice.Retweet(lai, t.Tweet));
         }
     });
 }
Exemplo n.º 41
0
 public void UnfavoriteThisTabAll()
 {
     Task.Factory.StartNew(() =>
     {
         IEnumerable<TabDependentTweetViewModel> tweets;
         using (NotifyStorage.NotifyManually("タイムラインの内容を取得しています..."))
         {
             tweets = this.CurrentForegroundTimeline.CoreViewModel.TweetsSource.ToArrayVolatile();
         }
         var msg = new ConfirmationMessage(
             "このタブに含まれるすべてのツイートをUnfavoriteします。" + Environment.NewLine +
             "(対象ツイート: " + tweets.Count() + "件)" + Environment.NewLine +
             "よろしいですか?", "全てUnfavorite",
             System.Windows.MessageBoxImage.Warning,
             System.Windows.MessageBoxButton.OKCancel,
             "Confirm");
         this.Parent.Messenger.Raise(msg);
         if (msg.Response.GetValueOrDefault())
             tweets.ForEach(t => t.Unfavorite());
     });
 }
Exemplo n.º 42
0
 private void ReportForSpam()
 {
     if (!CanReportForSpam()) return;
     var conf = new ConfirmationMessage("ユーザー @" + this.Tweet.Status.User.ScreenName + " をスパム報告してもよろしいですか?" + Environment.NewLine +
         "(Krileに存在するすべてのアカウントでスパム報告を行います)",
         "スパム報告の確認", System.Windows.MessageBoxImage.Warning, System.Windows.MessageBoxButton.OKCancel, "Confirm");
     this.Messenger.Raise(conf);
     if (conf.Response.GetValueOrDefault())
     {
         AccountStorage.Accounts.ForEach(i => Task.Factory.StartNew(() => ApiHelper.ExecApi(() => i.ReportSpam(this.Tweet.Status.User.NumericId))));
         TweetStorage.Remove(this.Tweet.Status.Id);
         NotifyStorage.Notify("R4Sしました: @" + this.Tweet.Status.User.ScreenName);
         Task.Factory.StartNew(() =>
             TweetStorage.GetAll(t => t.Status.User.NumericId == this.Tweet.Status.User.NumericId)
             .ForEach(vm => TweetStorage.Remove(vm.Status.Id)));
     }
 }
Exemplo n.º 43
0
//        #region FolderDialogKind変更通知プロパティ
//        private FolderSelectionDialogPreference _FolderDialogKind;

//        public FolderSelectionDialogPreference FolderDialogKind
//        {
//            get
//            { return _FolderDialogKind; }
//            set
//            { 
//                if (EqualityComparer<FolderSelectionDialogPreference>.Default.Equals(_FolderDialogKind, value))
//                    return;
//                _FolderDialogKind = value;
//#if NET4
//                RaisePropertyChanged("FolderDialogKind");
//#elif NET45
//                RaisePropertyChanged();
//#endif
//            }
//        }
//        #endregion

        public void RequestClose(ConfirmationMessage message)
        {
            if (message.Response.HasValue && message.Response.Value)
            {
                CanClose = true;
                Messenger.Raise(new WindowActionMessage(WindowAction.Close, "Close"));
            }
        }
Exemplo n.º 44
0
 private void PrintAtenaSeal(ConfirmationMessage parameter)
 {
     if (parameter.Response == true)
     {
         PrintAtenaSealCore();
     }
 }
Exemplo n.º 45
0
 private void PrintKokyakuDaicho(ConfirmationMessage parameter)
 {
     if (parameter.Response == true)
     {
         PrintKokyakuDaichoCore();
     }
 }
Exemplo n.º 46
0
 public void R4S()
 {
     var cm = new ConfirmationMessage(
         "ユーザー @" + User.TwitterUser.ScreenName + " をスパム報告します。",
         "スパム報告", System.Windows.MessageBoxImage.Warning, System.Windows.MessageBoxButton.OKCancel,
         "Confirm");
     if (this.Messenger.GetResponse(cm).Response.GetValueOrDefault())
     {
         this.Messenger.Raise(new WindowActionMessage("WindowAction", WindowAction.Close));
         Task.Factory.StartNew(() =>
         {
             AccountStorage.Accounts.ForEach(i => ReportForSpam(i, User.TwitterUser));
             NotifyStorage.Notify("@" + User.TwitterUser.ScreenName + " をスパム報告しました。");
         });
     }
 }
		public override void DeleteMultipleItems ()
		{
			var projects = new HashSet<SolutionEntityItem> ();

			var confirmMsg = new ConfirmationMessage () {
				ConfirmButton = AlertButton.Delete,
				AllowApplyToAll = CurrentNodes.Length > 1,
			};

			foreach (ITreeNavigator node in CurrentNodes) {
				var folder = node.DataItem as ProjectFolder;
				var project = folder.Project;
				
				confirmMsg.Text = GettextCatalog.GetString ("Are you sure you want to permanently delete folder {0}?", folder.Path);
				if (!MessageService.Confirm (confirmMsg))
					continue;

				var folderRelativePath = folder.Path.ToRelative (project.BaseDirectory);
				var files = project.Files.GetFilesInVirtualPath (folder.Path).ToList ();
				var folderPf = project.Files.GetFileWithVirtualPath (folderRelativePath);

				try {
					if (Directory.Exists (folder.Path))
						// Indirect events will remove the files from the project
						FileService.DeleteDirectory (folder.Path);
				} catch (Exception ex) {
					MessageService.ShowError (GettextCatalog.GetString ("The folder {0} could not be deleted from disk: {1}", folder.Path, ex.Message));
				}

				// even if we removed the directory successfully there may still be link files
				// so make sure we remove all the files
				foreach (var f in files)
					project.Files.Remove (f);

				// also remove the folder's own ProjectFile, if it exists 
				if (folderPf != null)
					project.Files.Remove (folderPf);

				// If it's the last item in the parent folder, make sure we keep a reference to the parent 
				// folder, so it is not deleted from the tree.
				var inParentFolder = project.Files.GetFilesInVirtualPath (folderRelativePath.ParentDirectory);
				if (!inParentFolder.Skip (1).Any()) {
					project.Files.Add (new ProjectFile (folder.Path.ParentDirectory) {
						Subtype = Subtype.Directory,
					});
				}

				projects.Add (project);
			}
			IdeApp.ProjectOperations.Save (projects);
		}