コード例 #1
0
        private void Add(String controlType, Point position)
        {
            NewBaseControl control = ControlFactory.GetInstance().CreateControl(controlType, position);

            ControlList.Insert(Config.ElementNodeStartNum - 1, control);

            NodeBase   node         = NodeFactory.GetInstance().CreateNode(control);
            XmlElement beInsertNode = node.Create(mDoc);

            XmlNode parentNode   = mDoc.SelectSingleNode("//Page[@Num=1]");
            XmlNode previousNode = mDoc.SelectSingleNode("//element[@Num=" + (Config.ElementNodeStartNum - 1) + "]");

            parentNode.InsertAfter(beInsertNode, previousNode);

            Config.ElementNodeStartNum++;
        }
コード例 #2
0
        private void CreateDefaultTemplate()
        {
            NodeBase DefaultNode = new NodeBase();

            DefaultNode.Name = "PdfTemplateConfiguration";
            DefaultNode.Attrs.Add("version", "1.0");
            DefaultNode.ChildNodes.Add(new NodePageFormat());
            DefaultNode.ChildNodes.Add(new NodeBase()
            {
                Name  = "ReportContent",
                Attrs = new Dictionary <string, object> {
                    { "pageNum", Properties.Resources.DefaultPageCount }
                },
                ChildNodes = new List <NodeBase> {
                    new NodeFormat(), new NodePage()
                }
            });

            mDoc.AppendChild(mDoc.CreateXmlDeclaration("1.0", "utf-8", ""));
            mDoc.AppendChild(DefaultNode.Create(mDoc));

            Analysis();
        }