Пример #1
0
    public IoCommandStartEvent ReadIoCommandStartEvent(ExtendedBinaryReader reader)
    {
        var evt = new IoCommandStartEvent
        {
            Uid = reader.Read7BitEncodedInt(),
            ProcessInvocationUid = reader.Read7BitEncodedInt(),
            Kind           = (IoCommandKind)reader.ReadByte(),
            Location       = GetTextById(reader.Read7BitEncodedInt()),
            Path           = GetTextById(reader.Read7BitEncodedInt()),
            TimeoutSeconds = reader.ReadNullableInt32(),
            Command        = reader.ReadNullableString(),
            TransactionId  = GetTextById(reader.Read7BitEncodedInt()),
        };

        var argCount = reader.Read7BitEncodedInt();

        if (argCount > 0)
        {
            evt.Arguments = new KeyValuePair <string, object> [argCount];
            for (var i = 0; i < argCount; i++)
            {
                var name  = GetTextById(reader.Read7BitEncodedInt());
                var value = reader.ReadObject();
                evt.Arguments[i] = new KeyValuePair <string, object>(name, value);
            }
        }

        return(evt);
    }
Пример #2
0
    public LogEvent ReadLogEvent(ExtendedBinaryReader reader)
    {
        var evt = new LogEvent
        {
            TransactionId        = GetTextById(reader.Read7BitEncodedInt()),
            Text                 = reader.ReadString(),
            Severity             = (LogSeverity)reader.ReadByte(),
            ProcessInvocationUID = reader.ReadNullableInt32()
        };

        var argCount = reader.Read7BitEncodedInt();

        if (argCount > 0)
        {
            evt.Arguments = new KeyValuePair <string, object> [argCount];
            for (var i = 0; i < argCount; i++)
            {
                var key   = GetTextById(reader.Read7BitEncodedInt());
                var value = reader.ReadObject();
                evt.Arguments[i] = new KeyValuePair <string, object>(key, value);
            }
        }

        return(evt);
    }
Пример #3
0
    public RowCreatedEvent ReadRowCreatedEvent(ExtendedBinaryReader reader)
    {
        var evt = new RowCreatedEvent
        {
            ProcessInvocationUid = reader.Read7BitEncodedInt(),
            RowUid = reader.Read7BitEncodedInt()
        };

        var columnCount = reader.Read7BitEncodedInt();

        if (columnCount > 0)
        {
            evt.Values = new KeyValuePair <string, object> [columnCount];
            for (var i = 0; i < columnCount; i++)
            {
                var column = GetTextById(reader.Read7BitEncodedInt());
                var value  = reader.ReadObject();
                evt.Values[i] = new KeyValuePair <string, object>(column, value);
            }
        }

        return(evt);
    }