예제 #1
0
 internal override DialogScreenResult ProcessInvocation <T>(
     DialogServiceInvocation invocation,
     IScreenFactory <T> screen
     )
 {
     return(_dialogResult);
 }
예제 #2
0
        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));
        }
예제 #3
0
 internal virtual bool ProcessMessageBoxInvocationCore(
     DialogServiceInvocation invocation,
     out CustomDialogResult result
     )
 {
     result = CustomDialogResult.None;
     return(false);
 }
예제 #4
0
        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));
        }
예제 #5
0
        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));
        }
예제 #6
0
 internal virtual bool ProcessScreenDialogInvocationCore <TScreen>(
     DialogServiceInvocation invocation,
     IScreenFactory <TScreen> screen,
     out DialogScreenResult result
     ) where TScreen : IScreenBase
 {
     result = null;
     return(false);
 }
예제 #7
0
        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));
        }
예제 #8
0
 internal virtual bool ProcessFolderDialogInvocationCore(
     DialogServiceInvocation invocation,
     out string selectedPath,
     out bool result
     )
 {
     selectedPath = null;
     result       = false;
     return(false);
 }
예제 #9
0
 internal virtual bool ProcessFileDialogInvocationCore(
     DialogServiceInvocation invocation,
     out string filename,
     out bool result
     )
 {
     filename = null;
     result   = false;
     return(false);
 }
예제 #10
0
        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));
        }
예제 #11
0
        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));
        }
예제 #12
0
        internal CustomDialogResult ProcessMessageBoxInvocation(
            DialogServiceInvocation invocation
            )
        {
            CustomDialogResult dialogResult;

            if (!ProcessMessageBoxInvocationCore(invocation, out dialogResult))
            {
                ThrowAssertionException(invocation);
            }

            return(dialogResult);
        }
예제 #13
0
        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));
        }
예제 #14
0
        internal bool ProcessFileDialogInvocation(
            DialogServiceInvocation invocation,
            out string filename
            )
        {
            bool dialogResult;

            if (!ProcessFileDialogInvocationCore(invocation, out filename, out dialogResult))
            {
                ThrowAssertionException(invocation);
            }

            return(dialogResult);
        }
예제 #15
0
        internal DialogScreenResult ProcessScreenDialogInvocation <TScreen>(
            DialogServiceInvocation invocation,
            IScreenFactory <TScreen> screen
            ) where TScreen : IScreenBase
        {
            DialogScreenResult dialogResult;

            if (!ProcessScreenDialogInvocationCore(invocation, screen, out dialogResult))
            {
                ThrowAssertionException(invocation);
            }

            return(dialogResult);
        }
예제 #16
0
        internal bool ProcessFolderDialogInvocation(
            DialogServiceInvocation invocation,
            out string selectedPath
            )
        {
            bool dialogResult;

            if (!ProcessFolderDialogInvocationCore(invocation, out selectedPath, out dialogResult))
            {
                ThrowAssertionException(invocation);
            }

            return(dialogResult);
        }
예제 #17
0
        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);
        }
예제 #18
0
 internal abstract DialogScreenResult ProcessInvocation <T>(
     DialogServiceInvocation invocation,
     IScreenFactory <T> screen
     ) where T : IScreenBase;
예제 #19
0
 private void ThrowAssertionException(
     DialogServiceInvocation actualInvocation
     )
 {
     throw new ArgumentException();
 }
예제 #20
0
 internal ResponderBase(DialogServiceMethod method)
 {
     ExpectedInvocation = new DialogServiceInvocation(method);
 }