Ejemplo n.º 1
0
        public MetaDatas GetMetaData()
        {
            //Retrieve document class metadata
            MetaDatas metas = null;

            try {
                metas = new MetaDatas();
                System.Xml.XmlDataDocument xmlMeta = new System.Xml.XmlDataDocument();
                xmlMeta.DataSet.ReadXml(System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "\\App_Data\\metadata.xml");
                for (int i = 0; i < xmlMeta.DataSet.Tables["MetaDataTable"].Rows.Count; i++)
                {
                    MetaData md = new MetaData(xmlMeta.DataSet.Tables["MetaDataTable"].Rows[i]["ClassName"].ToString(), xmlMeta.DataSet.Tables["MetaDataTable"].Rows[i]["Property"].ToString());
                    metas.Add(md);
                }
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error in GetMetaData().", ex); }
            return(metas);
        }
Ejemplo n.º 2
0
        public MetaDatas GetMetaData(string className)
        {
            //Retrieve document class metadata for the specified className
            MetaDatas metas = null;

            try {
                metas = new MetaDatas();
                MetaDatas _metas = GetMetaData();
                foreach (MetaData md in _metas)
                {
                    if (md.ClassName == className)
                    {
                        metas.Add(md);
                    }
                }
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected error in GetMetaData(string).", ex); }
            return(metas);
        }