public TwitterTabletSearchPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
 {
     _applicationDelegate = applicationDelegate;
     _window = window;
     _splitView = new SplitViewController();
     _window.RootViewController = _splitView;
 }
예제 #2
0
        public AutoSuspendHelper(UIApplicationDelegate appDelegate)
        {
            Reflection.ThrowIfMethodsNotOverloaded("AutoSuspendHelper", appDelegate,
                "FinishedLaunching", "OnActivated", "DidEnterBackground");

            RxApp.SuspensionHost.IsLaunchingNew = Observable.Never<Unit>();
            RxApp.SuspensionHost.IsResuming = _finishedLaunching.Select(_ => Unit.Default);
            RxApp.SuspensionHost.IsUnpausing = _activated.Select(_ => Unit.Default);

            var untimelyDeath = new Subject<Unit>();
            AppDomain.CurrentDomain.UnhandledException += (o,e) => untimelyDeath.OnNext(Unit.Default);

            RxApp.SuspensionHost.ShouldInvalidateState = untimelyDeath;

            RxApp.SuspensionHost.ShouldPersistState = _backgrounded.SelectMany(app => {
                var taskId = app.BeginBackgroundTask(new NSAction(() => untimelyDeath.OnNext(Unit.Default)));

                // NB: We're being force-killed, signal invalidate instead
                if (taskId == UIApplication.BackgroundTaskInvalid) {
                    untimelyDeath.OnNext(Unit.Default);
                    return Observable.Empty<IDisposable>();
                }

                return Observable.Return(Disposable.Create(() => app.EndBackgroundTask(taskId)));
            });
        }
예제 #3
0
        private MXTouchContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
            : base(theApp, appDelegate, window)
        {
            touchNavigation = new MXTouchNavigation(appDelegate, window);

            ViewGroups = new List<MXTouchViewGroup>();
        }
        public static void Initialize(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
        {
            // initialize the application and hold a reference for a bit
            MXTouchSlideoutContainer thisContainer = new MXTouchSlideoutContainer(theApp, appDelegate, window);
            MXContainer.InitializeContainer(thisContainer);

            thisContainer.StartApplication();
        }
예제 #5
0
		protected MXTouchContainer (MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window): base(theApp)
		{
			_appDelegate = appDelegate;
			_touchNavigation = new MXTouchNavigation(_appDelegate);
			_window = window;
			
			ViewGroups = new List<MXTouchViewGroup>();
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="MvxSidePanelsPresenter"/> class.
        /// </summary>
        /// <param name="applicationDelegate">The application delegate.</param>
        /// <param name="window">The window.</param>
        public MvxSidePanelsPresenter(UIApplicationDelegate applicationDelegate, UIWindow window) :
            base(applicationDelegate, window)
        {
            _multiPanelController = new MvxMultiPanelController();
            _activePanel          = MvxPanelEnum.Center;

            Mvx.RegisterSingleton <IMvxSideMenu>(_multiPanelController);
        }
예제 #7
0
        private MXTouchContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window) : base(theApp)
        {
            _appDelegate     = appDelegate;
            _touchNavigation = new MXTouchNavigation(_appDelegate);
            _window          = window;

            ViewGroups = new List <MXTouchViewGroup>();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MvxSidePanelsPresenter"/> class.
        /// </summary>
        /// <param name="applicationDelegate">The application delegate.</param>
        /// <param name="window">The window.</param>
        public MvxSidePanelsPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
            : base(applicationDelegate, window)
        {
            _multiPanelController = new MvxMultiPanelController();
            _activePanel = MvxPanelEnum.Center;

            Mvx.RegisterSingleton<IMvxSideMenu>(_multiPanelController);
        }
예제 #9
0
        private MXSlideoutContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
            : base(theApp)
        {
            _appDelegate = appDelegate;
            Menu = new SlideoutNavigationController();

            _window = window;
            _window.RootViewController = Menu;
        }
예제 #10
0
 public static void RegisterUnhandledExceptions(this UIApplicationDelegate app, Action <Exception> action)
 {
     CrashReporting.HookCrashReporterWithMono(() => {
         AppDomain.CurrentDomain.UnhandledException += (s, e) => {
             var ex = e.ExceptionObject as Exception;
             action.Invoke(ex);
         };
     });
 }
예제 #11
0
        public static void Initialize(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
        {
            // initialize the application and hold a reference for a bit
            MXSlideoutContainer thisContainer = new MXSlideoutContainer(theApp, appDelegate, window);

            MXContainer.InitializeContainer(thisContainer);

            thisContainer.StartApplication();
        }
예제 #12
0
 void ISettings.LazyInit()
 {
     if (IsInitialized)
     {
         return;
     }
     AppDelegate = (UIKit.UIApplicationDelegate)UIApplication.SharedApplication.Delegate;
     Init();
 }
예제 #13
0
        private ProtoPadServer(UIApplicationDelegate appDelegate, UIWindow window, int? overrideListeningPort = null, string overrideBroadcastedAppName = null)
        {
            _appDelegate = appDelegate;
            _window = window;

            BroadcastedAppName = overrideBroadcastedAppName ?? String.Format("ProtoPad Service on iOS Device {0}", UIDevice.CurrentDevice.Name);
            ListeningPort = overrideListeningPort ?? 8080;
            LocalIPAddress = Helpers.GetCurrentIPAddress();

            var mainMonotouchAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(a => a.GetName().Name.ToLower() == "monotouch");

            var requestHandlers = new Dictionary<string, Func<byte[], string>>
                {
                    {"GetMainXamarinAssembly", requestData => mainMonotouchAssembly.FullName},
                    {"WhoAreYou", requestData => "iOS"},
                    {"GetPixateCssFiles", requestData => JsonEncode(_pixateCssPaths.ToArray())},
                    {"ExecuteAssembly", requestData =>
                        {
                            var response = "{}";
                            var remoteCommandDoneEvent = new AutoResetEvent(false);
                            _appDelegate.InvokeOnMainThread(() => ExecuteAssemblyAndCreateResponse(requestData, remoteCommandDoneEvent, ref response));
                            remoteCommandDoneEvent.WaitOne();
                            return response;
                        }
                    },
                    {"UpdatePixateCSS", requestData =>
                        {
                            var response = "{}";
                            var remoteCommandDoneEvent = new AutoResetEvent(false);
                            var filePathDataLength = requestData[1] + (requestData[0] << 8);
                            var filePathData = new byte[filePathDataLength];
                            Array.Copy(requestData, 2, filePathData, 0, filePathDataLength);
                            var filePath = Encoding.UTF8.GetString(filePathData);
                            var cssFileDataLength = requestData.Length - (2 + filePathDataLength);
                            var cssFileData = new byte[cssFileDataLength];
                            Array.Copy(requestData, 2 + filePathDataLength, cssFileData, 0, cssFileDataLength);
                            _appDelegate.InvokeOnMainThread(() => UpdatePixateCssFile(filePath, cssFileData, remoteCommandDoneEvent, ref response));
                            remoteCommandDoneEvent.WaitOne();
                            return response;
                        }
                    },
                    {"GetFileContents", requestData =>
                        {
                            var response = "";
                            var filePath = Encoding.UTF8.GetString(requestData);
                            var remoteCommandDoneEvent = new AutoResetEvent(false);
                            _appDelegate.InvokeOnMainThread(() => GetFileContents(filePath, remoteCommandDoneEvent, ref response));
                            remoteCommandDoneEvent.WaitOne();
                            return response;
                        }
                    }
                };

            _httpServer = new SimpleHttpServer(ListeningPort, requestHandlers);

            _udpServer = new UdpDiscoveryServer(BroadcastedAppName, String.Format("http://{0}:{1}/", LocalIPAddress, ListeningPort));
        }
예제 #14
0
 /// <summary>
 /// Initializes a new instance of the iOSApplicationHost class.
 /// </summary>
 /// <param name="appDelegate">The application delegate hosting the iOS app.</param>
 /// <param name="viewControllerTypes">
 /// A collection of view controllers and their associated view models used by the application.
 /// If null, the host will scan the calling assembly for view controllers.
 /// </param>
 /// <param name="applicationInstanceFactory">An object used to create application instances.</param>
 public iOSApplicationHost(
     UIApplicationDelegate appDelegate,
     ViewControllerTypes viewControllerTypes,
     IApplicationInstanceFactory applicationInstanceFactory)
     : base(applicationInstanceFactory)
 {
     this.appDelegate         = appDelegate;
     this.viewControllerTypes = viewControllerTypes;
     this.Initialize();
 }
예제 #15
0
 /// <summary>
 /// Initializes a new instance of the iOSApplicationHost class.
 /// </summary>
 /// <param name="appDelegate">The application delegate hosting the iOS app.</param>
 /// <param name="viewControllerTypes">
 /// A collection of view controllers and their associated view models used by the application.
 /// If null, the host will scan the calling assembly for view controllers.
 /// </param>
 /// <param name="createApplicationInstance">A factory method for creating application instances.</param>
 public iOSApplicationHost(
     UIApplicationDelegate appDelegate,
     ViewControllerTypes viewControllerTypes,
     Func <ApplicationHost, Session, ApplicationInstance> createApplicationInstance)
     : base(createApplicationInstance)
 {
     this.appDelegate         = appDelegate;
     this.viewControllerTypes = viewControllerTypes;
     this.Initialize();
 }
예제 #16
0
        public MXTouchNavigation(UIApplicationDelegate appDelegate)
        {
            _instance = this;

            var options = Attribute.GetCustomAttribute(appDelegate.GetType(), typeof(MXTouchContainerOptions)) as MXTouchContainerOptions;
            _options = options ?? new MXTouchContainerOptions();

            var tabletOptions = Attribute.GetCustomAttribute(appDelegate.GetType(), typeof(MXTouchTabletOptions)) as MXTouchTabletOptions;
            _tabletOptions = tabletOptions ?? new MXTouchTabletOptions(TabletLayout.SinglePane);
        }
예제 #17
0
 /// <summary>
 /// Initialize the specified appDelegate
 /// </summary>
 /// <returns>The initialize.</returns>
 /// <param name="appDelegate">App delegate.</param>
 /// <param name="licenseKey">License key.</param>
 public static void Initialize(UIKit.UIApplicationDelegate appDelegate, string licenseKey = null)
 {
     _initizalized = true;
     AppDelegate   = appDelegate;
     if (licenseKey != null)
     {
         System.Console.WriteLine("Forms9Patch is now open source using the MIT license ... so it's free, including for commercial use.  Why?  The more people who use it, the faster bugs will be found and fixed - which helps me and you.  So, please help get the word out - tell your friends, post on social media, write about it on the bathroom walls at work!  If you have purchased a license from me, please don't get mad - you did a good deed.  They really were not that expensive and you did a great service in encouraging me keep working on Forms9Patch.");
     }
     FormsGestures.iOS.Settings.Init();
 }
예제 #18
0
        private ProtoPadServer(UIApplicationDelegate appDelegate, UIWindow window, int?overrideListeningPort = null, string overrideBroadcastedAppName = null)
        {
            _appDelegate = appDelegate;
            _window      = window;

            BroadcastedAppName = overrideBroadcastedAppName ?? String.Format("ProtoPad Service on iOS Device {0}", UIDevice.CurrentDevice.Name);
            ListeningPort      = overrideListeningPort ?? 8080;
            LocalIPAddress     = Helpers.GetCurrentIPAddress();

            var mainMonotouchAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(a => a.GetName().Name.ToLower() == "monotouch");

            var requestHandlers = new Dictionary <string, Func <byte[], string> >
            {
                { "GetMainXamarinAssembly", requestData => mainMonotouchAssembly.FullName },
                { "WhoAreYou", requestData => "iOS" },
                { "GetPixateCssFiles", requestData => JsonEncode(_pixateCssPaths.ToArray()) },
                { "ExecuteAssembly", requestData =>
                  {
                      var response = "{}";
                      var remoteCommandDoneEvent = new AutoResetEvent(false);
                      _appDelegate.InvokeOnMainThread(() => ExecuteAssemblyAndCreateResponse(requestData, remoteCommandDoneEvent, ref response));
                      remoteCommandDoneEvent.WaitOne();
                      return(response);
                  } },
                { "UpdatePixateCSS", requestData =>
                  {
                      var response = "{}";
                      var remoteCommandDoneEvent = new AutoResetEvent(false);
                      var filePathDataLength     = requestData[1] + (requestData[0] << 8);
                      var filePathData           = new byte[filePathDataLength];
                      Array.Copy(requestData, 2, filePathData, 0, filePathDataLength);
                      var filePath          = Encoding.UTF8.GetString(filePathData);
                      var cssFileDataLength = requestData.Length - (2 + filePathDataLength);
                      var cssFileData       = new byte[cssFileDataLength];
                      Array.Copy(requestData, 2 + filePathDataLength, cssFileData, 0, cssFileDataLength);
                      _appDelegate.InvokeOnMainThread(() => UpdatePixateCssFile(filePath, cssFileData, remoteCommandDoneEvent, ref response));
                      remoteCommandDoneEvent.WaitOne();
                      return(response);
                  } },
                { "GetFileContents", requestData =>
                  {
                      var response = "";
                      var filePath = Encoding.UTF8.GetString(requestData);
                      var remoteCommandDoneEvent = new AutoResetEvent(false);
                      _appDelegate.InvokeOnMainThread(() => GetFileContents(filePath, remoteCommandDoneEvent, ref response));
                      remoteCommandDoneEvent.WaitOne();
                      return(response);
                  } }
            };

            _httpServer = new SimpleHttpServer(ListeningPort, requestHandlers);

            _udpServer = new UdpDiscoveryServer(BroadcastedAppName, String.Format("http://{0}:{1}/", LocalIPAddress, ListeningPort));
        }
예제 #19
0
        public static void PushController(this UIApplicationDelegate appDelegate, string controllerName, string propName, object objValue)
        {
            var nav  = appDelegate.Window.RootViewController as UINavigationController;
            var ctrl = (UIViewController)nav.Storyboard.InstantiateViewController(controllerName);
            var prop = ctrl.GetType().GetProperty(propName);

            if (prop != null)
            {
                prop.SetValue(ctrl, objValue);
            }
            nav.PushViewController(ctrl, true);
        }
        public MXTouchNavigation(UIApplicationDelegate appDelegate)
        {
            _instance = this;

            var options = Attribute.GetCustomAttribute(appDelegate.GetType(), typeof(MXTouchContainerOptions)) as MXTouchContainerOptions;

            _options = options ?? new MXTouchContainerOptions();

            var tabletOptions = Attribute.GetCustomAttribute(appDelegate.GetType(), typeof(MXTouchTabletOptions)) as MXTouchTabletOptions;

            _tabletOptions = tabletOptions ?? new MXTouchTabletOptions(TabletLayout.SinglePane);
        }
예제 #21
0
        public async Task InitializeAsync(UIApplicationDelegate appDelegate, NSDictionary options)
        {
            using (var _ = _analyticsService.StartTrace(this, "iOs Push Notifications Initialization"))
            {
                if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
                {
                    UNUserNotificationCenter.Current.RequestAuthorization(UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound,
                                                                          (granted, error) =>
                    {
                        if (granted)
                        {
                            _analyticsService.TraceInformation(this, "Permission granted for push notifications");
                            appDelegate.InvokeOnMainThread(UIApplication.SharedApplication.RegisterForRemoteNotifications);
                        }
                        else
                        {
                            if (error?.Code != null)
                            {
                                _analyticsService.TraceError(this, "Failed to get permission for push notifications", "ErrorCode", error.Code.ToString());
                            }
                            else
                            {
                                _analyticsService.TraceWarning(this, "Permission for push notifications not granted");
                            }
                        }
                    });
                }
                else if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
                {
                    var pushSettings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, new NSSet());

                    UIApplication.SharedApplication.RegisterUserNotificationSettings(pushSettings);
                    UIApplication.SharedApplication.RegisterForRemoteNotifications();
                }
                else
                {
                    const UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound;
                    UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes);
                }

                if (options != null)
                {
                    if (options.TryGetValue(new NSString("UIApplicationLaunchOptionsRemoteNotificationKey"), out var tapped))
                    {
                        _analyticsService.TraceVerbose(this, "Notification payload available for new app session");
                        await HandleMessageReceivedAsync(UIApplicationState.Inactive, (NSDictionary)tapped);
                    }
                }
            }
        }
예제 #22
0
        public static void RequestNewWindow(this UIApplicationDelegate nativeApplication, IApplication application, OpenWindowRequest?args)
        {
            if (application.Handler?.MauiContext is not IMauiContext applicationContext || args is null)
            {
                return;
            }

            var state        = args?.State;
            var userActivity = state.ToUserActivity(MauiUIApplicationDelegate.MauiSceneConfigurationKey);

            UIApplication.SharedApplication.RequestSceneSessionActivation(
                null,
                userActivity,
                null,
                err => application.Handler?.MauiContext?.CreateLogger <IApplication>()?.LogError(new NSErrorException(err), err.Description));
        }
예제 #23
0
        /// <summary>
        /// Record the date this application was installed (or the date that we started recording installation date).
        /// </summary>
        public static DateTime StampInstallDate(this UIApplicationDelegate @this, string name)
        {
            try
            {
                var query = new SecRecord(SecKind.GenericPassword)
                {
                    Service = name, Account = "account"
                };

                SecStatusCode secStatusCode;
                var           queriedRecord = SecKeyChain.QueryAsRecord(query, out secStatusCode);
                if (secStatusCode != SecStatusCode.Success)
                {
                    queriedRecord = new SecRecord(SecKind.GenericPassword)
                    {
                        Label       = name + " Install Date",
                        Service     = name,
                        Account     = query.Account,
                        Description = string.Format("The first date {0} was installed", name),
                        Generic     = NSData.FromString(DateTime.UtcNow.ToString())
                    };

                    var err = SecKeyChain.Add(queriedRecord);
                    if (err != SecStatusCode.Success)
                    {
                        System.Diagnostics.Debug.WriteLine("Unable to save stamp date!");
                    }
                }
                else
                {
                    DateTime time;
                    if (!DateTime.TryParse(queriedRecord.Generic.ToString(), out time))
                    {
                        SecKeyChain.Remove(query);
                    }
                }

                return(DateTime.Parse(NSString.FromData(queriedRecord.Generic, NSStringEncoding.UTF8)));
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                return(DateTime.Now);
            }
        }
예제 #24
0
        private static ExecuteResponse ExecuteAssembly(byte[] loadedAssemblyBytes, UIApplicationDelegate appDelegate, UIWindow window)
        {
            MethodInfo printMethod;

            object loadedInstance;

            try
            {
                // TODO: create new AppDomain for each loaded assembly, to prevent memory leakage
                var loadedAssembly = AppDomain.CurrentDomain.Load(loadedAssemblyBytes);
                var loadedType     = loadedAssembly.GetType("__MTDynamicCode");
                if (loadedType == null)
                {
                    return(null);
                }
                loadedInstance = Activator.CreateInstance(loadedType);
                printMethod    = loadedInstance.GetType().GetMethod("Main");
            }
            catch (Exception e)
            {
                return(new ExecuteResponse {
                    ErrorMessage = e.Message
                });
            }

            var response = new ExecuteResponse();

            try
            {
                printMethod.Invoke(loadedInstance, new object[] { appDelegate, window });
                var dumpsRaw = loadedInstance.GetType().GetField("___dumps").GetValue(loadedInstance) as IEnumerable;
                response.SetDumpValues(dumpsRaw.Cast <object>().Select(GetDumpObjectFromObject).ToList());
                response.SetMaxEnumerableItemCount(Convert.ToInt32(loadedInstance.GetType().GetField("___maxEnumerableItemCount").GetValue(loadedInstance)));
            }
            catch (Exception e)
            {
                var lineNumber = loadedInstance.GetType().GetField("___lastExecutedStatementOffset").GetValue(loadedInstance);
                response.ErrorMessage = String.Format("___EXCEPTION_____At offset: {0}__{1}", lineNumber, e.InnerException.Message);
            }

            return(response);
        }
예제 #25
0
        public static void CreateNativeWindow(this UIApplicationDelegate nativeApplication, IApplication application, UIApplication uiApplication, NSDictionary launchOptions)
        {
            // Find any userinfo/dictionaries we might pass into the activation state
            var dicts = new List <NSDictionary>();

            if (uiApplication.UserActivity?.UserInfo is not null)
            {
                dicts.Add(uiApplication.UserActivity.UserInfo);
            }
            if (launchOptions is not null)
            {
                dicts.Add(launchOptions);
            }

            var window = CreateNativeWindow(application, null, dicts.ToArray());

            if (window is not null)
            {
                nativeApplication.Window = window;
                nativeApplication.Window.MakeKeyAndVisible();
            }
        }
예제 #26
0
        public virtual object GetView(UIApplicationDelegate value)
        {
            //
            // Is there a window? If so, show that
            //
            if (value.Window != null)
            {
                return(GetView(value.Window));
            }

            //
            // What if we fake run the life cycle?
            //
            var launchOptions = new Foundation.NSDictionary();

            try
            {
                value.WillFinishLaunching(UIApplication.SharedApplication, launchOptions);
            }
            catch (Exception)
            {
            }
            try
            {
                value.FinishedLaunching(UIApplication.SharedApplication, launchOptions);
            }
            catch (Exception)
            {
            }
            if (value.Window != null)
            {
                return(GetView(value.Window));
            }

            //
            // Just show the object inspector
            //
            return(null);
        }
예제 #27
0
 public ViewPresenter(UIApplicationDelegate applicationDelegate, UIWindow window) : base(applicationDelegate, window)
 {
 }
예제 #28
0
 public static void SetApplicationHandler(this UIApplicationDelegate nativeApplication, IApplication application, IMauiContext context) =>
 SetHandler(nativeApplication, application, context);
예제 #29
0
 // If < iOS 13 or the Info.plist does not have a scene manifest entry we need to assume no multi window, and no UISceneDelegate.
 // We cannot check for iPads/Mac because even on the iPhone it uses the scene delegate if one is specified in the manifest.
 public static bool HasSceneManifest(this UIApplicationDelegate nativeApplication) =>
 UIDevice.CurrentDevice.CheckSystemVersion(13, 0) &&
 NSBundle.MainBundle.InfoDictionary.ContainsKey(new NSString(UIApplicationSceneManifestKey));
예제 #30
0
 public ConferenceTabletPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 {
 }
예제 #31
0
 internal CustomPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 { }
예제 #32
0
		public virtual object GetView (UIApplicationDelegate value)
		{
			//
			// Is there a window? If so, show that
			//
			if (value.Window != null)
			{
				return GetView (value.Window);
			}

			//
			// What if we fake run the life cycle?
			//
			var launchOptions = new Foundation.NSDictionary ();
			try
			{
				value.WillFinishLaunching (UIApplication.SharedApplication, launchOptions);
			}
			catch (Exception)
			{
			}
			try
			{
				value.FinishedLaunching (UIApplication.SharedApplication, launchOptions);
			}
			catch (Exception)
			{
			}
			if (value.Window != null)
			{
				return GetView (value.Window);
			}

			//
			// Just show the object inspector
			//
			return null;
		}
 public JaSidePanelsMvxPresenter(UIApplicationDelegate applicationDelegate, UIWindow window) :
     base(applicationDelegate, window)
 {
     _jaSidePanelController = new JASidePanelController();
     _activePanel = PanelEnum.Center;
 }
        public new static void Initialize(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
        {
			Initialize(new MXViewModelTouchContainer(theApp, appDelegate, window));
        }
 public ConditionalTouchPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 {
 }
예제 #36
0
		public static void Initialize(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
		{
			// initialize the application and hold a reference for a bit
			MXTouchContainer thisContainer = new MXTouchContainer(theApp, appDelegate, window);
            Initialize(thisContainer);
		}
예제 #37
0
 public Presenter(UIApplicationDelegate appDelegate, UIWindow window) : base()
 {
     Window              = window;
     AppDelegate         = appDelegate;
     _fragmentTypeLookup = new ControllerTypeLookup();
 }
예제 #38
0
        private static ExecuteResponse ExecuteAssembly(byte[] loadedAssemblyBytes, UIApplicationDelegate appDelegate, UIWindow window)
        {
            MethodInfo printMethod;

            object loadedInstance;
            try
            {
                // TODO: create new AppDomain for each loaded assembly, to prevent memory leakage
                var loadedAssembly = AppDomain.CurrentDomain.Load(loadedAssemblyBytes);
                var loadedType = loadedAssembly.GetType("__MTDynamicCode");
                if (loadedType == null) return null;
                loadedInstance = Activator.CreateInstance(loadedType);
                printMethod = loadedInstance.GetType().GetMethod("Main");
            }
            catch (Exception e)
            {
                return new ExecuteResponse { ErrorMessage = e.Message };
            }

            var response = new ExecuteResponse();
            try
            {
                printMethod.Invoke(loadedInstance, new object[] { appDelegate, window });
                var dumpsRaw = loadedInstance.GetType().GetField("___dumps").GetValue(loadedInstance) as IEnumerable;
                response.SetDumpValues(dumpsRaw.Cast<object>().Select(GetDumpObjectFromObject).ToList());
                response.SetMaxEnumerableItemCount(Convert.ToInt32(loadedInstance.GetType().GetField("___maxEnumerableItemCount").GetValue(loadedInstance)));
            }
            catch (Exception e)
            {
                var lineNumber = loadedInstance.GetType().GetField("___lastExecutedStatementOffset").GetValue(loadedInstance);
                response.ErrorMessage = String.Format("___EXCEPTION_____At offset: {0}__{1}", lineNumber, e.InnerException.Message);
            }

            return response;
        }
예제 #39
0
		public CustomPresenter(UIApplicationDelegate applicationDelegate, UIWindow window) : 
			base(applicationDelegate, window)
		{
			_window = window;
		}
 public OnlyTwoDeepPresenter(UIApplicationDelegate applicationDelegate, UIWindow window) 
     : base(applicationDelegate, window)
 {
 }
예제 #41
0
 protected BaseMXTouchContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
     : base(theApp)
 {
     this.appDelegate = appDelegate;
     this.window = window;
 }
 private MXViewModelTouchContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
     : base(theApp, appDelegate, window)
 {
     _viewModelLifeCycleHelper = new MXViewModelLifeCycleHelper(() => new MXUIMainThreadDispatcher());
 }
        public TwitterPhoneSearchPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
			: base(applicationDelegate, window)
		{
		}
 public CustomerManagementPresenter(UIApplicationDelegate applicationDelegate, UIWindow window) 
     : base(applicationDelegate, window)
 {
 }
 public MvxModalNavSupportTouchViewPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 {
 }
예제 #46
0
 public MvxTouchViewPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
 {
     _applicationDelegate = applicationDelegate;
     _window = window;
 }
 public MvxModalNavSupportTouchViewPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 {
 }
예제 #48
0
 /// <summary>
 /// Starts listening for ProtoPad clients, and allows them to connect and access the UIApplicationDelegate and UIWindow you pass in
 /// WARNING: do not dispose until you are done listening for ProtoPad client events. Usually you will want to dispose only upon exiting the app.
 /// </summary>
 /// <param name="appDelegate">Supply your main application delegate here. This will be made scriptable from the ProtoPad Client.</param>
 /// <param name="window">Supply your main application window here. This will be made scriptable from the ProtoPad Client.</param>
 public static ProtoPadServer Create(UIApplicationDelegate appDelegate, UIWindow window, int? overrideListeningPort = null, string overrideBroadcastedAppName = null)
 {
     return new ProtoPadServer(appDelegate, window, overrideListeningPort, overrideBroadcastedAppName);
 }
예제 #49
0
 /// <summary>
 /// Initializes a new instance of the iOSApplicationHost class.
 /// </summary>
 /// <param name="appDelegate">The application delegate hosting the iOS app.</param>
 /// <param name="createApplicationInstance">A factory method for creating application instances.</param>
 public iOSApplicationHost(
     UIApplicationDelegate appDelegate,
     Func <ApplicationHost, Session, ApplicationInstance> createApplicationInstance)
     : this(appDelegate, null, createApplicationInstance)
 {
 }
 public ConferenceTabletPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 {
 }
예제 #51
0
 /// <summary>
 /// Initializes a new instance of the iOSApplicationHost class.
 /// </summary>
 /// <param name="appDelegate">The application delegate hosting the iOS app.</param>
 /// <param name="applicationInstanceFactory">An object used to create application instances.</param>
 public iOSApplicationHost(
     UIApplicationDelegate appDelegate,
     IApplicationInstanceFactory applicationInstanceFactory)
     : this(appDelegate, null, applicationInstanceFactory)
 {
 }
 public CustomerManagementPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 {
 }
 public MvxTouchViewPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
 {
     _applicationDelegate = applicationDelegate;
     _window = window;
 }
 public MvxTabsViewPresenter(UIApplicationDelegate appDelegate, UIWindow window)
     : base()
 {
     Window = window;
     AppDelegate = appDelegate;
 }
예제 #55
0
 public void SetIOS(UIApplicationDelegate del, UIApplication app)
 {
     this.del = del;
     this.app = app;
 }
예제 #56
0
 protected BaseMXTouchContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window) : base(theApp)
 {
     this.appDelegate = appDelegate;
     this.window      = window;
 }
예제 #57
0
 public CustomPresenter(UIApplicationDelegate appDelegate, UIWindow window)
     : base(appDelegate, window)
 {
 }
 protected MXTouchSlideoutContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
     : base(theApp, appDelegate, window)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MvxSidePanelsPresenter"/> class.
 /// </summary>
 /// <param name="applicationDelegate">The application delegate.</param>
 /// <param name="window">The window.</param>
 public MvxSidePanelsPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 {
     _multiPanelController = new MvxMultiPanelController();
     _activePanel = MvxPanelEnum.Center;
 }
예제 #60
0
		public MyPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
			: base(applicationDelegate, window)
		{
		}