using System;
using System.ComponentModel;
using Autodesk.Revit.DB;
namespace Revit.SDK.Samples.ProjectInfo.CS
{
///
/// Wrapper class for Construction
///
[TypeConverter(typeof(ConstructionWrapperConverter))]
public class ConstructionWrapper : IComparable, IWrapper
{
#region Fields
///
/// Construction
///
private Construction m_construction;
#endregion
#region Constructors
///
/// Initializes private variables.
///
/// Construction
public ConstructionWrapper(Construction construction)
{
m_construction = construction;
}
#endregion
#region Properties
#region IComparable Members
///
/// Compares the names of Constructions.
///
/// ConstructionWrapper used to compare
/// A 32-bit signed integer that indicates the relative order of the objects
/// being compared. The return value has these meanings:
/// Value Condition Less than zero This instance is less than value.
/// Zero This instance is equal to value. Greater than zero This instance is
/// greater than value.-or- value is null.
public int CompareTo(object obj)
{
ConstructionWrapper wrapper = obj as ConstructionWrapper;
if (wrapper != null)
{
return this.Name.CompareTo(wrapper.Name);
}
return 1;
}
#endregion
#region IWrapper Members
///
/// Gets the handle object.
///
[Browsable(false)]
public object Handle
{
get { return m_construction; }
}
///
/// Gets the name of the handle.
///
[Browsable(false)]
public String Name
{
get
{
return m_construction.Name;
}
}
#endregion
#endregion
}
}