Exemple #1
0
        partial void StartByteIncrease(NSObject sender)
        {
            long StartByte;

            try
            {
                StartByte = Convert.ToInt64(StartByteField.StringValue, 16);
            }
            catch
            {
                new NSAlert {
                    MessageText = "Error", InformativeText = "Invalid start byte.", AlertStyle = NSAlertStyle.Informational
                }.RunModal();
                //MessageBox.Show("Invalid start byte.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            long EndByte;

            try
            {
                EndByte = Convert.ToInt64(EndByteField.StringValue, 16);
            }
            catch
            {
                new NSAlert {
                    MessageText = "Error", InformativeText = "Invalid end byte.", AlertStyle = NSAlertStyle.Informational
                }.RunModal();
                //MessageBox.Show("Invalid end byte.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            long Increment;

            try
            {
                Increment = Convert.ToInt64(IncrementField.StringValue, 16);
            }
            catch
            {
                new NSAlert {
                    MessageText = "Error", InformativeText = "Invalid increment.", AlertStyle = NSAlertStyle.Informational
                }.RunModal();
                //MessageBox.Show("Invalid increment.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            StartByte = StartByte + Increment;
            if (StartByte > EndByte)
            {
                StartByte = EndByte;
            }
            StartByteField.StringValue = StartByte.ToString("X");
        }
Exemple #2
0
        protected internal void ToShortText(ConsoleTable output, int indentLevel)
        {
            output.AddRow(
                StartByte.ToString(),
                (IndefiniteLength) ? "inf" : Asn1.GetTotalByteCount(this).ToString(),
                Constructed ? "cons" : "prim",
                Identifier.ToString(),
                string.Concat(string.Empty.PadLeft(indentLevel * 2, ' '), ShortDescription),
                DataText
                );

            if (Constructed)
            {
                foreach (Asn1Tag subTag in SubTags)
                {
                    subTag.ToShortText(output, indentLevel + 1);
                }
            }
        }