private void MainForm_Load(object sender, EventArgs e) { var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; Text = $@"{AppName} {version.Major}.{version.Minor}.{version.Revision}"; _origTextBackColor = guidTextBox.BackColor; _origTextForeColor = guidTextBox.ForeColor; _guidFormatterFactory = new GuidFormatterFactory(this); _guidFormatter = _guidFormatterFactory.CreateFor(Guid.NewGuid()); UpdateGuidText(); }
private void guidTextBox_TextChanged(object sender, EventArgs e) { var input = guidTextBox.Text .Replace("{", string.Empty) .Replace("}", string.Empty); if (!Guid.TryParse(input, out var guid)) { guidTextBox.BackColor = Color.Red; guidTextBox.ForeColor = Color.White; UpdateTextLengthLabel(); } else { guidTextBox.BackColor = _origTextBackColor; guidTextBox.ForeColor = _origTextForeColor; _guidFormatter = _guidFormatterFactory.CreateFor(guid); guidTextBox.Text = _guidFormatter.GetAsFormatted(); } }
private void combButton_Click(object sender, EventArgs e) { _guidFormatter = _guidFormatterFactory.CreateFor(_guidFormatter.Guid.Comb()); UpdateGuidText(); }
private void emptyGuidButton_Click(object sender, EventArgs e) { _guidFormatter = _guidFormatterFactory.CreateFor(Guid.Empty); UpdateGuidText(); }
private void generateNewGuidButton_Click(object sender, EventArgs e) { _guidFormatter = _guidFormatterFactory.CreateFor(Guid.NewGuid()); UpdateGuidText(); }