MovieContainer.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace PicSo
  10. {
  11. public partial class MovieContainer : UserControl
  12. {
  13. public MovieContainer()
  14. {
  15. InitializeComponent();
  16. }
  17. private AVSORTER.Movie _movie;
  18. public AVSORTER.Movie Movie
  19. {
  20. get { return _movie; }
  21. set
  22. {
  23. if (value!=null)
  24. {
  25. _movie = value;
  26. if (value.Actor!=null)
  27. {
  28. txt_Actor.Text = AVSORTER.Tools.ListToString(value.Actor);
  29. }
  30. if (value.AVCode!=null)
  31. {
  32. txt_Code.Text = value.AVCode;
  33. }
  34. if (value.CoverFile!=null)
  35. {
  36. txt_CoverFile.Text = value.CoverFile;
  37. if (System.IO.File.Exists(value.CoverFile))
  38. {
  39. this.pictureBox1.Image = Image.FromFile(value.CoverFile);
  40. }
  41. }
  42. if (value.Introduction!=null)
  43. {
  44. txt_intro.Text = value.Introduction;
  45. }
  46. if (value.ItemURL!=null)
  47. {
  48. txt_ItemURL.Text = value.ItemURL;
  49. }
  50. if (value.Lable!=null)
  51. {
  52. txt_Lable.Text = value.Lable;
  53. }
  54. if (value.Maker!=null)
  55. {
  56. txt_Maker.Text = value.Maker;
  57. }
  58. if (value.Minutes!=null)
  59. {
  60. txt_Minutes.Text = value.Minutes;
  61. }
  62. if (value.Producer!=null)
  63. {
  64. txt_Producer.Text = value.Producer;
  65. }
  66. if (value.ReleaseDate!=null)
  67. {
  68. txt_ReleaseDate.Text = value.ReleaseDate.ToString("yyyy年MM月dd日");
  69. }
  70. if (value.Series!=null)
  71. {
  72. txt_Series.Text = value.Series;
  73. }
  74. if (value.Title!=null)
  75. {
  76. txt_Title.Text = value.Title;
  77. }
  78. }
  79. }
  80. }
  81. private List<AVSORTER.Movie> _list;
  82. public List<AVSORTER.Movie> MovieList
  83. {
  84. get { return _list; }
  85. set { _list = value; }
  86. }
  87. void showNext()
  88. {
  89. int i = _list.IndexOf(this.Movie);
  90. if (i < this.MovieList.Count-1)
  91. {
  92. this.Movie = this.MovieList[++i];
  93. }
  94. }
  95. void showPre()
  96. {
  97. int i = _list.IndexOf(this.Movie);
  98. if (i > 0)
  99. {
  100. this.Movie = this.MovieList[--i];
  101. }
  102. }
  103. private void pictureBox1_DoubleClick(object sender, EventArgs e)
  104. {
  105. if (this.Movie!=null && this.Movie.CoverFile != null && System.IO.File.Exists(this.Movie.CoverFile))
  106. {
  107. System.Diagnostics.Process.Start(this.Movie.CoverFile);
  108. }
  109. }
  110. private void btn_pre_Click(object sender, EventArgs e)
  111. {
  112. showPre();
  113. }
  114. private void btn_next_Click(object sender, EventArgs e)
  115. {
  116. showNext();
  117. }
  118. private void btn_openWithBrower_Click(object sender, EventArgs e)
  119. {
  120. System.Diagnostics.Process.Start(this.txt_ItemURL.Text);
  121. }
  122. private void btn_find_Click(object sender, EventArgs e)
  123. {
  124. System.Diagnostics.Process.Start("explorer", System.IO.Path.GetDirectoryName(this.Movie.CoverFile));
  125. }
  126. }
  127. }