Ejemplo n.º 1
0
 public SaveDialogTests()
 {
     this.replServices = Substitute.For <IReplServices>();
     this.saveDialog   = new SaveDialog(
         replServices,
         filter => saveDialogStub(filter),
         message => { }
         );
 }
Ejemplo n.º 2
0
        private readonly IReplServices replServices;        // "back-end" services that handle inspection / evaluation of code.

        public MainWindow()
        {
            InitializeComponent();
            this.DataContext      = Model = new WindowViewModel();
            this.replServices     = new ReplServices();
            this.viewModelService = new ViewModelService(replServices);

            replServices.UserConfigurationLoaded += ConfigureWindow;
            Task.Run(BackgroundInitializationAsync);
        }
Ejemplo n.º 3
0
 public SaveDialog(
     IReplServices replServices,
     ShowSaveDialog showSaveDialog     = null,
     Action <string> showMessageDialog = null)
 {
     this.replServices   = replServices;
     this.showSaveDialog = showSaveDialog ?? ((string saveFormats) =>
     {
         var saveFileDialog = new SaveFileDialog {
             Filter = saveFormats
         };
         var result = saveFileDialog.ShowDialog();
         return(new SaveDialogResult(result, saveFileDialog.FileName, saveFileDialog.FilterIndex));
     });
     this.showMessageDialog = showMessageDialog ?? (text => MessageBox.Show(text));
 }
 public ViewModelServiceTests()
 {
     this.replServices      = Substitute.For <IReplServices>();
     this.viewModelServices = new ViewModelService(replServices);
 }
Ejemplo n.º 5
0
 public ViewModelService(IReplServices services)
 {
     this.services = services;
 }
 public AvalonSyntaxHighlightTransformer(IReplServices replServices, Guid lineNumber)
 {
     this.replServices = replServices;
     this.lineNumber   = lineNumber;
 }