Inheritance: IAutomationBridge
Example #1
0
		public static MockBridge SetUpEnvironment ()
		{
			Log.ErrorHappened += OnError;
			
			Type interopProviderType = typeof (AutomationInteropProvider);

			// Set the bridge assembly name to a value that will
			// fail when the static constructor attempts to load it.
			Environment.SetEnvironmentVariable ("MONO_UIA_BRIDGE",
			                                    "Ignore this intentional error");
			
			// Inject a mock automation bridge into the
			// AutomationInteropProvider, so that we don't try
			// to load the UiaAtkBridge.
			MockBridge bridge = new MockBridge ();
			FieldInfo bridgeField =
				interopProviderType.GetField ("bridges", BindingFlags.NonPublic
				                                        | BindingFlags.Static);
			
			List<IAutomationBridge> bridges = new List<IAutomationBridge> ();
			bridges.Add (bridge);
				
			bridgeField.SetValue (null, bridges);
			
			bridge.ClientsAreListening = true;

			return bridge;
		}
Example #2
0
        public static MockBridge SetUpEnvironment()
        {
            Log.ErrorHappened += OnError;

            Type interopProviderType = typeof(AutomationInteropProvider);

            // Set the bridge assembly name to a value that will
            // fail when the static constructor attempts to load it.
            Environment.SetEnvironmentVariable("MONO_UIA_BRIDGE",
                                               "Ignore this intentional error");

            // Inject a mock automation bridge into the
            // AutomationInteropProvider, so that we don't try
            // to load the UiaAtkBridge.
            MockBridge bridge      = new MockBridge();
            FieldInfo  bridgeField =
                interopProviderType.GetField("bridges", BindingFlags.NonPublic
                                             | BindingFlags.Static);

            List <IAutomationBridge> bridges = new List <IAutomationBridge> ();

            bridges.Add(bridge);

            bridgeField.SetValue(null, bridges);

            bridge.ClientsAreListening = true;

            return(bridge);
        }
Example #3
0
		public virtual void SetUp ()
		{			
			bridge = TestHelper.SetUpEnvironment ();
			form = new Form ();
			form.Show ();
			formProvider = (FormProvider) ProviderFactory.GetProvider (form);
		}