ReadContentsAsInt64() публичный Метод

Reads the contents of the current data value as a long.
An error occurred while parsing the EmBER-encoded data, see /// for more information. /// /// The value of is not equal to , or /// The contents of the current data value has already been read. /// /// has been called.
public ReadContentsAsInt64 ( ) : long
Результат long
        private void ToXmlCore(
            EmberReader reader, XmlWriter writer, FieldPath <int, EmberId> previousPath, int currentType)
        {
            while (reader.Read())
            {
                var nextType = reader.InnerNumber;

                if (nextType == InnerNumber.EndContainer)
                {
                    writer.WriteEndElement();
                    return;
                }

                var currentPath = Combine(previousPath, new Field <int, EmberId>(currentType, reader.OuterId));
                var fieldName   = this.GetFieldName(currentPath);

                switch (nextType)
                {
                case BerBoolean.InnerNumber:
                    var boolean = reader.ReadContentsAsBoolean();
                    WriteValue(writer, fieldName, BerBoolean.Name, boolean, (w, o) => w.WriteValue(o));
                    break;

                case BerInteger.InnerNumber:
                    var integer = reader.ReadContentsAsInt64();
                    WriteValue(writer, fieldName, BerInteger.Name, integer, (w, o) => w.WriteValue(o));
                    break;

                case BerReal.InnerNumber:
                    WriteValue(
                        writer, fieldName, BerReal.Name, reader.ReadContentsAsDouble(), (w, o) => w.WriteValue(o));
                    break;

                case BerUtf8String.InnerNumber:
                    string str;

                    try
                    {
                        str = XmlConvert.VerifyXmlChars(reader.ReadContentsAsString());
                    }
                    catch (XmlException)
                    {
                        str = "*** CONTAINS INVALID XML CHARACTERS ***";
                    }

                    switch (currentPath.ToString())
                    {
                    case "1073741825.C-1.C-6":
                    case "1073741825.C-1.C-7":
                    case "1073741825.C-1.C-17":
                    case "1073741833.C-1.C-6":
                    case "1073741833.C-1.C-7":
                    case "1073741833.C-1.C-17":
                    case "1073741827.C-1.C-4":
                    case "1073741834.C-1.C-4":
                    case "1073741837.C-1.C-11":
                    case "1073741841.C-1.C-11":
                        str = str.Replace("\n", Environment.NewLine);
                        break;

                    default:
                        // Intentionally do nothing
                        break;
                    }

                    WriteValue(writer, fieldName, BerUtf8String.Name, str, (w, o) => w.WriteValue(o));
                    break;

                case BerOctetstring.InnerNumber:
                    var bytes = reader.ReadContentsAsByteArray();
                    WriteValue(
                        writer, fieldName, BerOctetstring.Name, bytes, (w, o) => w.WriteBinHex(o, 0, o.Length));
                    break;

                case BerRelativeObjectIdentifier.InnerNumber:
                    var intOid = reader.ReadContentsAsInt32Array();
                    var oid    = string.Join(".", intOid.Select(e => e.ToString(InvariantCulture)));
                    WriteValue(writer, fieldName, BerRelativeObjectIdentifier.Name, oid, (w, o) => w.WriteValue(o));
                    break;

                case BerSequence.InnerNumber:
                    WriteStartContainer(writer, fieldName, BerSequence.Name);
                    this.ToXmlCore(reader, writer, currentPath, nextType);
                    break;

                case BerSet.InnerNumber:
                    WriteStartContainer(writer, fieldName, BerSet.Name);
                    this.ToXmlCore(reader, writer, currentPath, nextType);
                    break;

                default:
                    WriteStartContainer(writer, fieldName, this.GetTypeName(nextType));
                    this.ToXmlCore(reader, writer, currentPath, nextType);
                    break;
                }
            }
        }