MovieContainer.cs 4.5 KB

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