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


C# AppKit.NSApplication类代码示例

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


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

示例1: ApplicationShouldTerminate

        public override NSApplicationTerminateReply ApplicationShouldTerminate(NSApplication sender)
        {
            _statusPanelController.Dispose();
            _statusPanelController = null;

            return NSApplicationTerminateReply.Now;
        }
开发者ID:GordonXin,项目名称:MacMenuBarPanel,代码行数:7,代码来源:AppDelegate.cs

示例2: OpenFile

		public override bool OpenFile(NSApplication sender, string filename)
		{
			logger.Info("App.OpenFile: {0}", filename);
			try
			{
				var model = SlideshowModel.ParseFile(filename);
				if (model != null)
				{
					var controller = new SlideshowWindowController();
					controller.Model = model;
					controller.Window.MakeKeyAndOrderFront(this);
					startedSlideshow = true;
					return true;
				}
				else
				{
					logger.Info("Failed loading '{0}'", filename);
				}
			}
			catch (Exception e)
			{
				logger.Info("Error opening file: {0}", e);
			}

			return true;
		}
开发者ID:kevintavog,项目名称:WatchThis.net,代码行数:26,代码来源:AppDelegate.cs

示例3: ApplicationShouldHandleReopen

        public override bool ApplicationShouldHandleReopen (NSApplication sender, bool has_visible_windows)
        {
            if (!has_visible_windows)
                Program.Controller.HandleReopen ();

            return true;
        }
开发者ID:WisdomWolf,项目名称:SparkleShare,代码行数:7,代码来源:SparkleUI.cs

示例4: ApplicationShouldHandleReopen

 // show the main window when the application button is clicked
 public override bool ApplicationShouldHandleReopen(NSApplication sender, bool hasVisibleWindows)
 {
     if (!hasVisibleWindows)
     {
         if (Application.Instance.MainForm != null) Application.Instance.MainForm.Show();
     }
     return true;
 }
开发者ID:nagyist,项目名称:Notedown,代码行数:9,代码来源:AppDelegate.cs

示例5: ApplicationShouldTerminate

		public override NSApplicationTerminateReply ApplicationShouldTerminate (NSApplication sender)
		{
			Debug.WriteLine("[Dark Havoc] Exiting game...");
			JoshoEngine.DestroyEngine(Program.gameInstance);
			Debug.WriteLine("[Dark Havoc] Qutting.. Bye! :)");

			return NSApplicationTerminateReply.Now;
		}
开发者ID:JoshuaKennedy,项目名称:DarkHavoc,代码行数:8,代码来源:Program.cs

示例6: ApplicationShouldTerminate

        public NSApplicationTerminateReply ApplicationShouldTerminate(NSApplication sender)
        {
            RxApp.MainThreadScheduler.Schedule(() =>
                shouldPersistState.OnNext(Disposable.Create(() =>
                    sender.ReplyToApplicationShouldTerminate(true))));

            return NSApplicationTerminateReply.Later;
        }
开发者ID:bbqchickenrobot,项目名称:RxUI-UWP-Sample,代码行数:8,代码来源:AppKitAutoSuspendHelper.cs

示例7: ApplicationShouldTerminate

		public override NSApplicationTerminateReply ApplicationShouldTerminate(NSApplication sender)
		{
			var args = new CancelEventArgs();
			var form = Application.Instance.MainForm == null ? null : Application.Instance.MainForm.Handler as IMacWindow;
			if (form != null)
				args.Cancel = !form.CloseWindow(Application.Instance.OnTerminating);
			else
				Application.Instance.OnTerminating(args);
			return args.Cancel ? NSApplicationTerminateReply.Cancel : NSApplicationTerminateReply.Now;
		}
开发者ID:alexandrebaker,项目名称:Eto,代码行数:10,代码来源:AppDelegate.cs

示例8: ApplicationShouldHandleReopen

 // do any OS X - specific file/application open/launch handling here
 public override bool ApplicationShouldHandleReopen(NSApplication sender, bool hasVisibleWindows)
 {
     // show main window when the application button is clicked
     if (!hasVisibleWindows) {
         var form = Application.Instance.MainForm;
         if (form != null)
             form.Show ();
     }
     return true;
 }
