Example #1
0
        private void cmd_play_Click(object sender, EventArgs e)
        {
            var currentSelection = selectedItem.Replace("pb_", "");
            var entry            = DbController.GetEntry(Convert.ToInt32(currentSelection));

            webBrowser1.DocumentText = "<html><body style='background-color:black;'></body></html>";

            try
            {
                System.Diagnostics.Process.Start(entry.Path);
            }
            catch (Exception ex)
            {
            }
        }
Example #2
0
        private void flowLayoutPanel1_DragDrop(object sender, DragEventArgs e)
        {
            string[] files3 = (string[])e.Data.GetData(DataFormats.FileDrop);

            if (quickMode && files3 != null)
            {
                foreach (var item in files3)
                {
                    ShortcutInfo sInfo = new ShortcutInfo();
                    sInfo = ShortcutsController.GetShortcutInfo(item);

                    if (!sInfo.isError)
                    {
                        if (model.AppEntries.Count(x => x.Path == sInfo.Path) > 0)
                        {
                            continue;
                        }
                        var results = ImagesProvider.googleSearch(sInfo.Name + " cover");

                        AppEntry newEntry = new AppEntry();
                        newEntry.Name   = sInfo.Name;
                        newEntry.Path   = sInfo.Path;
                        newEntry.Image2 = Tools.GetByteFromUrl(results[0].Link);

                        DbController.AddEntry(newEntry);
                    }
                }

                ShowAppEntries();
            }

            if (!quickMode && files3 != null)
            {
                ShortcutInfo sInfo = new ShortcutInfo();
                sInfo = ShortcutsController.GetShortcutInfo(files3[0]);

                if (!sInfo.isError)
                {
                    AppEntryDetailsForm entryDetailsForm = new AppEntryDetailsForm();
                    entryDetailsForm.Show();
                    entryDetailsForm.InitializeValuesFromShortcut(sInfo);
                }
            }
        }
Example #3
0
        private void Pic_Click(object sender, EventArgs e)
        {
            MouseEventArgs me = (MouseEventArgs)e;

            if (selectedItem == (sender as PictureBox).Name && me.Button == MouseButtons.Left)
            {
                return;
            }

            PictureBox tmpPictureBox = (PictureBox)sender;
            int        entryId       = Convert.ToInt32(tmpPictureBox.Name.Replace("pb_", ""));
            AppEntry   entry         = DbController.GetEntry(entryId);

            selectedItem     = tmpPictureBox.Name;
            cmd_play.Visible = true;
            (sender as PictureBox).BorderStyle = BorderStyle.Fixed3D;

            foreach (var item in (sender as PictureBox).Parent.Controls.OfType <PictureBox>().Where(x => x.BorderStyle != BorderStyle.None && x.Name != selectedItem))
            {
                item.BorderStyle = BorderStyle.None;
            }

            lbl_status.Text = entry.Path;

            if (me.Button == MouseButtons.Right)
            {
                Form[] formsList = Application.OpenForms.OfType <AppEntryDetailsForm>().Cast <Form>().ToArray();
                foreach (Form openForm in formsList)
                {
                    openForm.Close();
                }

                AppEntryDetailsForm entryDetailsForm = new AppEntryDetailsForm();
                entryDetailsForm.Show();
                entryDetailsForm.InitializeValuesFromEntry(entry);
            }
            else
            {
                fill_RightPanel(entry);
            }
        }