Пример #1
0
 protected String[] OpenDialog(String title, String filter = "すべてのファイル(*.*)|*.*", bool multiSelect = false)
 {
     var message = new OpeningFileSelectionMessage("Open")
     {
         Title = title,
         Filter = filter,
         MultiSelect = multiSelect,
     };
     Messenger.Raise(message);
     return message.Response;
 }
Пример #2
0
		public void OpenMedia()
		{
			var message = new OpeningFileSelectionMessage
			{
				MessageKey = "OpenMedia",
				Title = "投稿するメディア ファイルを選択してちょうだい。",
				Filter = "イメージ ファイル (*.png; *.jpg: *.jpeg; *.gif)|*.png;*.jpg:*.jpeg;*.gif",
				MultiSelect = false,
			};
			this.Messenger.Raise(message);

			if (message.Response.HasValue()) this.NewStatus.MediaPaths.Add(message.Response.First());
			this.Focus();
		}
Пример #3
0
        private void SetImportData(OpeningFileSelectionMessage parameter)
        {
            if (parameter.Response == null || parameter.Response.Length == 0)
                return;

            bool ExistsError = this.CustomerListViewModel.SetImportData(parameter.Response[0]);

            if (ExistsError)
            {
                Messenger.Raise(new InformationMessage("インポートが完了しましたが、エラーが発生したためインポートできなかった行があります。\nOKをクリックすると詳細情報を表示します。",
                    "お知らせ", "Info"));
                System.Diagnostics.Process.Start("notepad.exe", "ErrorList.txt");
            }
            else
            {
                Messenger.Raise(new InformationMessage("インポート完了。", "お知らせ", "Info"));
            }
            //customerListViewModel.Initialize(orderController);
        }
Пример #4
0
        private void SetBackUpData(OpeningFileSelectionMessage parameter)
        {
            if (parameter.Response == null || parameter.Response.Length == 0)
                return;

            File.Copy(parameter.Response[0], AppDomain.CurrentDomain.BaseDirectory + @"\Resources\MyData.sdf", true);
            Messenger.Raise(new InformationMessage("復元しました。再起動すると復元データを利用できます。", "お知らせ", "Info"));
        }
Пример #5
0
 public void SelectBackgroundImage()
 {
     var msg = new OpeningFileSelectionMessage
     {
         Filter = "画像ファイル|*.png;*.jpg;*.jpeg;*.gif;*.bmp",
         Title = "背景画像を選択"
     };
     if (!String.IsNullOrEmpty(BackgroundImagePath))
     {
         msg.FileName = BackgroundImagePath;
     }
     var resp = this.Messenger.GetResponse(msg);
     if (resp.Response != null && resp.Response.Length > 0)
     {
         BackgroundImagePath = resp.Response[0];
     }
 }
Пример #6
0
 public void OpenFileDialogCallback(OpeningFileSelectionMessage msg)
 {
     if (msg.Response == null || msg.Response.Count() == 0) return;
     foreach (var item in msg.Response)
     {
         if (Media.Count >= 4) return;
         try
         {
             Media.Add(new UploadMediaInfoViewModel(Media, item));
         }
         catch (Exception ex)
         {
             ApplicationMessageService.Instance.Messages.Add(ApplicationMessage.CreateExceptionMessage(ex));
         }
     }
 }
Пример #7
0
        /// <summary>
        /// パラメータファイル読込
        /// </summary>
        /// <param name="parameter">パラメータ</param>
        public void OpenParamFile(OpeningFileSelectionMessage parameter)
        {
            if (parameter.Response == null || parameter.Response.Length < 1)
            {
                return;
            }

            try
            {
                _parameterFileManager.load(parameter.Response[0]);
            }
            catch (Exception e)
            {
                StatusBarMessage = e.Message;
            }
        }
Пример #8
0
 private void SelectSoundPath(OpeningFileSelectionMessage parameter)
 {
     if (parameter.Response != null)
     {
         this.NotifySoundPath = parameter.Response;
     }
 }
Пример #9
0
 public void RequestLoadImage(OpeningFileSelectionMessage message)
 {
     if (message.Response != null)
     {
         ImageSource = message.Response.First();
     }
 }
Пример #10
0
 public void RequestAddFiles(OpeningFileSelectionMessage message)
 {
     if (message.Response != null)
     {
         MP3Files = message.Response.Select(File.Create).Union(MP3Files ?? new List<File>(0));
     }
 }
Пример #11
0
 public void OpenFileDialog()
 {
     var msg = new OpeningFileSelectionMessage("OpenFile");
     msg.Filter = "画像ファイル|*.jpg;*.jpeg;*.jpe;*.gif;*.png;*.bmp";
     msg.Title = "背景画像を選択";
     string resp;
     if ((resp = this.Messenger.GetResponse(msg).Response) != null)
     {
         this.BackgroundImage = resp;
     }
 }
Пример #12
0
 public void FileImport()
 {
     var ofm = new OpeningFileSelectionMessage("OpenFile");
     ofm.Title = "色設定ファイルを選択";
     ofm.Filter = "色設定ファイル|*.kcx";
     this.Messenger.Raise(ofm);
     if (ofm.Response != null)
     {
         try
         {
             var data = XMLSerializer.LoadXML<ColoringProperty>(ofm.Response, true);
             ApplyColoringProperty(data);
         }
         catch
         {
             this.Messenger.Raise(new InformationMessage("ファイルを読み込めません。",
                 "色設定ファイルのロードエラー", System.Windows.MessageBoxImage.Error, "Message"));
         }
     }
 }
        public void SetDefaultBrowserPath()
        {
            var message = new OpeningFileSelectionMessage("Open") {Filter = "実行可能ファイル(*.exe)|*.exe"};
            Messenger.Raise(message);
            if (message.Response == null)
            {
                return;
            }

            DefaultBrowserPath = message.Response[0];
        }
