當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。