/// <summary> /// Получает значение события из массива байт. /// </summary> /// <param name="bytes">массив байт</param> /// <param name="offset">смещение в массиве</param> /// <returns></returns> public static ScEvent Parse(byte[] bytes, int offset) { return(bytes.Length >= SctpProtocol.ScEventLength + offset ? new ScEvent( SubscriptionId.Parse(bytes, offset), ScAddress.Parse(bytes, offset + SctpProtocol.SubscriptionIdLength), ScAddress.Parse(bytes, offset + SctpProtocol.SubscriptionIdLength + SctpProtocol.ScAddressLength)) : null); }
/// <summary> /// Инициализирует новое событие. /// </summary> /// <param name="subscriptionId">id подписки</param> /// <param name="elementAddress">адрес элемента</param> /// <param name="arcAddress">адрес дуги</param> public ScEvent(SubscriptionId subscriptionId, ScAddress elementAddress, ScAddress arcAddress) { this.subscriptionId = subscriptionId; this.elementAddress = elementAddress; this.arcAddress = arcAddress; }