Пример #14
0
 public void AddMedia(OpeningFileSelectionMessage parameter)
 {
     if (parameter.Response == null) return;
     foreach (var i in parameter.Response)
     {
         if (Medias.Count < 4) Medias.Add(new MainWindowSendingMediaViewModel(i));
     }
     UpdateStatusCommand.RaiseCanExecuteChanged();
     RaisePropertyChanged(() => HasMedia);
     RaisePropertyChanged(() => UpdateStatusTextLength);
 }
Пример #15
0
 public void AttachImage()
 {
     var msg = new OpeningFileSelectionMessage
     {
         Filter = "画像ファイル|*.jpg;*.jpeg;*.jpe;*.png;*.gif;*.bmp;*.dib|全てのファイル|*.*",
         InitialDirectory = Setting.LastImageOpenDir.Value,
         MultiSelect = false,
         Title = "添付する画像ファイルを指定"
     };
     var m = Messenger.GetResponse(msg);
     if (m.Response == null || m.Response.Length <= 0 || String.IsNullOrEmpty(m.Response[0]) ||
         !File.Exists(m.Response[0])) return;
     try
     {
         AttachedImage = new ImageDescriptionViewModel(m.Response[0]);
         Setting.LastImageOpenDir.Value = Path.GetDirectoryName(m.Response[0]);
     }
     catch (Exception ex)
     {
         this.Messenger.Raise(new TaskDialogMessage(new TaskDialogOptions
         {
             Title = "画像読み込みエラー",
             MainIcon = VistaTaskDialogIcon.Error,
             MainInstruction = "画像の添付ができませんでした。",
             Content = "画像の読み込み時にエラーが発生しました。" + Environment.NewLine +
                       "未対応の画像か、データが破損しています。",
             ExpandedInfo = ex.ToString(),
             CommonButtons = TaskDialogCommonButtons.Close,
         }));
         AttachedImage = null;
     }
 }
Пример #16
0
        void OnOpenFileDialog(OpeningFileSelectionMessage m)
        {
            if (m.Response == null)
            {
                Messenger.Raise(new InformationMessage("Cancel", "Error", MessageBoxImage.Error, "Info"));
                return;
            }

            AddItems(m.Response.Select(f => new Uri(f)));
        }
Пример #17
0
        public void AttachImage()
        {
            var msg = new OpeningFileSelectionMessage
            {
                Filter = "画像ファイル|*.jpg;*.jpeg;*.jpe;*.png;*.gif;*.bmp;*.dib|全てのファイル|*.*",
                InitialDirectory = Setting.LastImageOpenDir.Value,
                MultiSelect = false,
                Title = "添付する画像ファイルを指定"
            };
            var m = _parent.Messenger.GetResponse(msg);
            if (m.Response == null || m.Response.Length <= 0 ||
                String.IsNullOrEmpty(m.Response[0]) || !File.Exists(m.Response[0]))
            {
                return;
            }

            Setting.LastImageOpenDir.Value = Path.GetDirectoryName(m.Response[0]);
            AttachImageFromPath(m.Response[0]);
        }
Пример #18
0
        public void OpenFile(OpeningFileSelectionMessage m)
        {
            if (m.Response == null)
            {
                Messenger.Raise(new InformationMessage("Cancel", "Error", MessageBoxImage.Error, "Info"));
                return;
            }

            m.Response.Select(f => { FileUris.Add(f); return f; }).ToList();
        }
Пример #19
0
        public void AttachImage()
        {
            var dir = Setting.LastImageOpenDir.Value;
            if (!Directory.Exists(dir))
            {
                dir = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
            }
            var msg = new OpeningFileSelectionMessage
            {
                Filter =
                    InputAreaResources.AttachImageDlgFilterImg + "|*.jpg;*.jpeg;*.jpe;*.png;*.gif;*.bmp;*.dib|" +
                    InputAreaResources.AttachImageDlgFilterAll + "|*.*",
                InitialDirectory = dir,
                MultiSelect = false,
                Title = InputAreaResources.AttachImageDlgTitle
            };
            var m = _parent.Messenger.GetResponse(msg);
            if (m.Response == null || m.Response.Length <= 0 ||
                String.IsNullOrEmpty(m.Response[0]) || !File.Exists(m.Response[0]))
            {
                return;
            }

            Setting.LastImageOpenDir.Value = Path.GetDirectoryName(m.Response[0]);
            this.AttachImageFromPath(m.Response[0]);
        }
Пример #20
0
 public void SelectBackgroundImage()
 {
     var resp = this.Messenger.GetResponseSafe(() =>
     {
         var msg = new OpeningFileSelectionMessage
         {
             Title = SettingFlipResources.ThemeOpenPictureTitle,
             Filter = SettingFlipResources.ThemeOpenPictureFilter + "|*.png;*.jpg;*.jpeg;*.gif;*.bmp"
         };
         if (!String.IsNullOrEmpty(BackgroundImagePath))
         {
             msg.FileName = BackgroundImagePath;
         }
         return msg;
     });
     if (resp.Response != null && resp.Response.Length > 0)
     {
         BackgroundImagePath = resp.Response[0];
     }
 }