public CommonItem(CommonItem item, bool transient, bool expired) // for cloning { SysProps = new NamedValueSet(); ItemKind = item.ItemKind; Transient = transient; Id = Guid.NewGuid(); AppScope = item.AppScope; NetScope = item.NetScope; Name = item.Name; AppProps = new NamedValueSet(item.AppProps); DataTypeName = item.DataTypeName; Created = DateTimeOffset.Now; StoreUSN = item.StoreUSN; if (expired) { Expires = Created; SysProps.Clear(); } else { Expires = Created.Add(item.Expires - item.Created); YData = item.YData; YDataHash = CalculateBufferHash(YData); YSign = item.YSign; SysProps = new NamedValueSet(item.SysProps); } }
public CommonItem AsCommonItem() { var result = new CommonItem( ItemId, V341Helpers.ToItemKind(ItemKind), Transient, ItemName, new NamedValueSet(AppProps), DataType, AppScope, new NamedValueSet(SysProps), NetScope, Created, Expires, YData, YSign, SourceUSN); return(result); }
public V341TransportItem(CommonItem item, bool excludeDataBody) { ItemId = item.Id; ItemKind = V341Helpers.ToV341ItemKind(item.ItemKind); Transient = item.Transient; ItemName = item.Name; AppProps = item.AppProps.Serialise(); SysProps = item.SysProps.Serialise(); DataType = item.DataTypeName; AppScope = item.AppScope; NetScope = item.NetScope; Created = item.Created; Expires = item.Expires; SourceUSN = item.StoreUSN; if (!excludeDataBody) { YData = item.YData; YSign = item.YSign; } }