internal override DialogScreenResult ProcessInvocation <T>( DialogServiceInvocation invocation, IScreenFactory <T> screen ) { return(_dialogResult); }
DialogScreenResult IDialogService.ShowDialog(IScreenFactory <IScreenBase> screen, IScreenBase parent, string title) { var invocation = new DialogServiceInvocation(DialogServiceMethod.OpenDialog); invocation.Caption.SetValue(title); invocation.Parent.SetValue(parent); return(DequeueResponder().ProcessScreenDialogInvocation(invocation, screen)); }
internal virtual bool ProcessMessageBoxInvocationCore( DialogServiceInvocation invocation, out CustomDialogResult result ) { result = CustomDialogResult.None; return(false); }
bool IDialogService.ShowFolderBrowseDialog(IScreenBase parent, out string selectedPath, string message, Environment.SpecialFolder?specialFolder) { var invocation = new DialogServiceInvocation(DialogServiceMethod.ShowOpenFileDialog); invocation.Message.SetValue(message); invocation.Parent.SetValue(parent); return(DequeueResponder().ProcessFolderDialogInvocation(invocation, out selectedPath)); }
private CustomDialogResult ProcessMessageBoxInvocation(DialogServiceMethod type, string message, string caption) { var invocation = new DialogServiceInvocation(type); invocation.Message.SetValue(message); invocation.Caption.SetValue(caption); return(DequeueResponder().ProcessMessageBoxInvocation(invocation)); }
internal virtual bool ProcessScreenDialogInvocationCore <TScreen>( DialogServiceInvocation invocation, IScreenFactory <TScreen> screen, out DialogScreenResult result ) where TScreen : IScreenBase { result = null; return(false); }
internal override bool ProcessMessageBoxInvocationCore(DialogServiceInvocation invocation, out CustomDialogResult result) { result = DialogResult; return (ExpectedInvocation.Method == invocation.Method && ExpectedInvocation.Caption.Matches(invocation.Caption) && ExpectedInvocation.Message.Matches(invocation.Message)); }
internal virtual bool ProcessFolderDialogInvocationCore( DialogServiceInvocation invocation, out string selectedPath, out bool result ) { selectedPath = null; result = false; return(false); }
internal virtual bool ProcessFileDialogInvocationCore( DialogServiceInvocation invocation, out string filename, out bool result ) { filename = null; result = false; return(false); }
bool IDialogService.ShowOpenFileDialog(IScreenBase parent, out string fileName, string filter, string initialDirectory, IEnumerable <string> customPlaces) { var invocation = new DialogServiceInvocation(DialogServiceMethod.ShowOpenFileDialog); invocation.Filter.SetValue(filter); invocation.InitialDirectory.SetValue(initialDirectory); invocation.Parent.SetValue(parent); return(DequeueResponder().ProcessFileDialogInvocation(invocation, out fileName)); }
internal override bool ProcessFolderDialogInvocationCore( DialogServiceInvocation invocation, out string selectedPath, out bool result ) { selectedPath = _selectedPath; result = DialogResult; return (ExpectedInvocation.Method == invocation.Method && ExpectedInvocation.Message.Matches(invocation.Message)); }
internal CustomDialogResult ProcessMessageBoxInvocation( DialogServiceInvocation invocation ) { CustomDialogResult dialogResult; if (!ProcessMessageBoxInvocationCore(invocation, out dialogResult)) { ThrowAssertionException(invocation); } return(dialogResult); }
internal override bool ProcessFileDialogInvocationCore( DialogServiceInvocation invocation, out string fileName, out bool result ) { fileName = _fileName; result = DialogResult; return (ExpectedInvocation.Method == invocation.Method && ExpectedInvocation.InitialDirectory.Matches(invocation.InitialDirectory) && ExpectedInvocation.Filter.Matches(invocation.Filter)); }
internal bool ProcessFileDialogInvocation( DialogServiceInvocation invocation, out string filename ) { bool dialogResult; if (!ProcessFileDialogInvocationCore(invocation, out filename, out dialogResult)) { ThrowAssertionException(invocation); } return(dialogResult); }
internal DialogScreenResult ProcessScreenDialogInvocation <TScreen>( DialogServiceInvocation invocation, IScreenFactory <TScreen> screen ) where TScreen : IScreenBase { DialogScreenResult dialogResult; if (!ProcessScreenDialogInvocationCore(invocation, screen, out dialogResult)) { ThrowAssertionException(invocation); } return(dialogResult); }
internal bool ProcessFolderDialogInvocation( DialogServiceInvocation invocation, out string selectedPath ) { bool dialogResult; if (!ProcessFolderDialogInvocationCore(invocation, out selectedPath, out dialogResult)) { ThrowAssertionException(invocation); } return(dialogResult); }
internal override bool ProcessScreenDialogInvocationCore <T>( DialogServiceInvocation invocation, IScreenFactory <T> screen, out DialogScreenResult result ) { result = null; bool match = ExpectedInvocation.Method == invocation.Method && ExpectedInvocation.Caption.Matches(invocation.Caption) && ExpectedInvocation.Parent.Matches(invocation.Parent); if (match) { result = ProcessInvocation(invocation, screen); } return(match); }
internal abstract DialogScreenResult ProcessInvocation <T>( DialogServiceInvocation invocation, IScreenFactory <T> screen ) where T : IScreenBase;
private void ThrowAssertionException( DialogServiceInvocation actualInvocation ) { throw new ArgumentException(); }
internal ResponderBase(DialogServiceMethod method) { ExpectedInvocation = new DialogServiceInvocation(method); }