本文整理汇总了C#中UIApplication类的典型用法代码示例。如果您正苦于以下问题:C# UIApplication类的具体用法?C# UIApplication怎么用?C# UIApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIApplication类属于命名空间,在下文中一共展示了UIApplication类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DidEnterBackground
public override void DidEnterBackground(UIApplication application)
{
ourTask = application.BeginBackgroundTask(delegate
{ //this is the action that will run when the task expires
if (ourTask != 0) //this check is because we want to avoid ending the same task twice
{
application.EndBackgroundTask(ourTask); //end the task
ourTask = 0; //reset the id
}
});
//we start an asynchronous operation
//so that we make sure that DidEnterBackground
//executes normally
new System.Action(delegate
{
MonoGameGame.EnterBackground();
//Since we are in an asynchronous method,
//we have to make sure that EndBackgroundTask
//will run on the application's main thread
//or we might have unexpected behavior.
application.BeginInvokeOnMainThread(delegate
{
if (ourTask != 0) //same as above
{
application.EndBackgroundTask(ourTask);
ourTask = 0;
}
});
}).BeginInvoke(null, null);
}
开发者ID:Grapes,项目名称:MonoGame,代码行数:32,代码来源:Program.cs
示例2: FinishedLaunching
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
// Override point for customization after application launch.
// If not required for your application you can safely delete this method
return true;
}
开发者ID:drgizmo666,项目名称:IosDemo,代码行数:7,代码来源:AppDelegate.cs
示例3: OnResignActivation
public override void OnResignActivation(UIApplication application)
{
// Invoked when the application is about to move from active to inactive state.
// This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message)
// or when the user quits the application and it begins the transition to the background state.
// Games should use this method to pause the game.
}
开发者ID:silam,项目名称:NewXamarin,代码行数:7,代码来源:AppDelegate.cs
示例4: FinishedLaunching
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
//UserDialogs.Init();
global::Xamarin.Forms.Forms.Init();
Insights.Initialize("0d729b1f8027a9219421908d521e3af664ae52fc");
PushNotificationManager pushmanager = PushNotificationManager.PushManager;
pushmanager.Delegate = this;
if (options != null)
{
if (options.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey))
{
pushmanager.HandlePushReceived(options);
}
}
pushmanager.RegisterForPushNotifications();
try
{
var token = PushNotificationManager.PushManager.GetPushToken;
if (!String.IsNullOrEmpty(token))
App.PushWooshToken = token;
}
catch (Exception ex)
{
Insights.Report(ex);
}
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
开发者ID:jbravobr,项目名称:Mais-XamForms,代码行数:34,代码来源:AppDelegate.cs
示例5: FinishedLaunching
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
window = new UIWindow(UIScreen.MainScreen.Bounds);
var controller = new UIViewController();
var view = new UIView (UIScreen.MainScreen.Bounds);
view.BackgroundColor = UIColor.White;
controller.View = view;
controller.NavigationItem.Title = "SignalR Client";
var textView = new UITextView(new CGRect(0, 0, 320, view.Frame.Height - 0));
view.AddSubview (textView);
navController = new UINavigationController (controller);
window.RootViewController = navController;
window.MakeKeyAndVisible();
if (SIGNALR_DEMO_SERVER == "http://YOUR-SERVER-INSTANCE-HERE") {
textView.Text = "You need to configure the app to point to your own SignalR Demo service. Please see the Getting Started Guide for more information!";
return true;
}
var traceWriter = new TextViewWriter(SynchronizationContext.Current, textView);
var client = new CommonClient(traceWriter);
client.RunAsync(SIGNALR_DEMO_SERVER);
return true;
}
开发者ID:Coladela,项目名称:signalr-chat,代码行数:32,代码来源:AppDelegate.cs
示例6: WillTerminate
public override void WillTerminate(UIApplication application)
{
var geo = this.GetService<WshLst.Core.Interfaces.IGeolocator>();
geo.StopTracking();
base.WillTerminate(application);
}
开发者ID:slodge,项目名称:WshLst,代码行数:7,代码来源:AppDelegate.cs
示例7: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
Current = this;
var log = new LoggerConfiguration().CreateLogger();
log.Information("Loading");
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
// create a new window instance based on the screen size
window = new UIWindow(UIScreen.MainScreen.Bounds);
// If you have defined a view, add it here:
// window.RootViewController = navigationController;
var rootNavigationController = Utilities.BuildNavigationController();
rootNavigationController.PushViewController(new ViewControllers.Login(), false);
window.RootViewController = rootNavigationController;
// make the window visible
window.MakeKeyAndVisible();
Utilities.SetTintColor();
autoSuspendHelper.FinishedLaunching(app, options);
return true;
}
开发者ID:ehill8624,项目名称:ValkreRender,代码行数:36,代码来源:AppDelegate.cs
示例8: FinishedLaunching
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// create a new window instance based on the screen size
window = new UIWindow (UIScreen.MainScreen.Bounds);
// make the window visible
window.MakeKeyAndVisible ();
// create our nav controller
navController = new UINavigationController ();
// create our home controller based on the device
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
homeViewController = new Tasky.Screens.iPhone.Home.controller_iPhone();
} else {
// homeViewController = new Hello_UniversalViewController ("Hello_UniversalViewController_iPad", null);
}
// Styling
UINavigationBar.Appearance.TintColor = UIColor.FromRGB (38, 117 ,255); // nice blue
UITextAttributes ta = new UITextAttributes();
ta.Font = UIFont.FromName ("AmericanTypewriter-Bold", 0f);
UINavigationBar.Appearance.SetTitleTextAttributes(ta);
ta.Font = UIFont.FromName ("AmericanTypewriter", 0f);
UIBarButtonItem.Appearance.SetTitleTextAttributes(ta, UIControlState.Normal);
// push the view controller onto the nav controller and show the window
navController.PushViewController(homeViewController, false);
window.RootViewController = navController;
window.MakeKeyAndVisible ();
return true;
}
开发者ID:BeardAnnihilator,项目名称:xamarin-samples,代码行数:34,代码来源:AppDelegate.cs
示例9: DetectWebViewLoadFinishedEvent
public override void DetectWebViewLoadFinishedEvent(UIApplication application, NSDictionary launchOptions)
{
UIApplicationState applicationState = application.ApplicationState;
((UnityUI_iOSViewController_UIWebView) MainViewController ()).webView.LoadFinished += delegate {
#if DEBUG
log ("************** WEBVIEW LOAD FINISHED");
#endif
if (UIDevice.CurrentDevice.CheckSystemVersion (8, 0)) {
UIView.AnimationsEnabled = true; //enable again animation in all view (see UnityUI_iOSViewController_UIWebView#loadWebView for details)
}
// inform other weak delegates (if exist) about the web view finished event
IPhoneServiceLocator.WebViewLoadingFinished(applicationState, launchOptions);
// The NSDictionary options variable would contain any notification data if the user clicked the 'view' button on the notification
// to launch the application.
// This method processes these options from the FinishedLaunching.
processLaunchOptions (launchOptions, true, applicationState);
// Processing extra data received when launched externally (using custom scheme url)
processLaunchData ();
};
}
开发者ID:lsp1357,项目名称:appverse-mobile,代码行数:25,代码来源:AppDelegate_UIWebView.cs
示例10: FinishedLaunching
public override bool FinishedLaunching(UIApplication app, NSDictionary options) {
UserDialogs.Init();
Forms.Init();
this.LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
开发者ID:RTodorov,项目名称:userdialogs,代码行数:7,代码来源:AppDelegate.cs
示例11: GraphCodeWindowRegistrar
public GraphCodeWindowRegistrar(Lifetime lifetime, ToolWindowManager toolWindowManager,
GraphCodeToolWindow descriptor, UIApplication environment)
{
_environment = environment;
_lifetime = lifetime;
_toolWindowClass = toolWindowManager.Classes[descriptor];
//_toolWindowClass.RegisterEmptyContent(
// lifetime,
// lt =>
// {
// var graphs = (new GraphLoader()).Load();
// var tabControl = new System.Windows.Controls.TabControl();
// var zcontrols = new List<ZoomControl>();
// foreach (var graph in graphs)
// {
// var gArea = InitializeGraphArea.Initialize(graph);
// var zcontrol = new ZoomControl();
// zcontrol.Content = gArea;
// zcontrols.Add(zcontrol);
// }
// tabControl.ItemsSource = zcontrols;
// return (new EitherControl(tabControl)).BindToLifetime(lt);
// });
}
开发者ID:mtashkinov,项目名称:YaccConstructor,代码行数:25,代码来源:GraphCodeToolWindow.cs
示例12: OnActivated
public override void OnActivated(UIApplication application)
{
// FBSample logic
// We need to properly handle activation of the application with regards to SSO
// (e.g., returning from iOS 6.0 authorization dialog or from fast app switching).
FBSession.ActiveSession.HandleDidBecomeActive();
}
开发者ID:jonathanpeppers,项目名称:monotouch-bindings,代码行数:7,代码来源:AppDelegate.cs
示例13: FinishedLaunching
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
runner = new TouchRunner (window);
// tests can be inside the main assembly
runner.Add (Assembly.GetExecutingAssembly ());
#if false
// you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-)
runner.Writer = new TcpTextWriter ("10.0.1.2", 16384);
// start running the test suites as soon as the application is loaded
runner.AutoStart = true;
// crash the application (to ensure it's ended) and return to springboard
runner.TerminateAfterExecution = true;
#endif
#if false
// you can get NUnit[2-3]-style XML reports to the console or server like this
// replace `null` (default to Console.Out) to a TcpTextWriter to send data to a socket server
// replace `NUnit2XmlOutputWriter` with `NUnit3XmlOutputWriter` for NUnit3 format
runner.Writer = new NUnitOutputTextWriter (runner, null, new NUnitLite.Runner.NUnit2XmlOutputWriter ());
// the same AutoStart and TerminateAfterExecution can be used for build automation
#endif
window.RootViewController = new UINavigationController (runner.GetViewController ());
window.MakeKeyAndVisible ();
return true;
}
开发者ID:couchbasedeps,项目名称:Touch.Unit,代码行数:26,代码来源:AppDelegate.cs
示例14: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
// create a new window instance based on the screen size
window = new UIWindow (UIScreen.MainScreen.Bounds);
InvokeOnMainThread(delegate {
TwitterAccount.getAccount();
});
flyoutController = new FlyOutNavigationController();
tl = new Timeline(flyoutController);
flyoutController.NavigationRoot = new RootElement("")
{
new Section("Navigation")
{
new StringElement("Timeline")
}
};
flyoutController.ViewControllers = new UIViewController[]
{
new UINavigationController(tl)
};
window.AddSubview(flyoutController.View);
// make the window visible
window.MakeKeyAndVisible ();
return true;
}
开发者ID:timrisi,项目名称:Hashed,代码行数:38,代码来源:AppDelegate.cs
示例15: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// create a new window instance based on the screen size
window = new UIWindow (UIScreen.MainScreen.Bounds);
// load the appropriate UI, depending on whether the app is running on an iPhone or iPad
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
var controller = new RootViewController ();
navigationController = new UINavigationController (controller);
window.RootViewController = navigationController;
} else {
var masterViewController = new RootViewController ();
var masterNavigationController = new UINavigationController (masterViewController);
var detailViewController = new DetailViewController ();
var detailNavigationController = new UINavigationController (detailViewController);
splitViewController = new UISplitViewController ();
splitViewController.WeakDelegate = detailViewController;
splitViewController.ViewControllers = new UIViewController[] {
masterNavigationController,
detailNavigationController
};
window.RootViewController = splitViewController;
}
// make the window visible
window.MakeKeyAndVisible ();
return true;
}
开发者ID:XamarinControls,项目名称:govindaraokondala-horizontal-scrolling-in-Table-in-IOS,代码行数:38,代码来源:AppDelegate.cs
示例16: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackTranslucent;
viewController = new FlyOutNavigationController ();
viewController.NavigationRoot = new RootElement ("")
{
new Section ("Section 1"){
new StringElement ("View 1"),
new ImageStringElement("View 2",UIImage.FromFile("jhill.jpeg")),
new StringElement ("View 3"),
},
new Section ("Section 2"){
new StringElement ("View 1"),
new StringElement ("View 2"),
}
};
viewController.ViewControllers = new UIViewController[]{
new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 1"){new Section (){new StringElement ("View 1")}}))
,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 1"){new Section (){new StringElement ("View 2")}}))
,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 1"){new Section (){new StringElement ("View 3")}}))
,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 2"){new Section (){new StringElement ("View 1")}}))
,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 2"){new Section (){new StringElement ("View 2")}}))
};
window.RootViewController = viewController;
window.MakeKeyAndVisible ();
return true;
}
开发者ID:TheGiant,项目名称:FlyOutNavigation,代码行数:36,代码来源:AppDelegate.cs
示例17: FinishedLaunching
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
Forms.Init ();
// http://forums.xamarin.com/discussion/21148/calabash-and-xamarin-forms-what-am-i-missing
Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) => {
// http://developer.xamarin.com/recipes/testcloud/set-accessibilityidentifier-ios/
if (null != e.View.StyleId) {
e.NativeView.AccessibilityIdentifier = e.View.StyleId;
Console.WriteLine("Set AccessibilityIdentifier: " + e.View.StyleId);
}
};
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.RootViewController = App.GetMainPage ().CreateViewController ();
window.MakeKeyAndVisible ();
#if DEBUG
// requires Xamarin Test Cloud Agent component
Xamarin.Calabash.Start();
#endif
return true;
}
开发者ID:ZaK14120,项目名称:xamarin-forms-samples,代码行数:30,代码来源:AppDelegate.cs
示例18: FinishedLaunching
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// check is it 64bit or 32bit
Console.WriteLine (IntPtr.Size);
// Main app do nothing
// Go to Photo > Edit then choose PhotoFilter to start app extension
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.BackgroundColor = UIColor.White;
note = new UILabel ();
note.Text = "Note that the app in this sample only serves as a host for the extension. To use the sample extension, edit a photo or video using the Photos app, and tap the extension icon";
note.Lines = 0;
note.LineBreakMode = UILineBreakMode.WordWrap;
var frame = note.Frame;
note.Frame = new CGRect (0, 0, UIScreen.MainScreen.Bounds.Width * 0.75f, 0);
note.SizeToFit ();
window.AddSubview (note);
note.Center = window.Center;
window.MakeKeyAndVisible ();
return true;
}
开发者ID:g7steve,项目名称:monotouch-samples,代码行数:25,代码来源:AppDelegate.cs
示例19: FinishedLaunching
public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
{
SensusServiceHelper.Initialize(() => new iOSSensusServiceHelper());
// facebook settings
Settings.AppID = "873948892650954";
Settings.DisplayName = "Sensus";
Forms.Init();
FormsMaps.Init();
MapExtendRenderer.Init();
// toasts for iOS
DependencyService.Register<ToastNotificatorImplementation>();
ToastNotificatorImplementation.Init();
LoadApplication(new App());
uiApplication.RegisterUserNotificationSettings(UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Badge | UIUserNotificationType.Sound | UIUserNotificationType.Alert, new NSSet()));
#if UNIT_TESTING
Forms.ViewInitialized += (sender, e) =>
{
if (!string.IsNullOrWhiteSpace(e.View.StyleId))
e.NativeView.AccessibilityIdentifier = e.View.StyleId;
};
Calabash.Start();
#endif
return base.FinishedLaunching(uiApplication, launchOptions);
}
开发者ID:haunthy,项目名称:sensus,代码行数:32,代码来源:AppDelegate.cs
示例20: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
//
// ENTER YOUR LICENSE INFO HERE
//
PXEngine.LicenseKeyForUser("SERIAL NUMBER", "USER NAME");
// create a new window instance based on the screen size
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.RootViewController = new MyViewController();
// make the window visible
window.MakeKeyAndVisible ();
PXEngine shared = PXEngine.SharedInstance();
// Print the version an build date
Console.WriteLine("Pixate Engine v{0} {1}", shared.Version, shared.BuildDate);
// Print the location of the current application-level stylesheet
Console.WriteLine("CSS File location: {0}", PXStylesheet.CurrentApplicationStylesheet().FilePath);
// Monitor for changes in the stylesheet and update styles live
PXStylesheet.CurrentApplicationStylesheet().MonitorChanges = true;
return true;
}
开发者ID:stefandevo,项目名称:MonoTouch-Pixate,代码行数:35,代码来源:AppDelegate.cs
注:本文中的UIApplication类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论