• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# NSApplication类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中NSApplication的典型用法代码示例。如果您正苦于以下问题:C# NSApplication类的具体用法?C# NSApplication怎么用?C# NSApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NSApplication类属于命名空间,在下文中一共展示了NSApplication类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ApplicationShouldHandleReopen

		public override bool ApplicationShouldHandleReopen(NSApplication sender, bool hasVisibleWindows)
		{
			// This could be invoked before DidFinishLaunching
			if (MainWindow != null) {
				MainWindow.IsVisible = true;
				MainWindow.MakeKeyAndOrderFront (this);
			}
			return false;
		}
开发者ID:alanmcgovern,项目名称:tunez,代码行数:9,代码来源:AppDelegate.cs


示例2: ApplicationShouldHandleReopen

 public override bool ApplicationShouldHandleReopen(NSApplication sender, bool hasVisibleWindows)
 {
     if (!hasVisibleWindows)
     {
         foreach (var window in sender.Windows)
             window.MakeKeyAndOrderFront(this);
     }
     return true;
 }
开发者ID:ailen0ada,项目名称:RxUISimpleTimer,代码行数:9,代码来源:AppDelegate.cs


示例3: ApplicationShouldTerminate

 public override NSApplicationTerminateReply ApplicationShouldTerminate(NSApplication sender)
 {
     if (_mainWindowController.ContinueIfChanged())
     {
         return NSApplicationTerminateReply.Now;
     }
     else
     {
         return NSApplicationTerminateReply.Cancel;
     }
 }
开发者ID:SubtitleEdit,项目名称:subtitleedit-mac,代码行数:11,代码来源:AppDelegate.cs


示例4: ApplicationShouldTerminateAfterLastWindowClosed

 public override bool ApplicationShouldTerminateAfterLastWindowClosed(NSApplication sender)
 {
     return true;
 }
开发者ID:WaveEngine,项目名称:Samples,代码行数:4,代码来源:AppDelegate.cs


示例5: ApplicationShouldOpenUntitledFile

 public override bool ApplicationShouldOpenUntitledFile(NSApplication sender)
 {
     Console.WriteLine("ApplicationShouldOpenUntitledFile called");
     return PreferenceController.PreferenceEmptyDoc;
 }
开发者ID:yingfangdu,项目名称:BNR,代码行数:5,代码来源:AppController.cs


示例6: NSRunloopScheduler

 public NSRunloopScheduler(NSApplication app)
 {
     theApp = app;
 }
开发者ID:charles-cai,项目名称:ReactiveXaml,代码行数:4,代码来源:NSRunloopScheduler.cs


示例7: OpenFile

		/// <summary>
		/// This method is called when the user selects a file from the <c>Open Recent</c>
		/// menu item.
		/// </summary>
		/// <returns><c>true</c>, if file was opened, <c>false</c> otherwise.</returns>
		/// <param name="sender">A pointer to the app.</param>
		/// <param name="filename">The full path and filename of the file to open.</param>
		/// <remarks>For more details, see: https://developer.xamarin.com/guides/mac/user-interface/working-with-menus/#Working_with_the_Open_Recent_Menu</remarks>
		public override bool OpenFile (NSApplication sender, string filename)
		{
			// Trap all errors
			try {
				// Escape any spaces (" ") or they will cause an error
				// when converted to an NSUrl.
				filename = filename.Replace (" ", "%20");
				var url = new NSUrl ("file://"+filename);
				return OpenFile(url);
			} catch {
				return false;
			}
		}
开发者ID:RangoLee,项目名称:mac-samples,代码行数:21,代码来源:AppDelegate.cs


示例8: ApplicationShouldTerminate

		/// <summary>
		/// Called before the app terminates to allow the app to cancel the termination
		/// based on state, such as a file not being saved.
		/// </summary>
		/// <returns>A flag stating if the app can terminate at this time.</returns>
		/// <param name="sender">A pointer to the app.</param>
		/// <remarks>For more details, see: https://developer.xamarin.com/guides/mac/user-interface/working-with-windows/#Modified_Windows_Content</remarks>
		public override NSApplicationTerminateReply ApplicationShouldTerminate (NSApplication sender)
		{
			// See if any window needs to be saved first
			foreach (NSWindow window in NSApplication.SharedApplication.Windows) {
				if (window.Delegate != null && !window.Delegate.WindowShouldClose (this)) {
					// Did the window terminate the close?
					return NSApplicationTerminateReply.Cancel;
				}
			}

			// Allow normal termination
			return NSApplicationTerminateReply.Now;
		}
开发者ID:RangoLee,项目名称:mac-samples,代码行数:20,代码来源:AppDelegate.cs


示例9: ApplicationShouldHandleReopen

		public override bool ApplicationShouldHandleReopen(NSApplication sender, bool hasVisibleWindows)
		{
			if (hasVisibleWindows == false)
				m_window.MakeKeyAndOrderFront (null);
			return true;
		}
开发者ID:bluebirdtech,项目名称:Bluebird.WkBrowser,代码行数:6,代码来源:AppDelegate.cs


示例10: ApplicationShouldOpenUntitledFile

		public override bool ApplicationShouldOpenUntitledFile (NSApplication sender)
		{
			return false;
		}
开发者ID:RangoLee,项目名称:mac-samples,代码行数:4,代码来源:AppDelegate.cs



注:本文中的NSApplication类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NSAutoreleasePool类代码示例发布时间:2022-05-24
下一篇:
C# NSAction类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap