Example #1
0
        /// <summary>
        /// 生成smil文件
        /// </summary>
        /// <param name="layout">smil的布局信息</param>
        /// <param name="parInfoList">资料列表</param>
        /// <returns></returns>
        public static string BuilderSmil(LayoutInfo layout, IList<ParInfo> parInfoList)
        {
            var smilHead = new HeadInfo();
            smilHead.Layout = layout;

            var smilBody = new BodyInfo();
            foreach (var parInfo in parInfoList)
            {
                smilBody.ParList.Add(parInfo);
            }

            var s = new StringWriter(new StringBuilder(), CultureInfo.CurrentCulture);
            var x = new XmlTextWriter(s);

            x.WriteStartDocument();
            x.WriteStartElement("smil");

            smilHead.WriteXml(x);
            smilBody.WriteXml(x);

            x.WriteEndElement();
            x.WriteEndDocument();

            return FormatXml(s.GetStringBuilder().ToString());
        }
Example #2
0
        ///<summary>
        ///</summary>
        ///<param name="node"></param>
        ///<param name="nmManager"></param>
        ///<param name="prefix"></param>
        internal MmsSlidesInfo(XmlNode node, XmlNamespaceManager nmManager, string prefix)
        {
            XmlNode childNode = node.SelectSingleNode(string.Format(CultureInfo.CurrentCulture, "//{0}:head", prefix), nmManager);
            if (childNode != null)
                Head = new HeadInfo(childNode, nmManager, prefix);

            childNode = node.SelectSingleNode(string.Format(CultureInfo.CurrentCulture, "//{0}:body", prefix), nmManager);
            if (childNode != null)
                Body = new BodyInfo(childNode, nmManager, prefix);
        }