public static Item GenerateItem(long id) { var header = new Header(id, new Handle(true)); var allowedGroups = new int[RandomGenerator.Instance.Next(MaxGroups + 1)]; for (var i = 0; i < allowedGroups.Length; i++) allowedGroups[i] = RandomGenerator.Instance.Next(GroupNumber); var deniedUsers = new int[RandomGenerator.Instance.Next(MaxGroups + 1)]; for (var i = 0; i < deniedUsers.Length; i++) deniedUsers[i] = RandomGenerator.Instance.Next(GroupNumber); return new Item(header, allowedGroups, deniedUsers); }
public Item(Header header, int[] enabled, int[] disabled) { _header = header; _enabled = enabled; _disabled = disabled; }
void IPortable.ReadPortable(IPortableReader reader) { _header = reader.ReadPortable<Header>("header"); _enabled = reader.ReadIntArray("enabled"); _disabled = reader.ReadIntArray("disabled"); }
public bool Equals(Header other) { return _id == other._id && _handle.Equals(other._handle); }