Ejemplo n.º 1
0
        internal DialogExpectation(System.Windows.Forms.Form HostingForm)
        {
            this.m_Handers      = new HandlerCollection();
            this.m_Callback     = null;
            this.m_HanderToHook = IntPtr.Zero;
            this.m_hWndList     = new List <IntPtr>();
            this.m_Listening    = false;

            this.m_ExpectAllDialog     = false;
            this.m_ExpectAllMessageBox = false;

            this.m_UnexpectedCalllback = DefaultUnexpectedCallback;
            this.m_HostingForm         = HostingForm;

            this.BeginListening();
        }
Ejemplo n.º 2
0
 public void ExpectMessageBox(string Text, int ExpectedTimes, ModalFormActivated Handler)
 {
     this.m_Handers.Add(Text, Handler, ExpectedTimes);
 }
Ejemplo n.º 3
0
 public void ExpectMessageBox(string Text, ModalFormActivated Handler)
 {
     this.ExpectMessageBox(Text, int.MaxValue, Handler);
 }
Ejemplo n.º 4
0
 public void ExpectFileDialog(ModalFormActivated handler)
 {
     modal.ExpectModal("Open", handler, true);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// One of four overloaded methods to set up a modal dialog handler.  If you expect a modal
 /// dialog to appear and can handle it during the test, use this method to set up the handler.
 /// </summary>
 /// <param name="name">The caption on the dialog you expect.</param>
 /// <param name="handler">The method to call when that dialog appears.</param>
 protected void ExpectModal(string name, ModalFormActivated handler)
 {
     modal.ExpectModal(name, handler, true);
 }
Ejemplo n.º 6
0
 public void ExpectModal(string name, ModalFormActivated handler, bool expected)
 {
     BeginListening();             //can be called multiple times.
     handlers[name] = new Handler(handler, expected);
 }
Ejemplo n.º 7
0
 protected void ExpectFileDialog(ModalFormActivated handler, bool expected)
 {
     modal.ExpectModal(FileDialogTester.InitialFileDialogName, handler, true);
 }
Ejemplo n.º 8
0
 public void ExpectDialog <T>(ModalFormActivated Handler) where T : System.Windows.Forms.Form
 {
     this.ExpectDialog <T>(Handler, int.MaxValue);
 }
Ejemplo n.º 9
0
 ///<summary>
 /// Registers an expected or unexpected handler for the given form caption.
 ///</summary>
 ///<param name="name">The caption of the form to handle.</param>
 ///<param name="handler">The handler.</param>
 ///<param name="expected">True if this handler is expected; false if this handler is not expected.</param>
 public void ExpectModal(string name, ModalFormActivated handler, bool expected)
 {
     BeginListening();
     handlers[name] = new Handler(handler, expected);
 }
Ejemplo n.º 10
0
 public void ExpectModal(string name, ModalFormActivated handler, bool expected)
 {
     this.FormHandler = Adapter;
     handlers[name]   = new Handler(handler, (expected ? 1 : 0), name);
 }
Ejemplo n.º 11
0
 protected void ExpectFileDialog(ModalFormActivated handler, bool expected)
 {
     modal.ExpectModal(FileDialogTester.InitialFileDialogName, handler, true);
 }
Ejemplo n.º 12
0
		public void ExpectFileDialog(ModalFormActivated handler)
		{
			modal.ExpectModal("Open", handler, true);
		}
Ejemplo n.º 13
0
 ///<summary>
 /// Registers an expected or unexpected handler for the given form caption.
 ///</summary>
 ///<param name="name">The caption of the form to handle.</param>
 ///<param name="handler">The handler.</param>
 ///<param name="expected">True if this handler is expected; false if this handler is not expected.</param>
 public void ExpectModal(string name, ModalFormActivated handler, bool expected)
 {
     BeginListening();
     handlers[name] = new Handler(handler, expected);
 }
Ejemplo n.º 14
0
 public void ExpectMessageBox(ModalFormActivated Handler)
 {
     this.m_ExpectAllMessageBox = true;
     this.m_UnexpectedCalllback = Handler;
 }
Ejemplo n.º 15
0
 public void ExpectModal(string name, ModalFormActivated handler)
 {
     ExpectModal(name, handler, true);
 }
Ejemplo n.º 16
0
 public void ExpectDialog(ModalFormActivated Handler)
 {
     this.m_ExpectAllDialog     = true;
     this.m_UnexpectedCalllback = Handler;
 }
Ejemplo n.º 17
0
 public void ExpectModal(string name, ModalFormActivated handler, bool expected)
 {
     this.FormHandler = Adapter;
     handlers[name] = new Handler(handler, (expected ? 1 : 0), name);
 }
Ejemplo n.º 18
0
 public void ExpectDialog <T>(ModalFormActivated Handler, int ExpectedTimes) where T : System.Windows.Forms.Form
 {
     this.m_Handers.Add(typeof(T).Name, Handler, ExpectedTimes);
 }
Ejemplo n.º 19
0
 protected void ExpectFileDialog(ModalFormActivated handler, bool expected)
 {
     modal.ExpectModal("Open", handler, true);
 }
Ejemplo n.º 20
0
 public void ExpectModal(string name, ModalFormActivated handler)
 {
     ExpectModal(name, handler, true);
 }
Ejemplo n.º 21
0
 /// <summary>
 /// One of four overloaded methods to set up a modal dialog handler.  If you expect a modal
 /// dialog to appear and can handle it during the test, use this method to set up the handler.
 /// </summary>
 /// <param name="name">The caption on the dialog you expect.</param>
 /// <param name="handler">The method to call when that dialog appears.</param>
 protected void ExpectModal(string name, ModalFormActivated handler)
 {
     modal.ExpectModal(name, handler, true);
 }
Ejemplo n.º 22
0
 /// <summary>
 /// This method is needed because the way the FileDialogs working are strange.
 /// It seems that both open/save dialogs initial title is "Open". The handler
 /// </summary>
 protected void ExpectFileDialog(ModalFormActivated handler, bool expected)
 {
     modal.ExpectModal("Open", handler, true);
 }
Ejemplo n.º 23
0
 /// <summary>
 /// One of four overloaded methods to set up a modal dialog handler.  If you expect a modal
 /// dialog to appear and can handle it during the test, use this method to set up the handler.
 /// Because "expected" is usually (always) true if you are calling this, I don't expect it will
 /// be used externally.
 /// </summary>
 /// <param name="name">The caption on the dialog you expect.</param>
 /// <param name="handler">The method to call when that dialog appears.</param>
 /// <param name="expected">A boolean to indicate whether you expect this modal dialog to appear.</param>
 protected void ExpectModal(string name, ModalFormActivated handler, bool expected)
 {
     modal.ExpectModal(name, handler, expected);
 }
Ejemplo n.º 24
0
 /// <summary>
 /// One of four overloaded methods to set up a modal dialog handler.  If you expect a modal
 /// dialog to appear and can handle it during the test, use this method to set up the handler.
 /// Because "expected" is usually (always) true if you are calling this, I don't expect it will
 /// be used externally.
 /// </summary>
 /// <param name="name">The caption on the dialog you expect.</param>
 /// <param name="handler">The method to call when that dialog appears.</param>
 /// <param name="expected">A boolean to indicate whether you expect this modal dialog to appear.</param>
 protected void ExpectModal(string name, ModalFormActivated handler, bool expected)
 {
     modal.ExpectModal(name, handler, expected);
 }
Ejemplo n.º 25
0
		public void ExpectModal(string name, ModalFormActivated handler, bool expected)
		{
			BeginListening(); //can be called multiple times.
			handlers[name] = new Handler(handler, expected);
		}