- presentationmodeldemo.zip
- App.Configuration.Wpf
- App.Configuration
- App.Core
- App.Data
- libs
- AttachedCommandBehavior.dll
- Castle.Core.dll
- Castle.DynamicProxy2.dll
- Castle.MicroKernel.dll
- Castle.Windsor.dll
- PresentationModelBase
- PresentationModelDemo.sln
- WPFUI
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PresentationModelBase;
using Microsoft.Win32;
namespace App.Configuration.Wpf
{
class WpfDialogSystem : IDialogSystem
{
#region IDialogServicesProvider Members
public QuestionResult AskQuestion(string question)
{
return AskQuestion(question, "Question");
}
public QuestionResult AskQuestion(string question, string title)
{
var result = System.Windows.MessageBox.Show(question, title, System.Windows.MessageBoxButton.YesNo, System.Windows.MessageBoxImage.Question);
switch (result)
{
case System.Windows.MessageBoxResult.Yes:
return QuestionResult.Yes;
default:
return QuestionResult.No;
}
}
public System.IO.FileInfo ChooseFile(string title, string filter)
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.Title = title;
dialog.Filter = filter;
dialog.ShowDialog();
if (dialog.FileName != null && dialog.FileName.Trim() != string.Empty)
return new System.IO.FileInfo(dialog.FileName);
return null;
}
public System.IO.FileInfo ChooseImage()
{
return ChooseImage("");
}
public System.IO.FileInfo ChooseImage(string title)
{
return ChooseFile(title, "Image Files (*.bmp, *.jpg, *.jpeg, *.png)|*.bmp;*.jpg;*.jpeg;*.png");
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.