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

僅系統托盤(無停靠圖標)應用程序在 Mac 上使用

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

問題描述

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

最終目標是這樣的:

  1. 為大多數交互設置一個托盤圖標.
  2. 刪除啟動應用程序通常附帶的停靠圖標
  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 文件放入您的項目文件中,并將其標記為內容.(右鍵->構建動作->內容)

現在是時候移除停靠圖標了:

在您的 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

這篇關于僅系統托盤(無停靠圖標)應用程序在 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久久久精品免费观看 | 欧美高清视频在线观看 | 国内精品视频在线观看 | 国产三级 | 天天天天操 | 91高清在线观看 | 夜夜爽99久久国产综合精品女不卡 | 日韩精品免费视频 | 高清视频一区二区三区 | 国产精品一区二区在线 | 中文字幕综合在线 | 久久99精品视频 | 欧美精品一区免费 | 久久最新 | 欧美黄视频 | 中文字幕亚洲欧美日韩在线不卡 | 亚洲精品免费视频 | 欧美一级黄色片免费观看 | 亚洲一区在线日韩在线深爱 | 国产乱码精品一品二品 | 韩国av网站在线观看 | 日本精品裸体写真集在线观看 | 久久99精品久久久久久国产越南 | 午夜黄色 | 动漫www.被爆羞羞av44 | 在线观看免费av网 | av一区二区三区 | 国产精品久久久久久久久久久久冷 | 中文字幕高清av | 日韩欧美在线视频观看 | 精品一区国产 | 国产日韩精品一区 | 九九伦理片 | 成人做爰69片免费观看 | 亚洲女人的天堂 | 久久久久久久一区 | 国产精品一区二区在线 | 欧美另类视频 | 欧美一级免费看 | 美女久久久久久久 | 红桃成人在线 |