public AndroidAgent( IActivityTracker activityTracker, int contentId = -1) { ActivityTracker = activityTracker; ContentId = contentId; var displaySize = GetRealSize(Application .Context .GetSystemService(global::Android.Content.Context.WindowService) .JavaCast <IWindowManager> () .DefaultDisplay); Identity = new AgentIdentity( AgentType.Android, new Sdk( SdkId.XamarinAndroid, new FrameworkName(typeof(Java.Interop.Runtime) .Assembly .GetCustomAttribute <TargetFrameworkAttribute> () .FrameworkName), Array.Empty <string> (), "Android"), GetApplicationName(), deviceManufacturer: Build.Manufacturer, screenWidth: displaySize.X, screenHeight: displaySize.Y); RepresentationManager.AddProvider(new AndroidRepresentationProvider()); ViewHierarchyHandlerManager.AddViewHierarchyHandler("Android", this); }
public iOSAgent() { Identity = new AgentIdentity( AgentType.iOS, Sdk.FromEntryAssembly(SdkId.XamarinIos, "iOS"), NSBundle.MainBundle.InfoDictionary ["CFBundleName"] as NSString, screenWidth: (int)UIScreen.MainScreen.Bounds.Width, screenHeight: (int)UIScreen.MainScreen.Bounds.Height); RepresentationManager.AddProvider(new iOSRepresentationProvider()); new UnifiedNativeHelper().Initialize(); ViewHierarchyHandlerManager.AddViewHierarchyHandler("UIKit", this); }
public WpfAgent(Func <Window> mainWindowCreator = null) { this.mainWindowCreator = mainWindowCreator; latestMainWindow = mainWindowCreator?.Invoke(); if (latestMainWindow != null) { latestMainWindow.WindowState = WindowState.Minimized; latestMainWindow.Show(); } Identity = new AgentIdentity( AgentType.WPF, Sdk.FromEntryAssembly("WPF"), Assembly.GetEntryAssembly().GetName().Name); RepresentationManager.AddProvider(wpfRepresentationProvider = new WpfRepresentationProvider()); ViewHierarchyHandlerManager.AddViewHierarchyHandler("WPF", this); }
public MacAgent() { #if MAC_MOBILE var agentType = AgentType.MacMobile; const string profile = "Modern"; #elif MAC_DESKTOP var agentType = AgentType.MacNet45; const string profile = "Full"; #endif Identity = new AgentIdentity( agentType, Sdk.FromEntryAssembly("Xamarin.Mac", profile), NSBundle.MainBundle.InfoDictionary ["CFBundleName"] as NSString); RepresentationManager.AddProvider(new MacRepresentationProvider()); new UnifiedNativeHelper().Initialize(); ViewHierarchyHandlerManager.AddViewHierarchyHandler("AppKit", this); }
public override InspectView HighlightView(double x, double y, bool clear, string hierarchyKind) => ViewHierarchyHandlerManager.HighlightView(x, y, clear, hierarchyKind);
public override InspectView GetVisualTree(string hierarchyKind) => ViewHierarchyHandlerManager.GetView( NSApplication.SharedApplication, hierarchyKind);
public override InspectView GetVisualTree(string hierarchyKind) => ViewHierarchyHandlerManager.GetView( GetTopActivity()?.Window?.DecorView, hierarchyKind);
public override InspectView GetVisualTree(string hierarchyKind) => ViewHierarchyHandlerManager.GetView( iOSEvaluationContextGlobalObject.KeyWindow, hierarchyKind);
public override InspectView GetVisualTree(string hierarchyKind) => ViewHierarchyHandlerManager.GetView( Application.Current, hierarchyKind);