57 lines
1.6 KiB
C#

//----------------------------------------------------------------------------
//
// 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
{
/// <summary>
/// A class that represents the attributes of a CIM field
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class CimFieldAttribute : Attribute
{
private bool isKey;
private bool isRequired;
/// <summary>
/// Constructor
/// </summary>
/// <param name="IsKey">Specifies if the attribute is a key</param>
/// <param name="IsRequired">Specifies if the attribute is required</param>
public CimFieldAttribute(bool IsKey, bool IsRequired)
{
this.isKey = IsKey;
if (IsKey)
this.isRequired = true;
else
this.isRequired = IsRequired;
}
/// <summary>
/// True if the attribute is a key, false otherwise
/// </summary>
public bool IsKey
{
get { return isKey; }
}
/// <summary>
/// True if the attribute is required, false otherwise
/// </summary>
public bool IsRequired
{
get { return isRequired; }
}
}
}