//protected CustomForm() : this(100, 100) //{ //} protected _CustomFormOld(int width, int height) { InitializeComponent(); this.uiForm = new UI.Container(new UI.Rect2D { X = 0, Y = 0, W = width, H = height }); this.uiContainer = new UI.Container(new UI.Rect2D { X = 4, Y = 12, W = width - 8, H = height - 16 }); this.buttonMinimize = new UI.OldButton(new UI.Rect2D { X = width - 21, Y = 2, W = 9, H = 9 }); this.buttonClose = new UI.OldButton(new UI.Rect2D { X = width - 11, Y = 2, W = 9, H = 9 }); this.uiForm .AddChild(buttonMinimize) .AddChild(buttonClose) .AddChild(uiContainer); this.uiContainer.Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Left; this.buttonMinimize.Anchor = AnchorStyles.Right; this.buttonClose.Anchor = AnchorStyles.Right; this.buttonMinimize.Click += BtnMinimizeHandler; this.buttonClose.Click += BtnCloseHandler; }
public _OldMain() : base(488, 145) { InitializeComponent(); playlist = new List <PlaylistItemModel>(); Settings.Instance.PlayerSettings = Utils.XmlUtility.DeserializeFromXmlString <PlayerSettings>(System.IO.File.ReadAllText("settings.xml")); try { playlist = Utils.XmlUtility.DeserializeFromXmlString <List <PlaylistItemModel> >(System.IO.File.ReadAllText(Settings.Instance.PlayerSettings.PlaylistFilePath)); } catch (Exception e) { } this.StartPosition = FormStartPosition.Manual; this.Location = new Point(Settings.Instance.PlayerSettings.MainWindow.WindowX, Settings.Instance.PlayerSettings.MainWindow.WindowY); List <UI.PlayListMenu <PlaylistItemModel> .TableSetingsModel> playlistSetings = new List <UI.PlayListMenu <PlaylistItemModel> .TableSetingsModel> { new UI.PlayListMenu <PlaylistItemModel> .TableSetingsModel() { FieldName = "Name", Width = 215, Alignment = StringAlignment.Near }, new UI.PlayListMenu <PlaylistItemModel> .TableSetingsModel() { FieldName = "DurationFormated", Width = 55, Alignment = StringAlignment.Far } }; buttonPrev = new UI.OldButton(new UI.Rect2D { X = 4, Y = 113, W = 17, H = 13 }); buttonPlay = new UI.OldButton(new UI.Rect2D { X = 22, Y = 113, W = 17, H = 13 }); buttonPause = new UI.OldButton(new UI.Rect2D { X = 40, Y = 113, W = 17, H = 13 }); buttonStop = new UI.OldButton(new UI.Rect2D { X = 58, Y = 113, W = 17, H = 13 }); buttonNext = new UI.OldButton(new UI.Rect2D { X = 76, Y = 113, W = 17, H = 13 }); buttonTST = new UI.OldButton(new UI.Rect2D { X = 4, Y = 50, W = 17, H = 13 }); sliderProgress = new UI.OldSlider(new UI.Rect2D { X = 4, Y = 102, W = 192, H = 7 }, "Slider1", UI.OldSlider.SliderOrientation.Horizontal); sliderVolume = new UI.OldSlider(new UI.Rect2D { X = 102, Y = 116, W = 94, H = 7 }, "Slider2", UI.OldSlider.SliderOrientation.Horizontal); UI.PlayListMenu <PlaylistItemModel> pm = new UI.PlayListMenu <PlaylistItemModel>(new UI.Rect2D { X = 198, Y = 4, W = 278, H = 108 }, playlist, playlistSetings); uiContainer.AddChild(pm) .AddChild(buttonPrev) .AddChild(buttonPlay) .AddChild(buttonPause) .AddChild(buttonStop) .AddChild(buttonNext) .AddChild(sliderProgress) .AddChild(sliderVolume) .AddChild(buttonTST); buttonPrev.Click += BtnClickHandler; buttonPlay.Click += BtnPlayClickHandler; buttonPause.Click += BtnPauseClickHandler; buttonStop.Click += BtnStopClickHandler; buttonNext.Click += BtnClickHandler; buttonTST.Click += BtnVideoHandler; buttonClose.Click += BtnCloseHandler; sliderVolume.Change += VolumeChangeHandler; sliderProgress.Change += ProgressChangeHandler; pm.SelectionChanged += PlaylistSelectHandler; pm.Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Left; sliderProgress.Value = 0.8f; }