private void AddTag(string texto) { if (_tags == null) { return; } Kenos.TagsLib.Tag tag = new Kenos.TagsLib.Tag(); try { tag.TimeSpan = new TimeSpan(0, 0, Convert.ToInt32(wmpPlayer.Ctlcontrols.currentPosition)); tag.Description = texto; _tags.Add(tag); Changed(true); BindTags(); Log("Marca agregada"); } catch (Exception ex) { Log(ex.Message); } }
private void gvMarcas_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) { if (gvMarcas.IsCurrentCellInEditMode) { if (e.ColumnIndex == 0) { TimeSpan ts; if (!TimeSpan.TryParse(e.FormattedValue.ToString(), out ts)) { MessageBox.Show(this, "El formato de tiempo ingresado no es válido", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); e.Cancel = true; return; } } //Valida si se cambio algo Kenos.TagsLib.Tag tag = _tags[e.RowIndex]; string val = tag.Description; if (e.ColumnIndex == 0) { val = tag.Time; } if (!e.FormattedValue.ToString().Equals(val, StringComparison.CurrentCultureIgnoreCase)) { Changed(true); } } }
private void gvMarcas_CellClick(object sender, DataGridViewCellEventArgs e) { if (gvMarcas.SelectedRows.Count > 0) { Kenos.TagsLib.Tag tag = (Kenos.TagsLib.Tag)gvMarcas.SelectedRows[0].DataBoundItem; wmpPlayer.Ctlcontrols.currentPosition = tag.TimeSpan.TotalSeconds; if (wmpPlayer.playState == WMPLib.WMPPlayState.wmppsPaused || wmpPlayer.playState == WMPLib.WMPPlayState.wmppsStopped) { wmpPlayer.Ctlcontrols.play(); } } }