示例#1
0
        private void chkXXX_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Cursor = Cursors.Wait;
                if (chkXXX.IsChecked == true)
                {
                    DirectoryInfo objFolder;
                    if (lstAvailableTheme.SelectedItem == null)
                    {
                        objFolder = (DirectoryInfo)lstAvailableTheme.Items[0];
                    }
                    else
                    {
                        objFolder = (DirectoryInfo)lstAvailableTheme.SelectedItem;
                    }

                    string strPath = objFolder.FullName + @"\" + objFolder.Name + ".xml";
                    imgPreview.Source = ThemeServices.CreateImage(_objItem, strPath, DevicesServices.GetDevice());
                }
            }
            catch (Exception ex)
            {
                CatchException(ex);
            }
            finally
            {
                Cursor = null;
            }
        }
示例#2
0
        private void cboDevices_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                Cursor = Cursors.Wait;

                DirectoryInfo objFolder = (DirectoryInfo)lstAvailableTheme.SelectedItem;
                if (objFolder != null && _objItem != null)
                {
                    string strPath = objFolder.FullName + @"\" + objFolder.Name + ".xml";
                    if (chkMovies.IsChecked == true)
                    {
                        imgPreview.Source = ThemeServices.CreateImage(_objItem, strPath,
                                                                      DevicesServices.GetDevice(cboDevices.SelectedValue.ToString()));
                    }
                    else if (chkMusic.IsChecked == true)
                    {
                        imgPreview.Source = ThemeServices.CreateImage(_objItem, strPath,
                                                                      DevicesServices.GetDevice(cboDevices.SelectedValue.ToString()));
                    }
                    else if (chkSeries.IsChecked == true)
                    {
                        imgPreview.Source = ThemeServices.CreateImage(_objItem, strPath,
                                                                      DevicesServices.GetDevice(cboDevices.SelectedValue.ToString()));
                    }
                    else if (chkXXX.IsChecked == true)
                    {
                        imgPreview.Source = ThemeServices.CreateImage(_objItem, strPath,
                                                                      DevicesServices.GetDevice(cboDevices.SelectedValue.ToString()));
                    }
                    else if (chkGames.IsChecked == true || typeof(Gamez) == _objItem.GetType())
                    {
                        imgPreview.Source = ThemeServices.CreateImage(_objItem, strPath,
                                                                      DevicesServices.GetDevice(cboDevices.SelectedValue.ToString()));
                    }
                    else
                    {
                        imgPreview.Source = ThemeServices.CreateImage(_objItem, strPath,
                                                                      DevicesServices.GetDevice(cboDevices.SelectedValue.ToString()));
                    }
                }
            }
            catch (Exception ex)
            {
                CatchException(ex);
            }
            finally
            {
                Cursor = null;
            }
        }
示例#3
0
        private void cmdGenerate_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Cursor = Cursors.Wait;
                string strPath;
                if (string.IsNullOrWhiteSpace(txtTvixOutPut.Text) == false && txtTvixOutPut.IsEnabled == true)
                {
                    strPath = txtTvixOutPut.Text;
                }
                else
                {
                    strPath = Path.GetFullPath(".");
                }

                strPath = ThemeServices.CreatePreviewTvix((BitmapSource)imgPreview.Source, strPath, DevicesServices.GetDevice());

                if (string.IsNullOrWhiteSpace(strPath) == false)
                {
                    new MessageBoxYesNo("Layout generated in : " + strPath, false, false).ShowDialog();
                }
                else
                {
                    new MessageBoxYesNo("Be sure you created at least one item (Game, movie...)", false, false).ShowDialog();
                }
            }
            catch (Exception ex)
            {
                CatchException(ex);
            }
            finally
            {
                Cursor = null;
            }
        }
示例#4
0
        private void ShowItem()
        {
            if (_objItem != null)
            {
                switch (_objItem.GetType().ToString())
                {
                case "myCollections.Data.SqlLite.Gamez":
                    imgPreview.Source = ThemeServices.CreateImage(_objItem, _strThemePath, DevicesServices.GetDevice());
                    break;

                case "myCollections.Data.SqlLite.Movie":
                    imgPreview.Source = ThemeServices.CreateImage(_objItem, _strThemePath, DevicesServices.GetDevice());
                    break;

                case "myCollections.Data.SqlLite.Music":
                    imgPreview.Source = ThemeServices.CreateImage(_objItem, _strThemePath, DevicesServices.GetDevice());
                    break;

                case "myCollections.Data.SqlLite.Series_Season":
                    imgPreview.Source = ThemeServices.CreateImage(_objItem, _strThemePath, DevicesServices.GetDevice());
                    break;

                case "myCollections.Data.SqlLite.XXX":
                    imgPreview.Source = ThemeServices.CreateImage(_objItem, _strThemePath, DevicesServices.GetDevice());
                    break;
                }
            }
        }
 private void cmdGenerate_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Cursor         = Cursors.Wait;
         _strOutputPath = ThemeServices.CreatePreviewTvix((BitmapSource)_objImage, _strOutputPath, DevicesServices.GetDevice());
         new MessageBoxYesNo("Layout generated in : " + _strOutputPath, false, false).ShowDialog();
     }
     catch (Exception ex)
     {
         CatchException(ex);
     }
     finally
     {
         Cursor = null;
     }
 }