[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-patches
Subject:    [Mono-patches] r130702 -
From:       "Andres Aragoneses (aaragoneses () novell ! com)"
Date:       2009-03-31 19:29:29
Message-ID: 20090331192929.3BD279472C () mono-cvs ! ximian ! com
[Download RAW message or body]

Author: knocte
Date: 2009-03-31 15:29:29 -0400 (Tue, 31 Mar 2009)
New Revision: 130702

Modified:
   branches/uia2atk/post-1.0-research/UiaAtkBridge/MoonUiaAtkBridge/AdapterFactory.cs
   branches/uia2atk/post-1.0-research/UiaAtkBridge/MoonUiaAtkBridge/ChangeLog
Log:
* AdapterFactory.cs: We still need to check the type besides
  checking != null.

Modified: branches/uia2atk/post-1.0-research/UiaAtkBridge/MoonUiaAtkBridge/AdapterFactory.cs
 ===================================================================
--- branches/uia2atk/post-1.0-research/UiaAtkBridge/MoonUiaAtkBridge/AdapterFactory.cs	2009-03-31 \
                19:11:46 UTC (rev 130701)
+++ branches/uia2atk/post-1.0-research/UiaAtkBridge/MoonUiaAtkBridge/AdapterFactory.cs	2009-03-31 \
19:29:29 UTC (rev 130702) @@ -9,6 +9,7 @@
 using System.Reflection.Emit;
 
 using System.Windows.Automation.Peers;
+using System.Windows.Automation.Provider;
 
 namespace MoonUiaAtkBridge
 {
@@ -39,7 +40,9 @@
 			List<PatternInterface> patterns = new List<PatternInterface> ();
 			
 			foreach (PatternInterface pattern in allPatterns) {
-				if (peer.GetPattern (pattern) != null)
+				object patternImplementor = peer.GetPattern (pattern);
+				if (patternImplementor != null &&
+				    GetProviderInterfaceForPattern (pattern).IsInstanceOfType \
(patternImplementor))  patterns.Add (pattern);
 			}
 			
@@ -50,8 +53,17 @@
 			return atkTypes;
 		}
 
-		internal Type GetDynamicType (AutomationPeer thePeer)
+		private static Type GetProviderInterfaceForPattern (PatternInterface pattern)
 		{
+			switch (pattern) {
+			case PatternInterface.Value: return typeof (IValueProvider);
+			//TODO: check if there's already a function for this; if not, finish this \
switch... +			}
+			return null;
+		}
+
+		internal static Type GetDynamicType (AutomationPeer thePeer)
+		{
 			List<Type> atkInterfaces = GetAtkInterfacesForPeer (thePeer);
 
 			string typeName = String.Empty;

Modified: branches/uia2atk/post-1.0-research/UiaAtkBridge/MoonUiaAtkBridge/ChangeLog
===================================================================
--- branches/uia2atk/post-1.0-research/UiaAtkBridge/MoonUiaAtkBridge/ChangeLog	2009-03-31 \
                19:11:46 UTC (rev 130701)
+++ branches/uia2atk/post-1.0-research/UiaAtkBridge/MoonUiaAtkBridge/ChangeLog	2009-03-31 \
19:29:29 UTC (rev 130702) @@ -1,5 +1,10 @@
 2009-03-31  Andrés G. Aragoneses  <aaragoneses@novell.com>
 
+	* AdapterFactory.cs: We still need to check the type besides
+	checking != null.
+
+2009-03-31  Andrés G. Aragoneses  <aaragoneses@novell.com>
+
 	* AdapterFactory.cs: Emit ret and ignore events.
 
 2009-03-31  Andrés G. Aragoneses  <aaragoneses@novell.com>

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic