Esempio n. 1
0
        /// <summary>
        /// Gets the list.
        /// </summary>
        /// <param name="ListInherited">if set to <c>true</c> [list inherited].</param>
        /// <returns></returns>
        public static MetaClassCollection GetList(bool listInherited)
        {
            MetaClassCollection retVal = new MetaClassCollection();

            using (SqlDataReader reader = (SqlDataReader)GetDataReader())
            {
                while (reader.Read())
                {
                    MetaClass newItem = MetaClass.Load(null, reader);

                    if (listInherited || newItem.Parent == null)
                        retVal.Add(newItem);
                }
                reader.Close();
            }

            return retVal;
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the list.
        /// </summary>
        /// <param name="Namespace">The namespace.</param>
        /// <param name="bDeep">if set to <c>true</c> [b deep].</param>
        /// <returns></returns>
        public static MetaClassCollection GetList(string metaNamespace, bool deep)
        {
            #region ArgumentNullExceptions
            if (metaNamespace == null)
                throw new ArgumentNullException("Namespace", AsyncResources.GetConstantValue("ARG_NULL_ERR_MSG"));
            #endregion

            MetaClassCollection retVal = new MetaClassCollection();

            using (SqlDataReader reader = SqlHelper.ExecuteReader(MetaDataContext.Current, CommandType.StoredProcedure, AsyncResources.GetConstantValue("SP_LoadMetaClassByNamespace"),
                      new SqlParameter("@Namespace", metaNamespace),
                      new SqlParameter("@Deep", deep)))
            {
                while (reader.Read())
                {
                    //MetaClass tmpValue = new MetaClass();

                    retVal.Add(MetaClass.Load(null, reader));
                }
                reader.Close();
            }

            return retVal;
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the child list.
        /// </summary>
        /// <param name="parentMetaClass">The parent meta class.</param>
        /// <returns></returns>
        internal static MetaClassCollection GetChildList(MetaClass parentMetaClass)
        {
            #region ArgumentNullExceptions
            if (parentMetaClass == null)
                throw new ArgumentNullException("parentMetaClass", AsyncResources.GetConstantValue("ARG_NULL_ERR_MSG"));
            #endregion

            MetaClassCollection retVal = new MetaClassCollection();

            using (SqlDataReader reader = SqlHelper.ExecuteReader(MetaDataContext.Current, CommandType.StoredProcedure, AsyncResources.GetConstantValue("SP_LoadChildMetaClassList"),
                      new SqlParameter("@MetaClassId", parentMetaClass.Id)))
            {
                while (reader.Read())
                {
                    MetaClass newClass = MetaClass.Load(parentMetaClass, reader);
                    retVal.Add(newClass);
                }
                reader.Close();
            }

            return retVal;
        }