コード例 #1
0
ファイル: CommonUtil.cs プロジェクト: chenchunwei/NPC
        /// <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());
        }
コード例 #2
0
ファイル: NpcMmsSendService.cs プロジェクト: chenchunwei/NPC
 private LayoutInfo GetLayoutInfo(LayoutType layoutType, string imageRegionName, string textRegionName)
 {
     var layout = new LayoutInfo();
     layout.Rootlayout = new RootlayoutInfo("128", "128", string.Empty);
     if (layoutType == LayoutType.PicBottom)
     {
         var text = new RegionInfo { Id = textRegionName, Left = "0", Top = "70%", Height = "30%", Width = "128", Fit = FitType.Scroll };
         var image = new RegionInfo { Id = imageRegionName, Left = "0", Top = "0", Height = "70%", Width = "128", Fit = FitType.Meet };
         layout.RegionList.Add(text);
         layout.RegionList.Add(image);
     }
     else
     {
         var image = new RegionInfo { Id = imageRegionName, Left = "0", Top = "30%", Height = "70%", Width = "128", Fit = FitType.Meet };
         var text = new RegionInfo { Id = textRegionName, Left = "0", Top = "0", Height = "30%", Width = "128", Fit = FitType.Scroll };
         layout.RegionList.Add(image);
         layout.RegionList.Add(text);
     }
     return layout;
 }
コード例 #3
0
ファイル: OmsXmsData.cs プロジェクト: chenchunwei/NPC
        ///<summary>
        ///</summary>
        ///<param name="node"></param>
        ///<param name="nmManager"></param>
        ///<param name="prefix"></param>
        internal HeadInfo(XmlNode node, XmlNamespaceManager nmManager, string prefix)
        {
            XmlNode childNode = node.SelectSingleNode(string.Format(CultureInfo.CurrentCulture, "//{0}:meta", prefix), nmManager);
            if (childNode != null)
                Meta = new MetaInfo(childNode);

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