当前位置: 首页>>代码示例>>C#>>正文


C# NSApplication类代码示例

本文整理汇总了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;未经允许,请勿转载。