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>();
        }
コード例 #4
0
        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>();
		}
コード例 #6
0
        /// <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>();
        }
コード例 #8
0
        /// <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
ファイル: Settings.cs プロジェクト: tmudford/Forms9Patch
 void ISettings.LazyInit()
 {
     if (IsInitialized)
     {
         return;
     }
     AppDelegate = (UIKit.UIApplicationDelegate)UIApplication.SharedApplication.Delegate;
     Init();
 }
コード例 #13
0
ファイル: ProtoPadServer.cs プロジェクト: tluyben/ProtoPad
        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
ファイル: iOSApplicationHost.cs プロジェクト: t9mike/Mitten
 /// <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
ファイル: iOSApplicationHost.cs プロジェクト: t9mike/Mitten
 /// <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
ファイル: MXTouchNavigation.cs プロジェクト: pazof/MonoCross
        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);
        }
コード例 #20
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);
        }
コード例 #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
ファイル: ApplicationExtensions.cs プロジェクト: hevey/maui
        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
ファイル: AppDelegate.cs プロジェクト: yippeeapp/CodeHub
        /// <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
ファイル: ApplicationExtensions.cs プロジェクト: hevey/maui
        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;
		}
コード例 #33
0
 public JaSidePanelsMvxPresenter(UIApplicationDelegate applicationDelegate, UIWindow window) :
     base(applicationDelegate, window)
 {
     _jaSidePanelController = new JASidePanelController();
     _activePanel = PanelEnum.Center;
 }
コード例 #34
0
        public new static void Initialize(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
        {
			Initialize(new MXViewModelTouchContainer(theApp, appDelegate, window));
        }
コード例 #35
0
 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
ファイル: Presenter.cs プロジェクト: akbuffalo1/colorado
 public Presenter(UIApplicationDelegate appDelegate, UIWindow window) : base()
 {
     Window              = window;
     AppDelegate         = appDelegate;
     _fragmentTypeLookup = new ControllerTypeLookup();
 }
コード例 #38
0
ファイル: ProtoPadServer.cs プロジェクト: tluyben/ProtoPad
        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;
		}
コード例 #40
0
 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;
 }
コード例 #42
0
 private MXViewModelTouchContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
     : base(theApp, appDelegate, window)
 {
     _viewModelLifeCycleHelper = new MXViewModelLifeCycleHelper(() => new MXUIMainThreadDispatcher());
 }
コード例 #43
0
        public TwitterPhoneSearchPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
			: base(applicationDelegate, window)
		{
		}
コード例 #44
0
 public CustomerManagementPresenter(UIApplicationDelegate applicationDelegate, UIWindow window) 
     : base(applicationDelegate, window)
 {
 }
コード例 #45
0
 public MvxModalNavSupportTouchViewPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 {
 }
コード例 #46
0
 public MvxTouchViewPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
 {
     _applicationDelegate = applicationDelegate;
     _window = window;
 }
コード例 #47
0
 public MvxModalNavSupportTouchViewPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 {
 }
コード例 #48
0
ファイル: ProtoPadServer.cs プロジェクト: tluyben/ProtoPad
 /// <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
ファイル: iOSApplicationHost.cs プロジェクト: t9mike/Mitten
 /// <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)
 {
 }
コード例 #50
0
 public ConferenceTabletPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 {
 }
コード例 #51
0
ファイル: iOSApplicationHost.cs プロジェクト: t9mike/Mitten
 /// <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)
 {
 }
コード例 #52
0
 public CustomerManagementPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 {
 }
コード例 #53
0
 public MvxTouchViewPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
 {
     _applicationDelegate = applicationDelegate;
     _window = window;
 }
コード例 #54
0
 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)
 {
 }
コード例 #58
0
 protected MXTouchSlideoutContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
     : base(theApp, appDelegate, window)
 {
 }
コード例 #59
0
 /// <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)
		{
		}