Exemple #1
0
    public void InitTray()
    {
        var tray = Rainity.CreateSystemTrayIcon();

        if (tray != null)
        {
            tray.AddItem("Exit", Quit);
            tray.SetTitle("35Miko");
        }
    }
 // 创建托盘图标、添加选项
 void AddSystemTray()
 {
     _icon = Rainity.CreateSystemTrayIcon();
     _icon.AddItem("切换置顶显示", ToggleTopMost);
     _icon.AddItem("切换开机自启", ToggleRunOnStartup);
     _icon.AddSeparator();
     // _icon.AddItem("检查更新", CheckUpdate);// 必然闪退
     _icon.AddItem("清除设置并退出", Clean);
     _icon.AddSeparator();
     _icon.AddItem("退出", Exit);
 }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
        //Set file icon texture demonstration
        if (File.Exists(Environment.SystemDirectory + "\\notepad.exe"))
        {
            iconRenderer.material.mainTexture = Rainity.GetFileIcon(Environment.SystemDirectory + "\\notepad.exe");
        }
        //Set wallpaper image texture demonstration
        wallpaperRenderer.material.mainTexture = Rainity.GetWallpaperImage();
        //Set user avatar texture demonstration
        avatarRenderer.material.mainTexture = Rainity.GetUserAvatar();

        //Create system tray icon (standalone only, editor causes random crashes)
        tray = Rainity.CreateSystemTrayIcon();
        if (tray != null)
        {
            tray.AddItem("Context menu items with attached functions!", ExitApplication);
            tray.AddSeparator();
            tray.AddItem("Exit", ExitApplication);

            tray.SetTitle("Rainity Demo Application");
        }

        //Get information about the weather and assign text
        WeatherObject weather = Rainity.GetWeatherInformation();

        weather_cityState.text   = weather.query.results.channel.location.city + ", " + weather.query.results.channel.location.region;
        weather_temperature.text = weather.query.results.channel.item.condition.temp + "°" + weather.query.results.channel.units.temperature;
        weather_condition.text   = weather.query.results.channel.item.condition.text;
        weather_windSpeed.text   = "Wind speed: " + weather.query.results.channel.wind.speed + weather.query.results.channel.units.speed;

        RainityFile[] files = Rainity.GetFiles("C:\\Users\\Christian\\Desktop");
        foreach (RainityFile file in files)
        {
            Debug.Log(file.fileName);
        }
    }