Пример #1
0
        public static Permission Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new Permission
            {
                Id = currentParameterGroup.GetParameter("permid") == null ? 0 : currentParameterGroup.GetParameterValue<uint>("permid"),
                Name = currentParameterGroup.GetParameterValue("permsid"),
                Value = currentParameterGroup.GetParameterValue<int>("permvalue"),
                Negated = currentParameterGroup.GetParameterValue("permnegated") == "1",
                Skip = currentParameterGroup.GetParameterValue("permskip") == "1"
            };
        }
Пример #2
0
        public static Permission Parse(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
                throw new ArgumentNullException("currentParameterGroup");

            return new Permission
            {
                Id = currentParameterGroup.GetParameter("permid") == null ? 0 : currentParameterGroup.GetParameterValue<uint>("permid"),
                Name = currentParameterGroup.GetParameterValue("permsid"),
                Value = currentParameterGroup.GetParameterValue<int>("permvalue"),
                Negated = currentParameterGroup.GetParameterValue("permnegated") == "1",
                Skip = currentParameterGroup.GetParameterValue("permskip") == "1"
            };
        }
Пример #3
0
        Permission IEntity <Permission> .ApplyFrom(CommandParameterGroup currentParameterGroup, CommandParameterGroup firstParameterGroup)
        {
            if (currentParameterGroup == null)
            {
                throw new ArgumentNullException(nameof(currentParameterGroup));
            }

            Id      = currentParameterGroup.GetParameter("permid") == null ? 0 : currentParameterGroup.GetParameterValue <uint>("permid");
            Name    = currentParameterGroup.GetParameterValue("permsid");
            Value   = currentParameterGroup.GetParameterValue <int>("permvalue");
            Negated = currentParameterGroup.GetParameterValue("permnegated") == "1";
            Skip    = currentParameterGroup.GetParameterValue("permskip") == "1";

            return(this);
        }