Exemplo n.º 1
0
            internal Option(MaskField owner, string name, ulong value)
            {
                Ensure.Argument.NotNull(owner, "owner");
                Ensure.Argument.NotNullOrEmpty(name, "name");

                Owner = owner;
                Name  = name;
                Value = value;
            }
Exemplo n.º 2
0
        public EnumFlagsField(string label, TEnum value = default(TEnum))
        {
            var type    = typeof(TEnum);
            var names   = Enum.GetNames(type);
            var values  = (TEnum[])Enum.GetValues(type);
            var options = names.Select((n, i) => Tuple.Create(n, ToMask(values[i])));

            field = new MaskField(label, ToMask(value), options);
            field.ValueChanged += OnMaskValueChanged;
        }