コード例 #1
0
ファイル: Parameters.cs プロジェクト: NiWeiNi/BIMiconToolbar
        /// <summary>
        /// Method to check if Instance Binding is of a specific category
        /// </summary>
        /// <param name="insBinding"></param>
        /// <param name="category"></param>
        /// <returns></returns>
        public static bool IsInstBindingOfCategory(InstanceBinding insBinding, string categoryName)
        {
            CategorySet         catSet   = insBinding.Categories;
            CategorySetIterator catSetIt = catSet.ForwardIterator();

            catSetIt.Reset();

            string cat = "";

            while (catSetIt.MoveNext())
            {
                Category category1 = catSetIt.Current as Category;
                cat = category1.Name;
            }

            if (cat != "" && cat == categoryName)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }