Exemplo n.º 1
0
        private void buttonBext_Click(object sender, RoutedEventArgs e)
        {
            if (!StringFormatCheck(textBoxBextDescription.Text, "Description", 256))
            {
                return;
            }
            if (!StringFormatCheck(textBoxBextOriginator.Text, "Originator", 32))
            {
                return;
            }
            if (!StringFormatCheck(textBoxBextOriginatorReference.Text, "OriginatorReference", 32))
            {
                return;
            }
            if (!StringFormatCheck(textBoxBextOriginationDate.Text, "OriginationDate", 10))
            {
                return;
            }
            if (!StringFormatCheck(textBoxBextOriginationTime.Text, "OriginationTime", 8))
            {
                return;
            }
            int timeReference;

            if (!Int32.TryParse(textBoxBextTimeReference.Text, out timeReference))
            {
                MessageBox.Show("Error: TimeReference must be integer number");
                return;
            }

            var p = new BextChunkParams();

            p.Description         = textBoxBextDescription.Text;
            p.Originator          = textBoxBextOriginator.Text;
            p.OriginatorReference = textBoxBextOriginatorReference.Text;
            p.OriginationDate     = textBoxBextOriginationDate.Text;
            p.OriginationTime     = textBoxBextOriginationTime.Text;
            p.TimeReference       = timeReference;

            WavChunk = p;

            DialogResult = true;
            Close();
        }
Exemplo n.º 2
0
        private void buttonBext_Click(object sender, RoutedEventArgs e)
        {
            if (!StringFormatCheck(textBoxBextDescription.Text, "Description", 256)) {
                return;
            }
            if (!StringFormatCheck(textBoxBextOriginator.Text, "Originator", 32)) {
                return;
            }
            if (!StringFormatCheck(textBoxBextOriginatorReference.Text, "OriginatorReference", 32)) {
                return;
            }
            if (!StringFormatCheck(textBoxBextOriginationDate.Text, "OriginationDate", 10)) {
                return;
            }
            if (!StringFormatCheck(textBoxBextOriginationTime.Text, "OriginationTime", 8)) {
                return;
            }
            int timeReference;
            if (!Int32.TryParse(textBoxBextTimeReference.Text, out timeReference)) {
                MessageBox.Show("Error: TimeReference must be integer number");
                return;
            }

            var p = new BextChunkParams();
            p.Description = textBoxBextDescription.Text;
            p.Originator = textBoxBextOriginator.Text;
            p.OriginatorReference = textBoxBextOriginatorReference.Text;
            p.OriginationDate = textBoxBextOriginationDate.Text;
            p.OriginationTime = textBoxBextOriginationTime.Text;
            p.TimeReference = timeReference;

            WavChunk = p;

            DialogResult = true;
            Close();
        }