Exemplo n.º 1
0
        private AttributeDefinition GetAttributeDefinitionOf(BoardInformationStringId item)
        {
            switch (item)
            {
            case BoardInformationStringId.EAPI_ID_BOARD_MANUFACTURER_STR:
                return(new SgetAttributDefinition(new Guid("{6beb6a88-8061-4bdf-a900-1efd70a6686d}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "MANUFACTURER", UicDataType.String, String.Empty));

            case BoardInformationStringId.EAPI_ID_BOARD_NAME_STR:
                return(new SgetAttributDefinition(new Guid("{22e6f4fe-03e7-4c6d-b6f5-5cbf0ab9f9c6}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "NAME", UicDataType.String, String.Empty));

            case BoardInformationStringId.EAPI_ID_BOARD_REVISION_STR:
                return(new SgetAttributDefinition(new Guid("{c0adb64c-5a8a-4653-b42f-580b19a60d1c}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "REVISION", UicDataType.String, String.Empty));

            case BoardInformationStringId.EAPI_ID_BOARD_SERIAL_STR:
                return(new SgetAttributDefinition(new Guid("{a65a6538-96d1-4525-b0f2-5059dfa38e0e}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "SERIAL", UicDataType.String, String.Empty));

            case BoardInformationStringId.EAPI_ID_BOARD_BIOS_REVISION_STR:
                return(new SgetAttributDefinition(new Guid("{ffd2c0a2-c3be-43b6-8fbf-3a3bd962356c}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "BIOS_REVISION", UicDataType.String, String.Empty));

            case BoardInformationStringId.EAPI_ID_BOARD_HW_REVISION_STR:
                return(new SgetAttributDefinition(new Guid("{edb7802a-5e66-4b24-8e6e-4e2876b772f1}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "HW_REVISION", UicDataType.String, String.Empty));

            case BoardInformationStringId.EAPI_ID_BOARD_PLATFORM_TYPE_STR:
                return(new SgetAttributDefinition(new Guid("{ec7a1668-353f-471b-a3fe-32ce072701c8}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "PLATFORM_TYPE", UicDataType.String, String.Empty));

            default:
                throw new ArgumentOutOfRangeException(nameof(item), item, null);
            }
        }
        internal string GetBoardInformationOf(BoardInformationStringId boardInformationStringId)
        {
            uint bufferLength = 5000;
            var  buffer       = new StringBuilder((int)bufferLength);

            uint resultCode = EApiBoardGetStringA((uint)boardInformationStringId, buffer, ref bufferLength);

            if (_eApiStatusCodes.IsUnsupported(resultCode))
            {
                throw new NotSupportedException(boardInformationStringId.ToString());
            }
            if (!_eApiStatusCodes.IsSuccess(resultCode))
            {
                throw new Exception(_eApiStatusCodes.GetStatusStringFrom(resultCode));
            }
            return(buffer.ToString());
        }
Exemplo n.º 3
0
 internal bool TryGet(Guid id, out BoardInformationStringId stringId)
 {
     return(_boardÍnfoStringDic.TryGetValue(id, out stringId));
 }