Add method to Generate ID

This commit is contained in:
ivandroly 2015-07-13 01:32:25 +00:00
parent e4d8587658
commit ca1f68a637

View File

@ -100,8 +100,7 @@ namespace Nikse.SubtitleEdit.Forms.DCinema
private void buttonGenerateID_Click(object sender, EventArgs e)
{
string hex = Guid.NewGuid().ToString().Replace("-", string.Empty);
textBoxSubtitleID.Text = "urn:uuid:" + hex.Insert(8, "-").Insert(13, "-").Insert(18, "-").Insert(23, "-");
textBoxSubtitleID.Text = GenerateID();
}
private void buttonToday_Click(object sender, EventArgs e)
@ -141,13 +140,18 @@ namespace Nikse.SubtitleEdit.Forms.DCinema
private void button1_Click(object sender, EventArgs e)
{
string hex = Guid.NewGuid().ToString().Replace("-", string.Empty);
textBoxFontUri.Text = "urn:uuid:" + hex.Insert(8, "-").Insert(13, "-").Insert(18, "-").Insert(23, "-");
textBoxFontUri.Text = GenerateID();
}
private void buttonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private string GenerateID()
{
var hex = Guid.NewGuid().ToString().Replace("-", string.Empty);
return "urn:uuid:" + hex.Insert(8, "-").Insert(13, "-").Insert(18, "-").Insert(23, "-");
}
}
}
}