1. C# / Говнокод #9712

    +109

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 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);}
     }
    }

    Удивляй меня полностью.

    Запостил: Govnisti_Diavol, 19 Марта 2012

    Комментарии (7) RSS

    Добавить комментарий