コード例 #1
0
        public void AddOrUpdate()
        {
            var ext       = "ext";
            var mimeToAdd = "test/ext";

            MimeTypesMap.AddOrUpdate(mimeToAdd, ext);
            var mimeResult = MimeTypesMap.GetMimeType("file.ext");

            Assert.Equal(mimeToAdd, mimeResult);
        }
コード例 #2
0
        // TODO: Add pipe server for program mutex.
        public FormMain()
        {
            if (!DesignMode)
            {
                Logger.Debug("Initializing LibVLC...");
                Vlc.Initialize();
            }

            Logger.Debug("Initializing windows wallpaper...");
            if (!WindowsWallpaper.Init())
            {
                MessageBox.Show(this, "Failed to initalize windows wallpaper! Failed to acquire desktop window pointer!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }

            MimeTypesMap.AddOrUpdate("playlist/json", "dpp");
            MimeTypesMap.AddOrUpdate("shadertoy/dpst", "dpst");
            MimeTypesMap.AddOrUpdate("shadertoy/shadertoy", "shadertoy");

            MediaPlayerStore.Instance.RegisterPlayer <VlcMediaPlayer>("video/x-matroska", "video/mp4", "video/mov", "video/avi", "video/wmv", "video/gif", "video/webm");
            MediaPlayerStore.Instance.RegisterPlayer <PictureBoxPlayer>("image/jpeg", "image/png", "image/jpg", "image/bmp", "image/tiff", "image/svg");
            MediaPlayerStore.Instance.RegisterPlayer <ShaderToyPlayer>("shadertoy/dpst", "shadertoy/shadertoy");

            settingsManager.OnSettingsChanged += (sender, settings) => {
                CloseToTray    = settings.CloseToTray;
                MinimizeToTray = settings.MinimizeToTray;
            };
            settingsManager.Load(true);

            if (Settings.StartMinimized)
            {
                WindowState = FormWindowState.Minimized;
            }

            InitializeComponent();
            showToolStripMenuItem.Click += trayShowForm_Click; // Connect the show button in the tray with the required method.
        }