예제 #1
0
        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();
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
 private void combButton_Click(object sender, EventArgs e)
 {
     _guidFormatter = _guidFormatterFactory.CreateFor(_guidFormatter.Guid.Comb());
     UpdateGuidText();
 }
예제 #4
0
 private void emptyGuidButton_Click(object sender, EventArgs e)
 {
     _guidFormatter = _guidFormatterFactory.CreateFor(Guid.Empty);
     UpdateGuidText();
 }
예제 #5
0
 private void generateNewGuidButton_Click(object sender, EventArgs e)
 {
     _guidFormatter = _guidFormatterFactory.CreateFor(Guid.NewGuid());
     UpdateGuidText();
 }