// Copyright (c) 2010-2011 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
namespace SharpDX.MediaFoundation
{
///
/// Associate an attribute key with a type used to retrieve keys from a instance.
///
public class MediaAttributeKey
{
///
/// Initializes a new instance of the struct.
///
/// The attribute GUID.
/// The attribute type.
public MediaAttributeKey(Guid guid, Type type)
: this(guid, type, string.Empty)
{
}
///
/// Initializes a new instance of the struct.
///
/// The attribute GUID.
/// The attribute type.
/// The attribute name, useful for debugging.
public MediaAttributeKey(Guid guid, Type type, string name)
{
Guid = guid;
Type = type;
Name = name;
}
///
/// Gets the attribute GUID.
///
///
/// The attribute GUID.
///
public Guid Guid { get; private set; }
///
/// Gets the attribute type.
///
///
/// The attribute type.
///
public Type Type { get; private set; }
///
/// Gets the attribute name.
///
public string Name { get; private set; }
}
///
/// Generic version of .
///
/// Type of the value of this key.
public class MediaAttributeKey : MediaAttributeKey
{
///
/// Initializes a new instance of the class.
///
/// The attribute GUID.
public MediaAttributeKey(string guid)
: this(guid, string.Empty)
{
}
///
/// Initializes a new instance of the class.
///
/// The GUID.
/// The attribute name, useful for debugging.
public MediaAttributeKey(string guid, string name)
: this(new Guid(guid), name)
{
}
///
/// Initializes a new instance of the class.
///
/// The GUID.
public MediaAttributeKey(Guid guid)
: this(guid, string.Empty)
{
}
///
/// Initializes a new instance of the class.
///
/// The GUID.
/// /// The attribute name, useful for debugging.
public MediaAttributeKey(Guid guid, string name)
: base(guid, typeof(T), name)
{
}
}
}