//----------------------------------------------------------------------------
//
// Copyright (c) Intel Corporation, 2008 - 2009 All Rights Reserved.
//
// File: CimFieldAttribute.cs
//
// Contents: CimFieldAttribute is a part of the CimFramework project.
// It contains the implementation of a Cim attribute class.
//
//----------------------------------------------------------------------------
using System;
namespace Intel.Manageability.Cim.Typed
{
///
/// A class that represents the attributes of a CIM field
///
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class CimFieldAttribute : Attribute
{
private bool isKey;
private bool isRequired;
///
/// Constructor
///
/// Specifies if the attribute is a key
/// Specifies if the attribute is required
public CimFieldAttribute(bool IsKey, bool IsRequired)
{
this.isKey = IsKey;
if (IsKey)
this.isRequired = true;
else
this.isRequired = IsRequired;
}
///
/// True if the attribute is a key, false otherwise
///
public bool IsKey
{
get { return isKey; }
}
///
/// True if the attribute is required, false otherwise
///
public bool IsRequired
{
get { return isRequired; }
}
}
}