Пример #1
0
        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);
        }
Пример #2
0
 public Item(Header header, int[] enabled, int[] disabled)
 {
     _header = header;
     _enabled = enabled;
     _disabled = disabled;
 }
Пример #3
0
 void IPortable.ReadPortable(IPortableReader reader)
 {
     _header = reader.ReadPortable<Header>("header");
     _enabled = reader.ReadIntArray("enabled");
     _disabled = reader.ReadIntArray("disabled");
 }
Пример #4
0
 public bool Equals(Header other)
 {
     return _id == other._id && _handle.Equals(other._handle);
 }