久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

僅系統托盤(無??繄D標)應用程序在 Mac 上使用

System Tray only (no dock icon) application using C# / Mono on Mac(僅系統托盤(無??繄D標)應用程序在 Mac 上使用 C#/Mono)
本文介紹了僅系統托盤(無??繄D標)應用程序在 Mac 上使用 C#/Mono的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我希望將我的一個 C# 應用程序轉移到 Mono 以在 Mac 上使用.目前,我正在嘗試弄清楚如何使它成為一種后臺"進程,但仍然能夠擁有 GUI 元素(我相信這排除了 mono-service).p>

最終目標是這樣的:

  1. 為大多數交互設置一個托盤圖標.
  2. 刪除啟動應用程序通常附帶的??繄D標
  3. 讓應用程序在啟動時運行.

簡而言之,想想 Dropbox 應用程序的工作原理.我想要那種類型的 GUI,但要使用 Mono/Mac 應用程序.

我相信這通常是通過在應用程序包的 Info.plist 中設置 LSUIElement = 1 來完成的.但是,我沒有運氣.我認為這可能與從應用程序包中啟動我的應用程序的 mono 命令有關.一旦應用程序啟動 mono 我假設它不會級聯到進一步的應用程序啟動.不過,這純粹是猜測.

有人對此有任何想法嗎?謝謝.

解決方案

我有你的答案:

首先,添加一個狀態欄圖標(Win Forms中通知圖標的替代品):

 NSStatusItem sItem = NSStatusBar.SystemStatusBar.CreateStatusItem(30);sItem.Menu = 通知菜單;sItem.Image = NSImage.FromStream(System.IO.File.OpenRead(NSBundle.MainBundle.ResourcePath + @"/notify-icon.icns"));sItem.HighlightMode = true;

notifyMenu 是您的 NSMenu 實例,作為通知圖標的上下文菜單條.

并將使用 Icon Composer 制作的 ICNS 文件放入您的項目文件中,并將其標記為內容.(右鍵->構建動作->內容)

現在是時候移除??繄D標了:

在您的 info.plist 文件中.創建一個新的 Boolean 類型項目并將其命名為LSUIElement"并將值設置為 YES.

希望有幫助.問候,佩曼·莫爾塔扎維

I'm looking to move one of my C# applications over to Mono for use on the Mac. Currently, I'm trying to figure out how to make it a sort of "background" process, but still have the ability to have GUI elements (I believe this rules out mono-service).

The ultimate goal is this:

  1. Put a tray icon up by the clock for the majority of interactions.
  2. Remove the dock icon that typically comes with a launched application
  3. Have the application run on startup.

In short, just think of how the Dropbox app works. I want that type of GUI, but with a Mono / Mac app.

I believe this is typically accomplished by setting LSUIElement = 1 in the application bundle's Info.plist. However, I've had no luck with it. I think it may have something to do with the mono command launching my application from within the app bundle. Once the app launches mono I'm assuming it doesn't cascade to further application launches. That is a pure guess, though.

Does anyone have any ideas on this? Thanks.

解決方案

I have your answer:

First, to add a Status bar icon (alternative of Notify Icon in Win Forms):

        NSStatusItem sItem = NSStatusBar.SystemStatusBar.CreateStatusItem(30);
        sItem.Menu = notifyMenu;
        sItem.Image = NSImage.FromStream(System.IO.File.OpenRead(NSBundle.MainBundle.ResourcePath + @"/notify-icon.icns"));
        sItem.HighlightMode = true;

notifyMenu is your instance of NSMenu as a means of context menu strip for your notify icon.

and put your ICNS file made using Icon Composer in your project files and flag it as Content. (right click->build action->content)

Now It is time to remove dock icon:

on your info.plist file. make a new Boolean type item and name it "LSUIElement" and set the value to YES.

Hope it helps. Regards, Peyman Mortazavi

這篇關于僅系統托盤(無??繄D標)應用程序在 Mac 上使用 C#/Mono的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Is there a C# library that will perform the Excel NORMINV function?(是否有執行 Excel NORMINV 函數的 C# 庫?)
Select x random elements from a weighted list in C# (without replacement)(從 C# 中的加權列表中選擇 x 個隨機元素(無需替換))
Create a summary description of a schedule given a list of shifts(給定輪班列表,創建時間表的摘要描述)
C# Normal Random Number(C# 普通隨機數)
Standard deviation of generic list?(通用列表的標準偏差?)
AsyncCTP: Creating a class that is IAwaitable(AsyncCTP:創建一個 IAwaitable 的類)
主站蜘蛛池模板: 国产成人99久久亚洲综合精品 | 中文字幕在线播放不卡 | 毛片a| 精品欧美 | 欧美综合国产精品久久丁香 | 国产精品久久久久久av公交车 | 国产精品一区三区 | 亚洲精品99 | 国产视频一区二区三区四区五区 | 亚洲小说图片 | 日韩免费一区 | 毛片免费在线观看 | 欧美激情一区二区三级高清视频 | 99久久婷婷国产综合精品电影 | 国产资源在线观看 | 中国美女撒尿txxxxx视频 | 成人a免费 | 国产精品国产a | 欧美激情视频一区二区三区在线播放 | 精品欧美一区二区三区久久久 | 欧美午夜视频 | 热久久免费视频 | 久久精品亚洲一区 | 国产精品综合视频 | 天天射天天干 | 国产午夜精品一区二区三区在线观看 | av中文字幕网站 | 亚洲国产成人精品女人久久久 | 蜜桃黄网 | 毛片一区二区 | 国产91丝袜在线熟 | 久久国产精品视频 | 日韩成人av在线 | 国产精品日韩一区 | 国产在线播放av | 中文字幕日韩欧美一区二区三区 | 久久精品国产精品青草 | 粉嫩高清一区二区三区 | 国产精品久久久久久久久久免费看 | 亚洲美女网站 | 国产亚韩 |