- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
namespace ChemicalLabs
{
public partial class MediaViewer : Form
{
public static string XPath;
public MediaViewer(string ObjectMediaRef, string ObjectMediaName)
{
InitializeComponent();
try
{
this.Text = ObjectMediaName;
axWindowsMediaPlayer.settings.volume = 100;
ObjectMediaRef = (Convert.ToInt16(ObjectMediaRef) + 1).ToString();
XPath = ObjectMediaRef;
StreamReader DataStream = new StreamReader("c://ChemicalData/" + ObjectMediaRef + "/" + ObjectMediaRef + ".txt", Encoding.GetEncoding(1251));
_MEDIA_DATA_AREA.Text = DataStream.ReadToEnd();
object[] MediaFiles = Directory.GetFiles(
@"c://ChemicalData/" + ObjectMediaRef + "/" + "Media", "*.mp4", SearchOption.TopDirectoryOnly);
for (int i = 0; i < MediaFiles.Length; i++)
{FileInfo a = new FileInfo(MediaFiles[i].ToString());MediaFilesList.Items.Add(a.Name.Remove(a.Name.Length - 4));}
}
catch (Exception Ex)
{MessageBox.Show(Ex.ToString(),(Ex.Message).ToString(),buttons: MessageBoxButtons.OK,icon: MessageBoxIcon.Information);}
}
private void MD_Click(object sender, EventArgs e)
{
if (MediaFilesList.SelectedItem == null)
{MessageBox.Show("Вы не выбрали материал! Просмотр невозможен.","Сами не знаете, что хотите...",buttons: MessageBoxButtons.OK,icon: MessageBoxIcon.Information);}
else
{
string MediaPath;
MediaPath = MediaFilesList.SelectedItem.ToString();
MediaPath = "c://ChemicalData/" + XPath + "/" + "Media" + "/" + MediaPath + ".mp4";
axWindowsMediaPlayer.close();
axWindowsMediaPlayer.URL = MediaPath;
}
}
private void MediaStreamClose_Click(object sender, EventArgs e)
{this.axWindowsMediaPlayer.close();}
private void _MediaForm_Close_Click(object sender, EventArgs e)
{this.axWindowsMediaPlayer.close(); MediaViewer.ActiveForm.Close();}
private void MediaViewer_FormClosed(object sender, FormClosedEventArgs e)
{this.axWindowsMediaPlayer.close();MediaViewer.ActiveForm.Close();}
private void axWindowsMediaPlayer_MouseDownEvent(object sender, AxWMPLib._WMPOCXEvents_MouseDownEvent e)
{MessageBox.Show("MediaPlayer - ver 0.0.1 for .NET Platform (By Kirill Sancharov)","MediaPlayer for Windows .NET",buttons: MessageBoxButtons.OK,icon: MessageBoxIcon.Information);}
}
}