mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 15:02:35 +01:00
Add method to Generate ID
This commit is contained in:
parent
e4d8587658
commit
ca1f68a637
@ -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, "-");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user