开发者ID:M1C,项目名称:Eto,代码行数:11,代码来源:AppDelegate.cs

示例9: OpenFile

        public override bool OpenFile(NSApplication sender, string filename)
        {
            if (mainWindowController == null)
            {
                mainWindowController = new MainWindowController();
                mainWindowController.Window.MakeKeyAndOrderFront(this);
            }

            return mainWindowController.OpenFolderDirectly(filename);
        }
开发者ID:kevintavog,项目名称:MapThis,代码行数:10,代码来源:AppDelegate.cs

示例10: ApplicationShouldTerminate

        public override NSApplicationTerminateReply ApplicationShouldTerminate(NSApplication sender)
        {
            // Clean up all of the panels, and disposable resources
            if (_statusItem != null)
            {
                _statusItem.Dispose();
                _statusItem = null;
            }

            return NSApplicationTerminateReply.Now;
        }
开发者ID:jbutz,项目名称:GitHubNotifications,代码行数:11,代码来源:AppDelegate.cs

示例11: Init

        public override void Init(string[] args)
        {
            NSApplication.Init();
            m_app = NSApplication.SharedApplication;
            m_app.ActivateIgnoringOtherApps(true);

            m_statusItem = NSStatusBar.SystemStatusBar.CreateStatusItem(32);
            m_statusItem.HighlightMode = true;

            base.Init(args);
        }
开发者ID:Berimor66,项目名称:duplicati,代码行数:11,代码来源:CocoaRunner.cs

示例12: OpenFile

		public override bool OpenFile(NSApplication sender, string filename)
		{
            Environment.SetEnvironmentVariable("MONO_MANAGED_WATCHER", "enabled");
            if (controller == null)
            {
                this.filename = filename;
    			logger.Info("OpenFile '{0}'", filename);
                return true;
            }

            return controller.OpenFolderOrFile(filename);
		}
开发者ID:kevintavog,项目名称:Radish.net,代码行数:12,代码来源:AppDelegate.cs

示例13: ApplicationShouldTerminate

        public override NSApplicationTerminateReply ApplicationShouldTerminate(NSApplication sender)
        {
            var args = new CancelEventArgs();
            var form = Application.Instance.MainForm != null ? Application.Instance.MainForm.Handler as IMacWindow : null;
            if (form != null) {
                if (!form.CloseWindow ())
                    return NSApplicationTerminateReply.Cancel;
            }

            Application.Instance.OnTerminating (args);
            if (args.Cancel) return NSApplicationTerminateReply.Cancel;
            else return NSApplicationTerminateReply.Now;
        }
开发者ID:M1C,项目名称:Eto,代码行数:13,代码来源:AppDelegate.cs

示例14: ApplicationShouldTerminate

		public override NSApplicationTerminateReply ApplicationShouldTerminate(NSApplication sender)
		{
			var args = new CancelEventArgs();
			var app = ((ApplicationHandler)Application.Instance.Handler);
			var form = Application.Instance.MainForm == null ? null : Application.Instance.MainForm.Handler as IMacWindow;
			if (form != null)
				args.Cancel = !form.CloseWindow(ce => app.Callback.OnTerminating(app.Widget, ce));
			else
			{
				app.Callback.OnTerminating(app.Widget, args);
			}
			return args.Cancel ? NSApplicationTerminateReply.Cancel : NSApplicationTerminateReply.Now;
		}
开发者ID:mhusen,项目名称:Eto,代码行数:13,代码来源:AppDelegate.cs

示例15: ApplicationShouldTerminate

 public override NSApplicationTerminateReply ApplicationShouldTerminate(NSApplication sender)
 {
     if (Engine.Instance.Terminated == false)
     {
         if (mainWindowController.ShutdownConfirmed)
             return NSApplicationTerminateReply.Later;
         else if(mainWindowController.Shutdown() == false)
             return NSApplicationTerminateReply.Cancel;
         else
             return NSApplicationTerminateReply.Later;
     } else {
         return NSApplicationTerminateReply.Now;
     }
 }
开发者ID:Clodo76,项目名称:airvpn-client,代码行数:14,代码来源:AppDelegate.cs


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