Example #1
0
        private void WriteValue()
        {
            switch (_value.Format)
            {
            case ElementFormat.Boolean:
                _storage.SetBinary(_obj, _identifier, ((BooleanElementValue)_value).GetBytes());
                break;

            case ElementFormat.Device:
                _storage.SetBinary(_obj, _identifier, ((DeviceElementValue)_value).GetBytes());
                break;

            case ElementFormat.GuidList:
                _storage.SetMultiString(_obj, _identifier, ((GuidListElementValue)_value).GetGuidStrings());
                break;

            case ElementFormat.Integer:
                _storage.SetBinary(_obj, _identifier, ((IntegerElementValue)_value).GetBytes());
                break;

            case ElementFormat.IntegerList:
                _storage.SetBinary(_obj, _identifier, ((IntegerListElementValue)_value).GetBytes());
                break;

            case ElementFormat.Guid:
            case ElementFormat.String:
                _storage.SetString(_obj, _identifier, _value.ToString());
                break;

            default:
                throw new NotImplementedException("Unknown element format: " + Format);
            }
        }