示例#1
0
        private static byte?GetInterfaceByte(int groupNo, InterfaceByteType type, AtrInterfaceByteGroupToken[] groups)
        {
            if (groups.Length > groupNo)
            {
                AtrInterfaceByteGroupToken InterfaceByteGroup = groups[groupNo];
                switch (type)
                {
                case InterfaceByteType.Ta:
                    return(InterfaceByteGroup.Ta);

                case InterfaceByteType.Tb:
                    return(InterfaceByteGroup.Tb);

                case InterfaceByteType.Tc:
                    return(InterfaceByteGroup.Tc);

                default:
                    throw new ArgumentOutOfRangeException(nameof(type));
                }
            }
            else
            {
                return(null);
            }
        }
示例#2
0
        private void SetInterfaceByte(int groupNo, InterfaceByteType type, AtrInterfaceByteGroupToken[] groups, byte?value)
        {
            if (groups.Length > groupNo)
            {
                AtrInterfaceByteGroupToken InterfaceByteGroup = groups[groupNo];
                switch (type)
                {
                case InterfaceByteType.Ta:
                    InterfaceByteGroup.Ta = value;
                    break;

                case InterfaceByteType.Tb:
                    InterfaceByteGroup.Tb = value;
                    break;

                case InterfaceByteType.Tc:
                    InterfaceByteGroup.Tc = value;
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(type));
                }
            }
            else
            {
                throw new ArgumentOutOfRangeException(nameof(groupNo));
            }
            this.RemoveUnusedGroups();
        }
示例#3
0
 protected void SetInterfaceByte(InterfaceByteGroupType groupType, int groupNo, InterfaceByteType type, byte?value)
 {
     this.EnsureGroupNumberExists(groupNo, _ => _.Type == groupType);
     this.SetInterfaceByte(groupNo, type, this.GetInterfaceGroups().Where(_ => _.Type == groupType).ToArray(), value);
 }
示例#4
0
 protected void SetInterfaceByte(int groupNo, InterfaceByteType type, byte?value)
 {
     this.EnsureGroupNumberExists(groupNo, _ => true);
     this.SetInterfaceByte(groupNo, type, this.GetInterfaceGroups().ToArray(), value);
 }
示例#5
0
 protected byte?GetInterfaceByte(InterfaceByteGroupType groupType, int groupNo, InterfaceByteType type)
 {
     return(AtrParametersBase.GetInterfaceByte(groupNo, type, this.GetInterfaceGroups().Where(_ => _.Type == groupType).ToArray()));
 }
示例#6
0
 protected byte?GetInterfaceByte(int groupNo, InterfaceByteType type)
 {
     return(AtrParametersBase.GetInterfaceByte(groupNo, type, this.GetInterfaceGroups().ToArray()));
 }