// // (C) Copyright 2003-2008 by Autodesk, Inc. // // Permission to use, copy, modify, and distribute this software in // object code form for any purpose and without fee is hereby granted, // provided that the above copyright notice appears in all copies and // that both that copyright notice and the limited warranty and // restricted rights notice below appear in all supporting // documentation. // // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE // UNINTERRUPTED OR ERROR FREE. // // Use, duplication, or disclosure by the U.S. Government is subject to // restrictions set forth in FAR 52.227-19 (Commercial Computer // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) // (Rights in Technical Data and Computer Software), as applicable. // using System; using Autodesk.Revit.Enums; using Autodesk.Revit.Parameters; using Autodesk.Revit; using System.Collections.Generic; namespace Revit.SDK.Samples.RDBLink.CS { /// /// Contains custom parameter information, used to create a new custom parameter /// public class ParameterInfo { #region Fields /// /// Whether the parameter is a project parameter or shared parameter /// bool m_parameterIsProject; /// /// Whether the parameter is binded to type or instance /// bool m_parameterForType; /// /// Parameter name /// string m_parameterName; /// /// Parameter group /// BuiltInParameterGroup m_parameterGroup; /// /// Parameter type /// ParameterType m_parameterType; /// /// Parameter categories binded /// CategorySet m_categories; #endregion #region Properties /// /// Gets or sets whether the parameter is a project parameter or shared parameter /// public bool ParameterIsProject { get { return m_parameterIsProject; } set { m_parameterIsProject = value; } } /// /// Gets or sets whether the parameter is binded to type or instance /// public bool ParameterForType { get { return m_parameterForType; } set { m_parameterForType = value; } } /// /// Gets or sets the parameter name /// public string ParameterName { get { return m_parameterName; } set { m_parameterName = value; } } /// /// Gets or sets the parameter group /// public BuiltInParameterGroup ParameterGroup { get { return m_parameterGroup; } set { m_parameterGroup = value; } } /// /// Gets or sets the parameter type /// public ParameterType ParameterType { get { return m_parameterType; } set { m_parameterType = value; } } /// /// Gets or sets the parameter categories binded /// public CategorySet Categories { get { return m_categories; } set { m_categories = value; } } #endregion #region Constructors /// /// Initialize variables /// public ParameterInfo() { m_parameterGroup = BuiltInParameterGroup.INVALID; m_parameterType = ParameterType.Text; } /// /// Initialize variables /// /// Definition /// ElementBinding public ParameterInfo(Definition definition, ElementBinding binding) { m_parameterIsProject = definition is ExternalDefinition; m_parameterForType = binding is TypeBinding; m_parameterName = definition.Name; m_parameterGroup = definition.ParameterGroup; m_parameterType = definition.ParameterType; m_categories = binding.Categories; } #endregion }; }