Summary description for Footer
Exemplo n.º 1
0
        private void ApplyFooter(FooterPart footerPart)
        {
            var footer1 = new Footer();
            footer1.AddNamespaceDeclaration("ve", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            footer1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
            footer1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            footer1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
            footer1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
            footer1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
            footer1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
            footer1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            footer1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");

            var paragraph1 = new Paragraph { RsidParagraphAddition = "005641D2", RsidRunAdditionDefault = "005641D2" };

            var paragraphProperties1 = new ParagraphProperties();
            var paragraphStyleId1 = new ParagraphStyleId { Val = "Footer" };

            paragraphProperties1.Append(paragraphStyleId1);

            var run1 = new Run();
            var text1 = new Text();
            text1.Text = "Generated with Pickles " + Assembly.GetExecutingAssembly().GetName().Version;

            run1.Append(text1);

            paragraph1.Append(paragraphProperties1);
            paragraph1.Append(run1);

            footer1.Append(paragraph1);

            footerPart.Footer = footer1;
        }
        //--
        protected void Page_Load(object sender, EventArgs e)
        {
            intSite = Convert.ToInt32(HttpContext.Current.Session["SiteId"].ToString());
            intCont = Convert.ToInt32(HttpContext.Current.Session["ContentId"].ToString());

            Footer footer = new Footer();
            DataSet dsContact = new DataSet();
            DataSet dsSite = new DataSet();
            dsContact = footer.GetAllSiteContact();
            dsSite = footer.GetSiteInformation();
            foreach (DataTable table in dsContact.Tables)
            {
                foreach (DataRow row in table.Rows)
                {
                    SiteContTitle       = row["SiteContTitle"].ToString();
                    SiteContAddress     = row["SiteContAddress"].ToString();
                    SiteContEmailCus    = row["SiteContEmailCus"].ToString();
                    SiteContEmailSal    = row["SiteContEmailSal"].ToString();

                }
            }
             foreach (DataTable table in dsSite.Tables)
            {
                foreach (DataRow row in table.Rows)
                {
                    SiteConPhone = row["sitephone"].ToString();
                    SiteCopy = row["sitecopy"].ToString();
                    SiteURL = row["siteurl"].ToString();
                    SiteTagLine = row["sitetagline"].ToString();
                }
            }
            LoadContact();
        }
		public FooterMasterContentView(ExtendedMap extendedMap, UIHelper uiHelper, Footer footer)
		{
			_extendedMap = extendedMap;
			_uiHelper = uiHelper;
			_footer = footer;

						BindingContext = new FooterMasterViewModel(extendedMap) ;
//			BindingContext = extendedMap ;
//			Content = CreateFooter ();
			InitializeComponent ();
		}
Exemplo n.º 4
0
    public void Init(Footer _footer, string url, int _id, bool local)
    {
        if (!local && loadingAsset) loadingAsset.SetActive(true);
        else if (loadingAsset) loadingAsset.SetActive(false);

        if (local)
            RealLoadLocalImage (url);
        else
            StartCoroutine (RealLoadImage (url));

        footer = _footer;
        id=_id;
        /*GetComponent<Button>().OnClick.AddListener(() =>
        {
            print("aca");
            OnSelected(footer, id);
        });*/
    }
    //--------------------------------------------------------------------------------------
    protected void LoadResourceCenter()
    {
        Footer footer = new Footer();
        DataSet dsResource = new DataSet();
        StringBuilder sb = new StringBuilder();
        dsResource = footer.Get_LeftMenu_All_ResourceCenter();
        foreach (DataTable table in dsResource.Tables)
        {
            foreach (DataRow row in table.Rows)
            {
                sb.AppendLine("<li><a href=\"" + row["tempsitepage"].ToString() + "?id=" + row["geneid"].ToString() + "\">" + row["genetitle"].ToString() + "</a></li>");
            }
        }

        PlaceHolder_ResourceCenter.Controls.Add(new LiteralControl(sb.ToString()));
        dsResource = null;
        sb = null;
    }
    protected void LoadAboutUs()
    {
        Footer footer = new Footer();
        DataSet dsAboutUs = new DataSet();
        StringBuilder sb = new StringBuilder();
        dsAboutUs = footer.Get_LeftMenu_All_AboutUs();
        foreach (DataTable table in dsAboutUs.Tables)
        {
            foreach (DataRow row in table.Rows)
            {
                sb.AppendLine("<li><a href=\"AboutUs.aspx?id=" + row["geneid"].ToString() + "\">" + row["genetitle"].ToString() + "</a>");
                sb.AppendLine("</li>");
            }
        }

        PlaceHolder_AboutUs.Controls.Add(new LiteralControl(sb.ToString()));
        dsAboutUs = null;
        sb = null;
    }
Exemplo n.º 7
0
        /// <summary>
        /// Initiates the build process.
        /// </summary>
        /// <param name="baseName">The base name for the VMDK, for example 'foo' to create 'foo.vhd'.</param>
        /// <returns>A set of one or more logical files that constitute the VHD.  The first file is
        /// the 'primary' file that is normally attached to VMs.</returns>
        public override DiskImageFileSpecification[] Build(string baseName)
        {
            if (string.IsNullOrEmpty(baseName))
            {
                throw new ArgumentException("Invalid base file name", "baseName");
            }

            if (Content == null)
            {
                throw new InvalidOperationException("No content stream specified");
            }

            List<DiskImageFileSpecification> fileSpecs = new List<DiskImageFileSpecification>();

            Geometry geometry = Geometry ?? Geometry.FromCapacity(Content.Length);

            Footer footer = new Footer(geometry, Content.Length, DiskType);

            if (_diskType == FileType.Fixed)
            {
                footer.UpdateChecksum();

                byte[] footerSector = new byte[Sizes.Sector];
                footer.ToBytes(footerSector, 0);

                SparseStream footerStream = SparseStream.FromStream(new MemoryStream(footerSector, false), Ownership.None);
                Stream imageStream = new ConcatStream(Ownership.None, Content, footerStream);
                fileSpecs.Add(new DiskImageFileSpecification(baseName + ".vhd", new PassthroughStreamBuilder(imageStream)));
            }
            else if (_diskType == FileType.Dynamic)
            {
                fileSpecs.Add(new DiskImageFileSpecification(baseName + ".vhd",  new DynamicDiskBuilder(Content, footer, (uint)Sizes.OneMiB * 2)));
            }
            else
            {
                throw new InvalidOperationException("Only Fixed and Dynamic disk types supported");
            }

            return fileSpecs.ToArray();
        }
Exemplo n.º 8
0
        /// <summary>
        /// 
        /// </summary>
        public override void Dispose()
        {
            // write footer as well
            using (var mp = new DivContainer(m_stream, "", "container"))
            {
                HR();
                using (var f = new Footer(m_stream))
                {
                    f.Out("Copyright 2015 Wildbunny Ltd | ");
                    Href(m_stream, "Support", HtmlAttributes.href, "https://bitsharestalk.org/index.php?topic=12317.0");
                    f.Out(" | ");
                    Href(m_stream, "Github", HtmlAttributes.href, "https://github.com/wildbunny/metaexchange");
                    f.Out(" | Please vote for ");
                    Href(m_stream, "dev-metaexchange.monsterer", HtmlAttributes.href, "bts:dev-metaexchange.monsterer/approve");
                }
            }

            // end body
            m_stream.WriteLine("</body>");

            base.Dispose();
        }
        //static void Main(string[] args)
        //{
        //    //CreateWordDoc("C:/Users/Trevor/Documents/test.docx", "This is Text, ya ya ya.");
        //    // AddSignatureFooter("C:/Users/Trevor/Documents/test.docx", "-by Nelson Mandela");

        //    //Test statistics
        //    Console.Write(BasicStats("C:/Users/Trevor/Documents/testGAO.docx"));
        //    Console.ReadLine();
        //}

        //Add footer with string signature to existing document
        public static void AddSignatureFooter(string filepath, string signature)
        {
            using (WordprocessingDocument doc = WordprocessingDocument.Open(filepath, true))
            {
                MainDocumentPart mainDocPart = doc.MainDocumentPart;

                if (mainDocPart.Document == null)
                {
                    mainDocPart.Document = new Document();
                }

                mainDocPart.DeleteParts(mainDocPart.FooterParts);
                FooterPart footerPart1 = mainDocPart.AddNewPart<FooterPart>("r98");

                Footer footer1 = new Footer();

                Paragraph paragraph1 = new Paragraph();

                Run run1 = new Run();
                Text text1 = new Text { Text = signature };

                run1.Append(text1);
                paragraph1.Append(run1);

                footer1.Append(paragraph1);
                footerPart1.Footer = footer1;

                SectionProperties sectionProperties1 = mainDocPart.Document.Body.Descendants<SectionProperties>().FirstOrDefault();
                if (sectionProperties1 == null)
                {
                    sectionProperties1 = new SectionProperties();
                    mainDocPart.Document.Body.Append(sectionProperties1);
                }
                FooterReference footerReference1 = new FooterReference { Type = HeaderFooterValues.Default, Id = "r98" };

                sectionProperties1.InsertAt(footerReference1, 0);
            }
        }
        private static void GenerateFooterPartContent(FooterPart part)
        {
            var footer1 = new Footer() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 wp14" } };

            var paragraph1 = new Paragraph() { RsidParagraphAddition = "00164C17", RsidRunAdditionDefault = "00164C17" };

            var paragraphProperties1 = new ParagraphProperties();
            var paragraphStyleId1 = new ParagraphStyleId() { Val = "Footer" };

            paragraphProperties1.Append(paragraphStyleId1);

            var run1 = new Run();
            var text1 = new Text { Text = "Footer" };

            run1.Append(text1);

            paragraph1.Append(paragraphProperties1);
            paragraph1.Append(run1);

            footer1.Append(paragraph1);

            part.Footer = footer1;
        }
Exemplo n.º 11
0
        public Model(BinaryReader binReader)
        {
            Id = "model";
            _index = new List<Index>();
            _indexMap = new List<Table>();
            _geometry = new List<Geometry>();

            type = binReader.ReadInt32();
            minorVersion = binReader.ReadInt32();
            majorVersion = binReader.ReadInt32();

            fileStructure = new Table[binReader.ReadInt32()];
            FileTools.BinaryToArray<Table>(binReader, fileStructure);

            foreach (Table structure in fileStructure)
            {
                switch (structure.id)
                {
                    case (uint)Structure.UnitIndex:
                        _index.Add(GetIndex(binReader));
                        break;
                    case (uint)Structure.Geometry:
                        _geometry.Add(GetGeometry(binReader));
                        break;
                    case (uint)Structure.Reserved:// skip this for now
                        binReader.ReadBytes((int)structure.size); 
                        //reserved = GetReserved(binReader);
                        break;
                    case (uint)Structure.Footer:
                        _footer = GetFooter(binReader);
                        break;
                }
            }
            binReader.ReadBytes(8); // this should bring to EOF
            binReader.Close();
        }
Exemplo n.º 12
0
 public DynamicDiskBuilder(SparseStream content, Footer footer, uint blockSize)
 {
     _content = content;
     _footer = footer;
     _blockSize = blockSize;
 }
Exemplo n.º 13
0
 internal DiskImageFileInfo(Footer footer, DynamicHeader header, Stream vhdStream)
 {
     _footer = footer;
     _header = header;
     _vhdStream = vhdStream;
 }
Exemplo n.º 14
0
        // Generates content of footerPart2.
        private void GenerateFooterPart2Content(FooterPart footerPart2)
        {
            Footer footer2 = new Footer() {MCAttributes = new MarkupCompatibilityAttributes() {Ignorable = "w14 wp14"}};
            footer2.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
            footer2.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            footer2.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
            footer2.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            footer2.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
            footer2.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
            footer2.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
            footer2.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
            footer2.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
            footer2.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            footer2.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            footer2.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
            footer2.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
            footer2.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
            footer2.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");

            SdtBlock sdtBlock1 = new SdtBlock();

            SdtProperties sdtProperties1 = new SdtProperties();
            SdtId sdtId1 = new SdtId() {Val = -1382393284};

            SdtContentDocPartObject sdtContentDocPartObject1 = new SdtContentDocPartObject();
            DocPartGallery docPartGallery1 = new DocPartGallery() {Val = "Page Numbers (Bottom of Page)"};
            DocPartUnique docPartUnique1 = new DocPartUnique();

            sdtContentDocPartObject1.Append(docPartGallery1);
            sdtContentDocPartObject1.Append(docPartUnique1);

            sdtProperties1.Append(sdtId1);
            sdtProperties1.Append(sdtContentDocPartObject1);
            SdtEndCharProperties sdtEndCharProperties1 = new SdtEndCharProperties();

            SdtContentBlock sdtContentBlock1 = new SdtContentBlock();

            SdtBlock sdtBlock2 = new SdtBlock();

            SdtProperties sdtProperties2 = new SdtProperties();
            SdtId sdtId2 = new SdtId() {Val = 98381352};

            SdtContentDocPartObject sdtContentDocPartObject2 = new SdtContentDocPartObject();
            DocPartGallery docPartGallery2 = new DocPartGallery() {Val = "Page Numbers (Top of Page)"};
            DocPartUnique docPartUnique2 = new DocPartUnique();

            sdtContentDocPartObject2.Append(docPartGallery2);
            sdtContentDocPartObject2.Append(docPartUnique2);

            sdtProperties2.Append(sdtId2);
            sdtProperties2.Append(sdtContentDocPartObject2);
            SdtEndCharProperties sdtEndCharProperties2 = new SdtEndCharProperties();

            SdtContentBlock sdtContentBlock2 = new SdtContentBlock();

            Paragraph paragraph28 = new Paragraph() {RsidParagraphAddition = "0005059E", RsidRunAdditionDefault = "0005059E"};

            ParagraphProperties paragraphProperties9 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId3 = new ParagraphStyleId() {Val = "Footer"};

            paragraphProperties9.Append(paragraphStyleId3);

            Run run44 = new Run();
            Text text29 = new Text() {Space = SpaceProcessingModeValues.Preserve};
            text29.Text = "Page ";

            run44.Append(text29);

            Run run45 = new Run();

            RunProperties runProperties23 = new RunProperties();
            Bold bold16 = new Bold();
            BoldComplexScript boldComplexScript16 = new BoldComplexScript();
            FontSize fontSize15 = new FontSize() {Val = "24"};
            FontSizeComplexScript fontSizeComplexScript15 = new FontSizeComplexScript() {Val = "24"};

            runProperties23.Append(bold16);
            runProperties23.Append(boldComplexScript16);
            runProperties23.Append(fontSize15);
            runProperties23.Append(fontSizeComplexScript15);
            FieldChar fieldChar7 = new FieldChar() {FieldCharType = FieldCharValues.Begin};

            run45.Append(runProperties23);
            run45.Append(fieldChar7);

            Run run46 = new Run();

            RunProperties runProperties24 = new RunProperties();
            Bold bold17 = new Bold();
            BoldComplexScript boldComplexScript17 = new BoldComplexScript();

            runProperties24.Append(bold17);
            runProperties24.Append(boldComplexScript17);
            FieldCode fieldCode3 = new FieldCode() {Space = SpaceProcessingModeValues.Preserve};
            fieldCode3.Text = " PAGE ";

            run46.Append(runProperties24);
            run46.Append(fieldCode3);

            Run run47 = new Run();

            RunProperties runProperties25 = new RunProperties();
            Bold bold18 = new Bold();
            BoldComplexScript boldComplexScript18 = new BoldComplexScript();
            FontSize fontSize16 = new FontSize() {Val = "24"};
            FontSizeComplexScript fontSizeComplexScript16 = new FontSizeComplexScript() {Val = "24"};

            runProperties25.Append(bold18);
            runProperties25.Append(boldComplexScript18);
            runProperties25.Append(fontSize16);
            runProperties25.Append(fontSizeComplexScript16);
            FieldChar fieldChar8 = new FieldChar() {FieldCharType = FieldCharValues.Separate};

            run47.Append(runProperties25);
            run47.Append(fieldChar8);

            Run run48 = new Run() {RsidRunAddition = "00FB1F22"};

            RunProperties runProperties26 = new RunProperties();
            Bold bold19 = new Bold();
            BoldComplexScript boldComplexScript19 = new BoldComplexScript();
            NoProof noProof23 = new NoProof();

            runProperties26.Append(bold19);
            runProperties26.Append(boldComplexScript19);
            runProperties26.Append(noProof23);
            Text text30 = new Text();
            text30.Text = "2";

            run48.Append(runProperties26);
            run48.Append(text30);

            Run run49 = new Run();

            RunProperties runProperties27 = new RunProperties();
            Bold bold20 = new Bold();
            BoldComplexScript boldComplexScript20 = new BoldComplexScript();
            FontSize fontSize17 = new FontSize() {Val = "24"};
            FontSizeComplexScript fontSizeComplexScript17 = new FontSizeComplexScript() {Val = "24"};

            runProperties27.Append(bold20);
            runProperties27.Append(boldComplexScript20);
            runProperties27.Append(fontSize17);
            runProperties27.Append(fontSizeComplexScript17);
            FieldChar fieldChar9 = new FieldChar() {FieldCharType = FieldCharValues.End};

            run49.Append(runProperties27);
            run49.Append(fieldChar9);

            Run run50 = new Run();
            Text text31 = new Text() {Space = SpaceProcessingModeValues.Preserve};
            text31.Text = " of ";

            run50.Append(text31);

            Run run51 = new Run();

            RunProperties runProperties28 = new RunProperties();
            Bold bold21 = new Bold();
            BoldComplexScript boldComplexScript21 = new BoldComplexScript();
            FontSize fontSize18 = new FontSize() {Val = "24"};
            FontSizeComplexScript fontSizeComplexScript18 = new FontSizeComplexScript() {Val = "24"};

            runProperties28.Append(bold21);
            runProperties28.Append(boldComplexScript21);
            runProperties28.Append(fontSize18);
            runProperties28.Append(fontSizeComplexScript18);
            FieldChar fieldChar10 = new FieldChar() {FieldCharType = FieldCharValues.Begin};

            run51.Append(runProperties28);
            run51.Append(fieldChar10);

            Run run52 = new Run();

            RunProperties runProperties29 = new RunProperties();
            Bold bold22 = new Bold();
            BoldComplexScript boldComplexScript22 = new BoldComplexScript();

            runProperties29.Append(bold22);
            runProperties29.Append(boldComplexScript22);
            FieldCode fieldCode4 = new FieldCode() {Space = SpaceProcessingModeValues.Preserve};
            fieldCode4.Text = " NUMPAGES  ";

            run52.Append(runProperties29);
            run52.Append(fieldCode4);

            Run run53 = new Run();

            RunProperties runProperties30 = new RunProperties();
            Bold bold23 = new Bold();
            BoldComplexScript boldComplexScript23 = new BoldComplexScript();
            FontSize fontSize19 = new FontSize() {Val = "24"};
            FontSizeComplexScript fontSizeComplexScript19 = new FontSizeComplexScript() {Val = "24"};

            runProperties30.Append(bold23);
            runProperties30.Append(boldComplexScript23);
            runProperties30.Append(fontSize19);
            runProperties30.Append(fontSizeComplexScript19);
            FieldChar fieldChar11 = new FieldChar() {FieldCharType = FieldCharValues.Separate};

            run53.Append(runProperties30);
            run53.Append(fieldChar11);

            Run run54 = new Run() {RsidRunAddition = "00FB1F22"};

            RunProperties runProperties31 = new RunProperties();
            Bold bold24 = new Bold();
            BoldComplexScript boldComplexScript24 = new BoldComplexScript();
            NoProof noProof24 = new NoProof();

            runProperties31.Append(bold24);
            runProperties31.Append(boldComplexScript24);
            runProperties31.Append(noProof24);
            Text text32 = new Text();
            text32.Text = "37";

            run54.Append(runProperties31);
            run54.Append(text32);

            Run run55 = new Run();

            RunProperties runProperties32 = new RunProperties();
            Bold bold25 = new Bold();
            BoldComplexScript boldComplexScript25 = new BoldComplexScript();
            FontSize fontSize20 = new FontSize() {Val = "24"};
            FontSizeComplexScript fontSizeComplexScript20 = new FontSizeComplexScript() {Val = "24"};

            runProperties32.Append(bold25);
            runProperties32.Append(boldComplexScript25);
            runProperties32.Append(fontSize20);
            runProperties32.Append(fontSizeComplexScript20);
            FieldChar fieldChar12 = new FieldChar() {FieldCharType = FieldCharValues.End};

            run55.Append(runProperties32);
            run55.Append(fieldChar12);

            paragraph28.Append(paragraphProperties9);
            paragraph28.Append(run44);
            paragraph28.Append(run45);
            paragraph28.Append(run46);
            paragraph28.Append(run47);
            paragraph28.Append(run48);
            paragraph28.Append(run49);
            paragraph28.Append(run50);
            paragraph28.Append(run51);
            paragraph28.Append(run52);
            paragraph28.Append(run53);
            paragraph28.Append(run54);
            paragraph28.Append(run55);

            sdtContentBlock2.Append(paragraph28);

            sdtBlock2.Append(sdtProperties2);
            sdtBlock2.Append(sdtEndCharProperties2);
            sdtBlock2.Append(sdtContentBlock2);

            sdtContentBlock1.Append(sdtBlock2);

            sdtBlock1.Append(sdtProperties1);
            sdtBlock1.Append(sdtEndCharProperties1);
            sdtBlock1.Append(sdtContentBlock1);

            Paragraph paragraph29 = new Paragraph() {RsidParagraphAddition = "0005059E", RsidRunAdditionDefault = "0005059E"};

            ParagraphProperties paragraphProperties10 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId4 = new ParagraphStyleId() {Val = "Footer"};

            paragraphProperties10.Append(paragraphStyleId4);

            paragraph29.Append(paragraphProperties10);

            footer2.Append(sdtBlock1);
            footer2.Append(paragraph29);

            footerPart2.Footer = footer2;
        }
Exemplo n.º 15
0
 /// <summary>
 /// Add a PdfMake element the footer section
 /// </summary>
 /// <param name="pdfmakeObject"></param>
 public void AddFooter <T>(T pdfmakeObject)
 {
     Footer.Add(pdfmakeObject);
 }
Exemplo n.º 16
0
 public static string CreateFooter(MainDocumentPart mainPart, OpenXmlCompositeElement element)
 {
     FooterPart footerPart = mainPart.AddNewPart<FooterPart>();
     Footer footer = new Footer();
     AddHeaderFooterNamespaceDeclaration(footer);
     if (element != null)
         footer.AppendChild(element);
     footerPart.Footer = footer;
     return mainPart.GetIdOfPart(footerPart);
 }
Exemplo n.º 17
0
 /// <summary>
 /// Determines whether an element is in the <see cref="BlockStack{T}"/>
 /// </summary>
 /// <param name="item">
 /// The object to locate in the System.Collections.Generic.Stack`1. The value can
 /// be null for reference types.
 /// </param>
 /// <returns></returns>
 public bool Contains(T item) => Header.Contains(item) ? true : Elements.Contains(item) ? true : Footer.Contains(item) ? true & UseSeparator : Separator.Equals(item) ? true : false;
Exemplo n.º 18
0
 /// <summary>
 /// Adds a columns to the footer section
 /// </summary>
 /// <param name="Columns"></param>
 public void AddFooterColumns <T>(IPdfMakeColumns <T> Columns)
 {
     Footer.Add(Columns);
 }
Exemplo n.º 19
0
 /// <summary>
 /// Adds a table to the footer section
 /// </summary>
 /// <param name="pdfMakeTable"></param>
 public void AddFooterTable <T>(IPdfMakeTable <T> pdfMakeTable)
 {
     Footer.Add(pdfMakeTable);
 }
Exemplo n.º 20
0
 /// <summary>
 /// Adds a text to the footer section
 /// </summary>
 /// <param name="PdfMakeText"></param>
 public void AddFooterText(IPdfMakeText PdfMakeText)
 {
     Footer.Add(PdfMakeText);
 }
Exemplo n.º 21
0
 /// <summary>
 /// Add a IList of texts to the footer section
 /// </summary>
 /// <param name="PdfMakeTexts"></param>
 public void AddFooterText <T>(IPdfMakeTexts <T> PdfMakeTexts)
 {
     Footer.Add(PdfMakeTexts);
 }
Exemplo n.º 22
0
 /// <summary>
 /// Adds a IList of string to the footer section
 /// </summary>
 /// <param name="text"></param>
 public void AddFooterText(IEnumerable <string> texts)
 {
     Footer.Add(texts);
 }
Exemplo n.º 23
0
 /// <summary>
 /// Adds a string to the footer section
 /// </summary>
 /// <param name="text"></param>
 public void AddFooterText(string text)
 {
     Footer.Add(text);
 }
Exemplo n.º 24
0
 /// <summary>
 /// Adds a qr code to the footer section
 /// </summary>
 /// <param name="qRCode"></param>
 public void AddFooterQRCode(IPdfMakeQRCode qRCode)
 {
     Footer.Add(qRCode);
 }
        // Generates content of footerPart2.
        private void GenerateFooterPart2Content(FooterPart footerPart2)
        {
            Footer footer2 = new Footer();

            Paragraph paragraph42 = new Paragraph() { RsidParagraphAddition = "00F34666", RsidParagraphProperties = "00F34666", RsidRunAdditionDefault = "00740A1C" };

            ParagraphProperties paragraphProperties39 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId37 = new ParagraphStyleId() { Val = "FooterRankLegend" };

            Tabs tabs24 = new Tabs();
            TabStop tabStop24 = new TabStop() { Val = TabStopValues.Left, Position = 3315 };

            tabs24.Append(tabStop24);
            SpacingBetweenLines spacingBetweenLines49 = new SpacingBetweenLines() { After = "240" };

            paragraphProperties39.Append(paragraphStyleId37);
            paragraphProperties39.Append(tabs24);
            paragraphProperties39.Append(spacingBetweenLines49);

            Run run48 = new Run();

            RunProperties runProperties26 = new RunProperties();
            NoProof noProof13 = new NoProof();
            Languages languages32 = new Languages() { Val = "fr-CA", EastAsia = "fr-CA" };

            runProperties26.Append(noProof13);
            runProperties26.Append(languages32);

            Drawing drawing13 = new Drawing();

            Wp.Inline inline11 = new Wp.Inline() { DistanceFromTop = (UInt32Value)0U, DistanceFromBottom = (UInt32Value)0U, DistanceFromLeft = (UInt32Value)0U, DistanceFromRight = (UInt32Value)0U };
            Wp.Extent extent13 = new Wp.Extent() { Cx = 1447800L, Cy = 314325L };
            Wp.EffectExtent effectExtent13 = new Wp.EffectExtent() { LeftEdge = 19050L, TopEdge = 0L, RightEdge = 0L, BottomEdge = 0L };
            Wp.DocProperties docProperties13 = new Wp.DocProperties() { Id = (UInt32Value)12U, Name = "Image 12", Description = "RADAR_RankLegend" };

            Wp.NonVisualGraphicFrameDrawingProperties nonVisualGraphicFrameDrawingProperties13 = new Wp.NonVisualGraphicFrameDrawingProperties();
            A.GraphicFrameLocks graphicFrameLocks13 = new A.GraphicFrameLocks() { NoChangeAspect = true };

            nonVisualGraphicFrameDrawingProperties13.Append(graphicFrameLocks13);

            A.Graphic graphic13 = new A.Graphic();

            A.GraphicData graphicData13 = new A.GraphicData() { Uri = "http://schemas.openxmlformats.org/drawingml/2006/picture" };

            Pic.Picture picture13 = new Pic.Picture();

            Pic.NonVisualPictureProperties nonVisualPictureProperties13 = new Pic.NonVisualPictureProperties();
            Pic.NonVisualDrawingProperties nonVisualDrawingProperties13 = new Pic.NonVisualDrawingProperties() { Id = (UInt32Value)0U, Name = "Picture 12", Description = "RADAR_RankLegend" };

            Pic.NonVisualPictureDrawingProperties nonVisualPictureDrawingProperties13 = new Pic.NonVisualPictureDrawingProperties();
            A.PictureLocks pictureLocks13 = new A.PictureLocks() { NoChangeAspect = true, NoChangeArrowheads = true };

            nonVisualPictureDrawingProperties13.Append(pictureLocks13);

            nonVisualPictureProperties13.Append(nonVisualDrawingProperties13);
            nonVisualPictureProperties13.Append(nonVisualPictureDrawingProperties13);

            Pic.BlipFill blipFill13 = new Pic.BlipFill();
            A.Blip blip13 = new A.Blip() { Embed = "rId1" };
            A.SourceRectangle sourceRectangle13 = new A.SourceRectangle();

            A.Stretch stretch13 = new A.Stretch();
            A.FillRectangle fillRectangle13 = new A.FillRectangle();

            stretch13.Append(fillRectangle13);

            blipFill13.Append(blip13);
            blipFill13.Append(sourceRectangle13);
            blipFill13.Append(stretch13);

            Pic.ShapeProperties shapeProperties13 = new Pic.ShapeProperties() { BlackWhiteMode = A.BlackWhiteModeValues.Auto };

            A.Transform2D transform2D13 = new A.Transform2D();
            A.Offset offset13 = new A.Offset() { X = 0L, Y = 0L };
            A.Extents extents13 = new A.Extents() { Cx = 1447800L, Cy = 314325L };

            transform2D13.Append(offset13);
            transform2D13.Append(extents13);

            A.PresetGeometry presetGeometry13 = new A.PresetGeometry() { Preset = A.ShapeTypeValues.Rectangle };
            A.AdjustValueList adjustValueList13 = new A.AdjustValueList();

            presetGeometry13.Append(adjustValueList13);
            A.NoFill noFill23 = new A.NoFill();

            A.Outline outline11 = new A.Outline() { Width = 9525 };
            A.NoFill noFill24 = new A.NoFill();
            A.Miter miter11 = new A.Miter() { Limit = 800000 };
            A.HeadEnd headEnd11 = new A.HeadEnd();
            A.TailEnd tailEnd11 = new A.TailEnd();

            outline11.Append(noFill24);
            outline11.Append(miter11);
            outline11.Append(headEnd11);
            outline11.Append(tailEnd11);

            shapeProperties13.Append(transform2D13);
            shapeProperties13.Append(presetGeometry13);
            shapeProperties13.Append(noFill23);
            shapeProperties13.Append(outline11);

            picture13.Append(nonVisualPictureProperties13);
            picture13.Append(blipFill13);
            picture13.Append(shapeProperties13);

            graphicData13.Append(picture13);

            graphic13.Append(graphicData13);

            inline11.Append(extent13);
            inline11.Append(effectExtent13);
            inline11.Append(docProperties13);
            inline11.Append(nonVisualGraphicFrameDrawingProperties13);
            inline11.Append(graphic13);

            drawing13.Append(inline11);

            run48.Append(runProperties26);
            run48.Append(drawing13);

            Run run49 = new Run() { RsidRunAddition = "00F34666" };
            TabChar tabChar2 = new TabChar();

            run49.Append(tabChar2);

            paragraph42.Append(paragraphProperties39);
            paragraph42.Append(run48);
            paragraph42.Append(run49);

            Paragraph paragraph43 = new Paragraph() { RsidParagraphAddition = "00F34666", RsidParagraphProperties = "00782598", RsidRunAdditionDefault = "00F34666" };

            ParagraphProperties paragraphProperties40 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId38 = new ParagraphStyleId() { Val = "Disclaimer" };

            ParagraphBorders paragraphBorders12 = new ParagraphBorders();
            TopBorder topBorder10 = new TopBorder() { Val = BorderValues.Single, Color = "66AADD", Size = (UInt32Value)48U, Space = (UInt32Value)1U };

            paragraphBorders12.Append(topBorder10);

            paragraphProperties40.Append(paragraphStyleId38);
            paragraphProperties40.Append(paragraphBorders12);

            paragraph43.Append(paragraphProperties40);

            Table table4 = new Table();

            TableProperties tableProperties4 = new TableProperties();
            TableStyle tableStyle4 = new TableStyle() { Val = "Grilledutableau" };
            TableWidth tableWidth4 = new TableWidth() { Width = "0", Type = TableWidthUnitValues.Auto };

            TableBorders tableBorders5 = new TableBorders();
            TopBorder topBorder11 = new TopBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };
            LeftBorder leftBorder6 = new LeftBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };
            BottomBorder bottomBorder12 = new BottomBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };
            RightBorder rightBorder6 = new RightBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };
            InsideHorizontalBorder insideHorizontalBorder5 = new InsideHorizontalBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };
            InsideVerticalBorder insideVerticalBorder5 = new InsideVerticalBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };

            tableBorders5.Append(topBorder11);
            tableBorders5.Append(leftBorder6);
            tableBorders5.Append(bottomBorder12);
            tableBorders5.Append(rightBorder6);
            tableBorders5.Append(insideHorizontalBorder5);
            tableBorders5.Append(insideVerticalBorder5);
            TableLayout tableLayout4 = new TableLayout() { Type = TableLayoutValues.Fixed };
            TableLook tableLook4 = new TableLook() { Val = "01E0" };

            tableProperties4.Append(tableStyle4);
            tableProperties4.Append(tableWidth4);
            tableProperties4.Append(tableBorders5);
            tableProperties4.Append(tableLayout4);
            tableProperties4.Append(tableLook4);

            TableGrid tableGrid4 = new TableGrid();
            GridColumn gridColumn10 = new GridColumn() { Width = "8388" };
            GridColumn gridColumn11 = new GridColumn() { Width = "540" };

            tableGrid4.Append(gridColumn10);
            tableGrid4.Append(gridColumn11);

            TableRow tableRow5 = new TableRow() { RsidTableRowAddition = "002A248B", RsidTableRowProperties = "002A248B" };

            TableRowProperties tableRowProperties3 = new TableRowProperties();
            TableRowHeight tableRowHeight3 = new TableRowHeight() { Val = (UInt32Value)618U };

            tableRowProperties3.Append(tableRowHeight3);

            TableCell tableCell14 = new TableCell();

            TableCellProperties tableCellProperties14 = new TableCellProperties();
            TableCellWidth tableCellWidth14 = new TableCellWidth() { Width = "8388", Type = TableWidthUnitValues.Dxa };

            tableCellProperties14.Append(tableCellWidth14);

            CustomXmlBlock customXmlBlock20 = new CustomXmlBlock() { Uri = "http://hubblereports.com/namespace", Element = "reportdoc" };

            CustomXmlBlock customXmlBlock21 = new CustomXmlBlock() { Uri = "http://hubblereports.com/namespace", Element = "footer" };

            CustomXmlBlock customXmlBlock22 = new CustomXmlBlock() { Uri = "http://hubblereports.com/namespace", Element = "ShortDisclaimer" };

            Paragraph paragraph44 = new Paragraph() { RsidParagraphMarkRevision = "003F1967", RsidParagraphAddition = "002A248B", RsidParagraphProperties = "00C87F09", RsidRunAdditionDefault = "002A248B" };

            ParagraphProperties paragraphProperties41 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId39 = new ParagraphStyleId() { Val = "Disclaimer" };

            ParagraphBorders paragraphBorders13 = new ParagraphBorders();
            TopBorder topBorder12 = new TopBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };

            paragraphBorders13.Append(topBorder12);

            paragraphProperties41.Append(paragraphStyleId39);
            paragraphProperties41.Append(paragraphBorders13);

            Run run50 = new Run() { RsidRunProperties = "004B56C1" };
            Text text32 = new Text();
            text32.Text = "Confidential Proprietary Information of Russell Investments not to be distributed to third party without the express written consent of Russell Investments. Please see Important Legal Information for further information on this material.";

            run50.Append(text32);

            paragraph44.Append(paragraphProperties41);
            paragraph44.Append(run50);

            customXmlBlock22.Append(paragraph44);

            customXmlBlock21.Append(customXmlBlock22);

            customXmlBlock20.Append(customXmlBlock21);

            Paragraph paragraph45 = new Paragraph() { RsidParagraphAddition = "002A248B", RsidParagraphProperties = "00C87F09", RsidRunAdditionDefault = "002A248B" };

            ParagraphProperties paragraphProperties42 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId40 = new ParagraphStyleId() { Val = "FooterLogo" };

            paragraphProperties42.Append(paragraphStyleId40);

            paragraph45.Append(paragraphProperties42);

            tableCell14.Append(tableCellProperties14);
            tableCell14.Append(customXmlBlock20);
            tableCell14.Append(paragraph45);

            TableCell tableCell15 = new TableCell();

            TableCellProperties tableCellProperties15 = new TableCellProperties();
            TableCellWidth tableCellWidth15 = new TableCellWidth() { Width = "540", Type = TableWidthUnitValues.Dxa };
            TableCellVerticalAlignment tableCellVerticalAlignment2 = new TableCellVerticalAlignment() { Val = TableVerticalAlignmentValues.Center };

            tableCellProperties15.Append(tableCellWidth15);
            tableCellProperties15.Append(tableCellVerticalAlignment2);

            Paragraph paragraph46 = new Paragraph() { RsidParagraphMarkRevision = "00FB4EAB", RsidParagraphAddition = "002A248B", RsidParagraphProperties = "00FB4EAB", RsidRunAdditionDefault = "00740A1C" };

            ParagraphProperties paragraphProperties43 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId41 = new ParagraphStyleId() { Val = "FooterLogo" };
            Justification justification9 = new Justification() { Val = JustificationValues.Left };

            paragraphProperties43.Append(paragraphStyleId41);
            paragraphProperties43.Append(justification9);

            Run run51 = new Run();

            RunProperties runProperties27 = new RunProperties();
            NoProof noProof14 = new NoProof();
            Languages languages33 = new Languages() { Val = "fr-CA", EastAsia = "fr-CA" };

            runProperties27.Append(noProof14);
            runProperties27.Append(languages33);

            Drawing drawing14 = new Drawing();

            Wp.Anchor anchor3 = new Wp.Anchor() { DistanceFromTop = (UInt32Value)0U, DistanceFromBottom = (UInt32Value)0U, DistanceFromLeft = (UInt32Value)114300U, DistanceFromRight = (UInt32Value)114300U, SimplePos = false, RelativeHeight = (UInt32Value)251656192U, BehindDoc = false, Locked = false, LayoutInCell = true, AllowOverlap = true };
            Wp.SimplePosition simplePosition3 = new Wp.SimplePosition() { X = 0L, Y = 0L };

            Wp.HorizontalPosition horizontalPosition3 = new Wp.HorizontalPosition() { RelativeFrom = Wp.HorizontalRelativePositionValues.Column };
            Wp.PositionOffset positionOffset5 = new Wp.PositionOffset();
            positionOffset5.Text = "388620";

            horizontalPosition3.Append(positionOffset5);

            Wp.VerticalPosition verticalPosition3 = new Wp.VerticalPosition() { RelativeFrom = Wp.VerticalRelativePositionValues.Paragraph };
            Wp.PositionOffset positionOffset6 = new Wp.PositionOffset();
            positionOffset6.Text = "-2077720";

            verticalPosition3.Append(positionOffset6);
            Wp.Extent extent14 = new Wp.Extent() { Cx = 1085850L, Cy = 323850L };
            Wp.EffectExtent effectExtent14 = new Wp.EffectExtent() { LeftEdge = 19050L, TopEdge = 0L, RightEdge = 0L, BottomEdge = 0L };
            Wp.WrapNone wrapNone3 = new Wp.WrapNone();
            Wp.DocProperties docProperties14 = new Wp.DocProperties() { Id = (UInt32Value)62U, Name = "Image 62", Description = "RADAR_RLogo" };

            Wp.NonVisualGraphicFrameDrawingProperties nonVisualGraphicFrameDrawingProperties14 = new Wp.NonVisualGraphicFrameDrawingProperties();
            A.GraphicFrameLocks graphicFrameLocks14 = new A.GraphicFrameLocks() { NoChangeAspect = true };

            nonVisualGraphicFrameDrawingProperties14.Append(graphicFrameLocks14);

            A.Graphic graphic14 = new A.Graphic();

            A.GraphicData graphicData14 = new A.GraphicData() { Uri = "http://schemas.openxmlformats.org/drawingml/2006/picture" };

            Pic.Picture picture14 = new Pic.Picture();

            Pic.NonVisualPictureProperties nonVisualPictureProperties14 = new Pic.NonVisualPictureProperties();
            Pic.NonVisualDrawingProperties nonVisualDrawingProperties14 = new Pic.NonVisualDrawingProperties() { Id = (UInt32Value)0U, Name = "Picture 62", Description = "RADAR_RLogo" };

            Pic.NonVisualPictureDrawingProperties nonVisualPictureDrawingProperties14 = new Pic.NonVisualPictureDrawingProperties();
            A.PictureLocks pictureLocks14 = new A.PictureLocks() { NoChangeAspect = true, NoChangeArrowheads = true };

            nonVisualPictureDrawingProperties14.Append(pictureLocks14);

            nonVisualPictureProperties14.Append(nonVisualDrawingProperties14);
            nonVisualPictureProperties14.Append(nonVisualPictureDrawingProperties14);

            Pic.BlipFill blipFill14 = new Pic.BlipFill();
            A.Blip blip14 = new A.Blip() { Embed = "rId2" };
            A.SourceRectangle sourceRectangle14 = new A.SourceRectangle();

            A.Stretch stretch14 = new A.Stretch();
            A.FillRectangle fillRectangle14 = new A.FillRectangle();

            stretch14.Append(fillRectangle14);

            blipFill14.Append(blip14);
            blipFill14.Append(sourceRectangle14);
            blipFill14.Append(stretch14);

            Pic.ShapeProperties shapeProperties14 = new Pic.ShapeProperties() { BlackWhiteMode = A.BlackWhiteModeValues.Auto };

            A.Transform2D transform2D14 = new A.Transform2D();
            A.Offset offset14 = new A.Offset() { X = 0L, Y = 0L };
            A.Extents extents14 = new A.Extents() { Cx = 1085850L, Cy = 323850L };

            transform2D14.Append(offset14);
            transform2D14.Append(extents14);

            A.PresetGeometry presetGeometry14 = new A.PresetGeometry() { Preset = A.ShapeTypeValues.Rectangle };
            A.AdjustValueList adjustValueList14 = new A.AdjustValueList();

            presetGeometry14.Append(adjustValueList14);
            A.NoFill noFill25 = new A.NoFill();

            shapeProperties14.Append(transform2D14);
            shapeProperties14.Append(presetGeometry14);
            shapeProperties14.Append(noFill25);

            picture14.Append(nonVisualPictureProperties14);
            picture14.Append(blipFill14);
            picture14.Append(shapeProperties14);

            graphicData14.Append(picture14);

            graphic14.Append(graphicData14);

            anchor3.Append(simplePosition3);
            anchor3.Append(horizontalPosition3);
            anchor3.Append(verticalPosition3);
            anchor3.Append(extent14);
            anchor3.Append(effectExtent14);
            anchor3.Append(wrapNone3);
            anchor3.Append(docProperties14);
            anchor3.Append(nonVisualGraphicFrameDrawingProperties14);
            anchor3.Append(graphic14);

            drawing14.Append(anchor3);

            run51.Append(runProperties27);
            run51.Append(drawing14);

            paragraph46.Append(paragraphProperties43);
            paragraph46.Append(run51);

            tableCell15.Append(tableCellProperties15);
            tableCell15.Append(paragraph46);

            tableRow5.Append(tableRowProperties3);
            tableRow5.Append(tableCell14);
            tableRow5.Append(tableCell15);

            table4.Append(tableProperties4);
            table4.Append(tableGrid4);
            table4.Append(tableRow5);

            Paragraph paragraph47 = new Paragraph() { RsidParagraphAddition = "00F34666", RsidParagraphProperties = "00F34666", RsidRunAdditionDefault = "00F34666" };

            ParagraphProperties paragraphProperties44 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId42 = new ParagraphStyleId() { Val = "FooterLogo" };

            paragraphProperties44.Append(paragraphStyleId42);

            paragraph47.Append(paragraphProperties44);

            Paragraph paragraph48 = new Paragraph() { RsidParagraphMarkRevision = "00F34666", RsidParagraphAddition = "003E4D99", RsidParagraphProperties = "00F34666", RsidRunAdditionDefault = "003E4D99" };

            ParagraphProperties paragraphProperties45 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId43 = new ParagraphStyleId() { Val = "FooterPageNumber" };
            SpacingBetweenLines spacingBetweenLines50 = new SpacingBetweenLines() { After = "320" };

            paragraphProperties45.Append(paragraphStyleId43);
            paragraphProperties45.Append(spacingBetweenLines50);

            paragraph48.Append(paragraphProperties45);

            footer2.Append(paragraph42);
            footer2.Append(paragraph43);
            footer2.Append(table4);
            footer2.Append(paragraph47);
            footer2.Append(paragraph48);

            footerPart2.Footer = footer2;
        }
Exemplo n.º 26
0
 /// <summary>
 /// Adds a unordered IList to the footer section
 /// </summary>
 /// <param name="pdfMakeUnorderedList"></param>
 public void AddFooterUnorderedList <T>(IPdfMakeUnorderedList <T> pdfMakeUnorderedList)
 {
     Footer.Add(pdfMakeUnorderedList);
 }
Exemplo n.º 27
0
 //private IEnumerator RealGetTexture(string url)
 //{
 //    yield return StartCoroutine(TextureUtils.LoadRemote(url, value => texture2d = value));
 //    Data.Instance.lastArtTexture = texture2d;
 //    yield return null;
 //}
 public void OnSelected(Footer footer, int id)
 {
     if (sprite) {
         Data.Instance.SetLastArtTexture(texture2d);
         //Data.Instance.lastArtTexture = sprite.texture;
     }
     footer.OnSelect(id);
 }
Exemplo n.º 28
0
 /// <summary>
 /// Adds a stack to the footer section
 /// </summary>
 /// <param name="pdfMakeStacks"></param>
 public void AddFooterStack <T>(IPdfMakeStack <T> pdfMakeStacks)
 {
     Footer.Add(new { pdfMakeStacks });
 }
Exemplo n.º 29
0
        // Generates content of footerPart1.
        private void GenerateFooterPart1Content(FooterPart footerPart1)
        {
            Footer footer1 = new Footer() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 wp14" } };
            footer1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
            footer1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            footer1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
            footer1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            footer1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
            footer1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
            footer1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
            footer1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
            footer1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
            footer1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            footer1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            footer1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
            footer1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
            footer1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
            footer1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");

            Paragraph paragraph51 = new Paragraph() { RsidParagraphAddition = "004F7F90", RsidRunAdditionDefault = "00900A10" };

            ParagraphProperties paragraphProperties49 = new ParagraphProperties();
            WidowControl widowControl49 = new WidowControl() { Val = false };

            ParagraphBorders paragraphBorders1 = new ParagraphBorders();
            TopBorder topBorder18 = new TopBorder() { Val = BorderValues.Single, Color = "auto", Size = (UInt32Value)4U, Space = (UInt32Value)5U };

            paragraphBorders1.Append(topBorder18);
            AutoSpaceDE autoSpaceDE49 = new AutoSpaceDE() { Val = false };
            AutoSpaceDN autoSpaceDN49 = new AutoSpaceDN() { Val = false };
            AdjustRightIndent adjustRightIndent49 = new AdjustRightIndent() { Val = false };
            SpacingBetweenLines spacingBetweenLines35 = new SpacingBetweenLines() { After = "0", Line = "240", LineRule = LineSpacingRuleValues.Auto };
            Justification justification10 = new Justification() { Val = JustificationValues.Center };

            ParagraphMarkRunProperties paragraphMarkRunProperties49 = new ParagraphMarkRunProperties();
            RunFonts runFonts91 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            FontSize fontSize91 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript91 = new FontSizeComplexScript() { Val = "18" };

            paragraphMarkRunProperties49.Append(runFonts91);
            paragraphMarkRunProperties49.Append(fontSize91);
            paragraphMarkRunProperties49.Append(fontSizeComplexScript91);

            paragraphProperties49.Append(widowControl49);
            paragraphProperties49.Append(paragraphBorders1);
            paragraphProperties49.Append(autoSpaceDE49);
            paragraphProperties49.Append(autoSpaceDN49);
            paragraphProperties49.Append(adjustRightIndent49);
            paragraphProperties49.Append(spacingBetweenLines35);
            paragraphProperties49.Append(justification10);
            paragraphProperties49.Append(paragraphMarkRunProperties49);

            Run run43 = new Run();

            RunProperties runProperties43 = new RunProperties();
            RunFonts runFonts92 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            FontSize fontSize92 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript92 = new FontSizeComplexScript() { Val = "18" };

            runProperties43.Append(runFonts92);
            runProperties43.Append(fontSize92);
            runProperties43.Append(fontSizeComplexScript92);
            Text text43 = new Text() { Space = SpaceProcessingModeValues.Preserve };
            text43.Text = "Страница ";

            run43.Append(runProperties43);
            run43.Append(text43);

            Run run44 = new Run();

            RunProperties runProperties44 = new RunProperties();
            RunFonts runFonts93 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            FontSize fontSize93 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript93 = new FontSizeComplexScript() { Val = "18" };

            runProperties44.Append(runFonts93);
            runProperties44.Append(fontSize93);
            runProperties44.Append(fontSizeComplexScript93);
            FieldChar fieldChar1 = new FieldChar() { FieldCharType = FieldCharValues.Begin };

            run44.Append(runProperties44);
            run44.Append(fieldChar1);

            Run run45 = new Run();

            RunProperties runProperties45 = new RunProperties();
            RunFonts runFonts94 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            FontSize fontSize94 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript94 = new FontSizeComplexScript() { Val = "18" };

            runProperties45.Append(runFonts94);
            runProperties45.Append(fontSize94);
            runProperties45.Append(fontSizeComplexScript94);
            FieldCode fieldCode1 = new FieldCode();
            fieldCode1.Text = "PAGE";

            run45.Append(runProperties45);
            run45.Append(fieldCode1);

            Run run46 = new Run();

            RunProperties runProperties46 = new RunProperties();
            RunFonts runFonts95 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            FontSize fontSize95 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript95 = new FontSizeComplexScript() { Val = "18" };

            runProperties46.Append(runFonts95);
            runProperties46.Append(fontSize95);
            runProperties46.Append(fontSizeComplexScript95);
            FieldChar fieldChar2 = new FieldChar() { FieldCharType = FieldCharValues.Separate };

            run46.Append(runProperties46);
            run46.Append(fieldChar2);

            Run run47 = new Run() { RsidRunAddition = "00D60978" };

            RunProperties runProperties47 = new RunProperties();
            RunFonts runFonts96 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            NoProof noProof1 = new NoProof();
            FontSize fontSize96 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript96 = new FontSizeComplexScript() { Val = "18" };

            runProperties47.Append(runFonts96);
            runProperties47.Append(noProof1);
            runProperties47.Append(fontSize96);
            runProperties47.Append(fontSizeComplexScript96);
            Text text44 = new Text();
            text44.Text = "1";

            run47.Append(runProperties47);
            run47.Append(text44);

            Run run48 = new Run();

            RunProperties runProperties48 = new RunProperties();
            RunFonts runFonts97 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            FontSize fontSize97 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript97 = new FontSizeComplexScript() { Val = "18" };

            runProperties48.Append(runFonts97);
            runProperties48.Append(fontSize97);
            runProperties48.Append(fontSizeComplexScript97);
            FieldChar fieldChar3 = new FieldChar() { FieldCharType = FieldCharValues.End };

            run48.Append(runProperties48);
            run48.Append(fieldChar3);

            Run run49 = new Run();

            RunProperties runProperties49 = new RunProperties();
            RunFonts runFonts98 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            FontSize fontSize98 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript98 = new FontSizeComplexScript() { Val = "18" };

            runProperties49.Append(runFonts98);
            runProperties49.Append(fontSize98);
            runProperties49.Append(fontSizeComplexScript98);
            Text text45 = new Text() { Space = SpaceProcessingModeValues.Preserve };
            text45.Text = " из ";

            run49.Append(runProperties49);
            run49.Append(text45);

            Run run50 = new Run();

            RunProperties runProperties50 = new RunProperties();
            RunFonts runFonts99 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            FontSize fontSize99 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript99 = new FontSizeComplexScript() { Val = "18" };

            runProperties50.Append(runFonts99);
            runProperties50.Append(fontSize99);
            runProperties50.Append(fontSizeComplexScript99);
            FieldChar fieldChar4 = new FieldChar() { FieldCharType = FieldCharValues.Begin };

            run50.Append(runProperties50);
            run50.Append(fieldChar4);

            Run run51 = new Run();

            RunProperties runProperties51 = new RunProperties();
            RunFonts runFonts100 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            FontSize fontSize100 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript100 = new FontSizeComplexScript() { Val = "18" };

            runProperties51.Append(runFonts100);
            runProperties51.Append(fontSize100);
            runProperties51.Append(fontSizeComplexScript100);
            FieldCode fieldCode2 = new FieldCode();
            fieldCode2.Text = "NUMPAGES";

            run51.Append(runProperties51);
            run51.Append(fieldCode2);

            Run run52 = new Run();

            RunProperties runProperties52 = new RunProperties();
            RunFonts runFonts101 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            FontSize fontSize101 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript101 = new FontSizeComplexScript() { Val = "18" };

            runProperties52.Append(runFonts101);
            runProperties52.Append(fontSize101);
            runProperties52.Append(fontSizeComplexScript101);
            FieldChar fieldChar5 = new FieldChar() { FieldCharType = FieldCharValues.Separate };

            run52.Append(runProperties52);
            run52.Append(fieldChar5);

            Run run53 = new Run() { RsidRunAddition = "00D60978" };

            RunProperties runProperties53 = new RunProperties();
            RunFonts runFonts102 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            NoProof noProof2 = new NoProof();
            FontSize fontSize102 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript102 = new FontSizeComplexScript() { Val = "18" };

            runProperties53.Append(runFonts102);
            runProperties53.Append(noProof2);
            runProperties53.Append(fontSize102);
            runProperties53.Append(fontSizeComplexScript102);
            Text text46 = new Text();
            text46.Text = "1";

            run53.Append(runProperties53);
            run53.Append(text46);

            Run run54 = new Run();

            RunProperties runProperties54 = new RunProperties();
            RunFonts runFonts103 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            FontSize fontSize103 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript103 = new FontSizeComplexScript() { Val = "18" };

            runProperties54.Append(runFonts103);
            runProperties54.Append(fontSize103);
            runProperties54.Append(fontSizeComplexScript103);
            FieldChar fieldChar6 = new FieldChar() { FieldCharType = FieldCharValues.End };

            run54.Append(runProperties54);
            run54.Append(fieldChar6);

            Run run55 = new Run();

            RunProperties runProperties55 = new RunProperties();
            RunFonts runFonts104 = new RunFonts() { Ascii = "New Roman", HighAnsi = "New Roman", EastAsia = "New Roman", ComplexScript = "Times New Roman" };
            FontSize fontSize104 = new FontSize() { Val = "18" };
            FontSizeComplexScript fontSizeComplexScript104 = new FontSizeComplexScript() { Val = "18" };

            runProperties55.Append(runFonts104);
            runProperties55.Append(fontSize104);
            runProperties55.Append(fontSizeComplexScript104);
            Text text47 = new Text() { Space = SpaceProcessingModeValues.Preserve };
            text47.Text = " ";

            run55.Append(runProperties55);
            run55.Append(text47);

            paragraph51.Append(paragraphProperties49);
            paragraph51.Append(run43);
            paragraph51.Append(run44);
            paragraph51.Append(run45);
            paragraph51.Append(run46);
            paragraph51.Append(run47);
            paragraph51.Append(run48);
            paragraph51.Append(run49);
            paragraph51.Append(run50);
            paragraph51.Append(run51);
            paragraph51.Append(run52);
            paragraph51.Append(run53);
            paragraph51.Append(run54);
            paragraph51.Append(run55);

            footer1.Append(paragraph51);

            footerPart1.Footer = footer1;
        }
Exemplo n.º 30
0
 /// <summary>
 /// Adds an image to the footer section
 /// </summary>
 /// <param name="pdfMakeImage"></param>
 public void AddFooterImage(IPdfMakeImage pdfMakeImage)
 {
     Footer.Add(pdfMakeImage);
 }
Exemplo n.º 31
0
        public static void GenerateFooterPartContent(FooterPart part)
        {
            Footer footer1 = new Footer() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 wp14" } };
            footer1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
            footer1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            footer1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
            footer1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            footer1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
            footer1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
            footer1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
            footer1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
            footer1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
            footer1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            footer1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            footer1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
            footer1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
            footer1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
            footer1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");

            Paragraph paragraph1 = new Paragraph() { RsidParagraphAddition = "00164C17", RsidRunAdditionDefault = "00164C17" };

            ParagraphProperties paragraphProperties1 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId1 = new ParagraphStyleId() { Val = "Footer" };

            paragraphProperties1.Append(paragraphStyleId1);

            Run run1 = new Run();
            Text text1 = new Text();
            text1.Text = "Footer";

            run1.Append(text1);

            paragraph1.Append(paragraphProperties1);
            paragraph1.Append(run1);

            footer1.Append(paragraph1);

            part.Footer = footer1;
        }
Exemplo n.º 32
0
 /// <summary>
 /// Adds an Svg to the body footer
 /// </summary>
 /// <param name="pdfMakeSvg"></param>
 public void AddFooterSvg(IPdfMakeSvg pdfMakeSvg)
 {
     Footer.Add(pdfMakeSvg);
 }
    protected void LoadResourceCenter()
    {
        Footer footer = new Footer();
        DataSet dsResource = new DataSet();
        StringBuilder sb = new StringBuilder();
        int asm = 1;
        dsResource = footer.Get_LeftMenu_All_ResourceCenter();
        foreach (DataTable table in dsResource.Tables)
        {
            foreach (DataRow row in table.Rows)
            {
                if ((row["tempsitepage"].ToString() == "requestACatalog.aspx") && (((bool)Session[SiteConstants.UserValidLogin]) == false))
                {
                    sb.AppendLine("<li><a href=\"#htmlElement\" id=\"mb15\" class=\"mb\" rel=\"type:element\" onClick=\"followLink='" + row["tempsitepage"].ToString() + "?id=" + row["geneid"].ToString() + "&TypeGen=1&am=2&asm=" + asm.ToString() + "';clear_follow();\">" + row["genetitle"].ToString() + "</a></li>");
                }
                else
                {
                    sb.AppendLine("<li><a href=\"" + row["tempsitepage"].ToString() + "?id=" + row["geneid"].ToString() + "&TypeGen=1&am=2&asm=" + asm.ToString() + "\">" + row["genetitle"].ToString() + "</a></li>");
                }
                asm++;
            }
        }

        PlaceHolder_ResourceCenter.Controls.Add(new LiteralControl(sb.ToString()));
        dsResource = null;
        sb = null;
    }
Exemplo n.º 34
0
 /// <summary>
 /// Adds a link to the footer section
 /// </summary>
 /// <param name="pdfMakeLink"></param>
 public void AddFooterLink(IPdfMakeLink pdfMakeLink)
 {
     Footer.Add(pdfMakeLink);
 }
Exemplo n.º 35
0
        private Footer CreateFooter()
        {
            RadDocument footerDocument = new RadDocument();
            RadDocumentEditor editor = new RadDocumentEditor(footerDocument);

            editor.InsertTable(1, 2);
            editor.ChangeStyleName(RadDocumentDefaultStyles.DefaultNormalTableStyleName);

            editor.Document.Selection.SelectAll();

            editor.ChangeFontFamily(new FontFamily("Arial"));
            editor.ChangeForeColor(Color.FromRgb(29, 192, 34));
            editor.ChangeFontSize(Unit.PointToDip(10));

            editor.Document.Selection.Clear();

            editor.Insert("Copyright © 2002-2015 Telerik. All rights reserved.");

            var table = editor.Document.EnumerateChildrenOfType<Table>().FirstOrDefault();

            editor.Document.CaretPosition.MoveToStartOfDocumentElement(table.Rows.First.Cells.Last);
            table.Grid.Columns.Last().PreferredWidth = new TableWidthUnit(20);

            PageField field = new PageField();
            editor.InsertField(field, FieldDisplayMode.Result);
            editor.ChangeParagraphTextAlignment(RadTextAlignment.Right);

            Footer footer = new Footer() { Body = footerDocument };
            return footer;
        }
Exemplo n.º 36
0
        /// <summary>
        /// Generate the template
        /// </summary>
        /// <returns></returns>
        private static Document GetTemplateDocument()
        {
            var doc = new Document();

            doc.Styles.Add(new Style()
            {
                StyleId = "Red", FontColor = "FF0050", FontSize = "42"
            });
            doc.Styles.Add(new Style()
            {
                StyleId = "Yellow", FontColor = "FFFF00", FontSize = "40"
            });

            var page1 = new Page();

            page1.Margin = new SpacingModel()
            {
                Top = 845, Bottom = 1418, Left = 567, Right = 567, Header = 709, Footer = 709
            };
            var page2 = new Page();

            page2.Margin = new SpacingModel()
            {
                Top = 1418, Left = 845, Header = 709, Footer = 709
            };
            doc.Pages.Add(page1);
            doc.Pages.Add(page2);

            // Template 1 :

            var paragraph = new Paragraph();

            paragraph.ChildElements.Add(new Label()
            {
                Text = "Label wihtou special character (éèàù).", FontSize = "30", FontName = "Arial"
            });
            paragraph.ChildElements.Add(new Hyperlink()
            {
                Text = new Label()
                {
                    Text     = "Go to github.",
                    FontSize = "20",
                    FontName = "Arial"
                },
                WebSiteUri = "https://www.github.com/"
            });
            paragraph.Indentation = new ParagraphIndentationModel()
            {
                Left  = "300",
                Right = "6000"
            };
            paragraph.ChildElements.Add(new Label()
            {
                Text = "Ceci est un texte avec accents (éèàù)", FontSize = "30", FontName = "Arial"
            });
            paragraph.ChildElements.Add(new Label()
            {
                Text                = "#KeyTest1#",
                FontSize            = "40",
                TransformOperations = new List <LabelTransformOperation>()
                {
                    new LabelTransformOperation()
                    {
                        TransformOperationType = LabelTransformOperationType.ToUpper
                    }
                },
                FontColor = "#FontColorTestRed#",
                Shading   = "9999FF",
                BoldKey   = "#BoldKey#",
                Bold      = false
            });
            paragraph.ChildElements.Add(new Label()
            {
                Text = "#KeyTest2#",
                Show = false
            });
            paragraph.Borders = new BorderModel()
            {
                BorderPositions           = BorderPositions.BOTTOM | BorderPositions.TOP | BorderPositions.LEFT,
                BorderWidthBottom         = 3,
                BorderWidthLeft           = 10,
                BorderWidthTop            = 20,
                BorderWidthInsideVertical = 1,
                UseVariableBorders        = true,
                BorderColor       = "FF0000",
                BorderLeftColor   = "CCCCCC",
                BorderTopColor    = "123456",
                BorderRightColor  = "FFEEDD",
                BorderBottomColor = "FF1234"
            };

            var templateDefinition = new TemplateDefinition()
            {
                TemplateId    = "Template 1",
                Note          = "Sample paragraph",
                ChildElements = new List <BaseElement>()
                {
                    paragraph
                }
            };

            doc.TemplateDefinitions.Add(templateDefinition);

            page1.ChildElements.Add(new TemplateModel()
            {
                TemplateId = "Template 1"
            });
            page1.ChildElements.Add(paragraph);
            page1.ChildElements.Add(new TemplateModel()
            {
                TemplateId = "Template 1"
            });
            page1.ChildElements.Add(new TemplateModel()
            {
                TemplateId = "Template 1"
            });

            var p2 = new Paragraph();

            p2.Shading = "#ParagraphShading#";
            p2.ChildElements.Add(new Label()
            {
                Text = "   texte paragraph2 avec espace avant", FontSize = "20", SpaceProcessingModeValue = SpaceProcessingModeValues.Preserve
            });
            p2.ChildElements.Add(new Label()
            {
                Text = "texte2 paragraph2 avec espace après   ", SpaceProcessingModeValue = SpaceProcessingModeValues.Preserve
            });
            p2.ChildElements.Add(new Label()
            {
                Text = "   texte3 paragraph2 avec espace avant et après   ", SpaceProcessingModeValue = SpaceProcessingModeValues.Preserve
            });
            page1.ChildElements.Add(p2);

            var table = new Table()
            {
                TableWidth = new TableWidthModel()
                {
                    Width = "5000", Type = TableWidthUnitValues.Pct
                },
                TableIndentation = new TableIndentation()
                {
                    Width = 1000
                },
                Rows = new List <Row>()
                {
                    new Row()
                    {
                        Cells = new List <Cell>()
                        {
                            new Cell()
                            {
                                VerticalAlignment = TableVerticalAlignmentValues.Center,
                                Justification     = JustificationValues.Center,
                                ChildElements     = new List <BaseElement>()
                                {
                                    new Paragraph()
                                    {
                                        ChildElements = new List <BaseElement>()
                                        {
                                            new Label()
                                            {
                                                Text = "Cell 1 - First paragraph"
                                            }
                                        }, ParagraphStyleId = "Yellow"
                                    },
                                    new Image()
                                    {
                                        Width         = 50,
                                        Path          = @"Resources\Desert.jpg",
                                        ImagePartType = OpenXMLSDK.Engine.Packaging.ImagePartType.Jpeg
                                    },
                                    new Label()
                                    {
                                        Text = "Cell 1 - Label in a cell"
                                    },
                                    new Paragraph()
                                    {
                                        ChildElements = new List <BaseElement>()
                                        {
                                            new Label()
                                            {
                                                Text = "Cell 1 - Second paragraph"
                                            }
                                        }
                                    }
                                },
                                Fusion = true
                            },
                            new Cell()
                            {
                                ChildElements = new List <BaseElement>()
                                {
                                    new Label()
                                    {
                                        Text = "Cell 2 - First label"
                                    },
                                    new Image()
                                    {
                                        Height        = 10,
                                        Path          = @"Resources\Desert.jpg",
                                        ImagePartType = OpenXMLSDK.Engine.Packaging.ImagePartType.Jpeg
                                    },
                                    new Label()
                                    {
                                        Text = "Cell 2 - Second label"
                                    }
                                },
                                Borders = new BorderModel()
                                {
                                    BorderColor     = "#BorderColor#",
                                    BorderWidth     = 20,
                                    BorderPositions = BorderPositions.LEFT | BorderPositions.TOP
                                }
                            }
                        }
                    },
                    new Row()
                    {
                        ShowKey = "#NoRow#",
                        Cells   = new List <Cell>()
                        {
                            new Cell()
                            {
                                Fusion      = true,
                                FusionChild = true
                            },
                            new Cell()
                            {
                                VerticalAlignment = TableVerticalAlignmentValues.Bottom,
                                Justification     = JustificationValues.Right,
                                ChildElements     = new List <BaseElement>()
                                {
                                    new Label()
                                    {
                                        Text = "cellule4"
                                    }
                                }
                            }
                        }
                    }
                }
            };

            table.HeaderRow = new Row()
            {
                Cells = new List <Cell>()
                {
                    new Cell()
                    {
                        ChildElements = new List <BaseElement>()
                        {
                            new Paragraph()
                            {
                                ChildElements = new List <BaseElement>()
                                {
                                    new Label()
                                    {
                                        Text = "header1"
                                    }
                                }
                            }
                        }
                    },
                    new Cell()
                    {
                        ChildElements = new List <BaseElement>()
                        {
                            new Label()
                            {
                                Text = "header2"
                            }
                        }
                    }
                }
            };

            table.Borders = new BorderModel()
            {
                BorderPositions           = BorderPositions.BOTTOM | BorderPositions.INSIDEVERTICAL,
                BorderWidthBottom         = 50,
                BorderWidthInsideVertical = 1,
                UseVariableBorders        = true,
                BorderColor = "FF0000"
            };

            page1.ChildElements.Add(table);
            page1.ChildElements.Add(new Paragraph());

            if (File.Exists(@"Resources\Desert.jpg"))
            {
                page1.ChildElements.Add(
                    new Paragraph()
                {
                    ChildElements = new List <BaseElement>()
                    {
                        new Image()
                        {
                            MaxHeight     = 100,
                            MaxWidth      = 100,
                            Path          = @"Resources\Desert.jpg",
                            ImagePartType = OpenXMLSDK.Engine.Packaging.ImagePartType.Jpeg
                        }
                    }
                }
                    );
            }

            var tableDataSource = new Table()
            {
                TableWidth = new TableWidthModel()
                {
                    Width = "5000", Type = TableWidthUnitValues.Pct
                },
                ColsWidth = new int[2] {
                    750, 4250
                },
                Borders = new BorderModel()
                {
                    BorderPositions = (BorderPositions)63,
                    BorderColor     = "328864",
                    BorderWidth     = 20,
                },
                RowModel = new Row()
                {
                    Cells = new List <Cell>()
                    {
                        new Cell()
                        {
                            Shading       = "FFA0FF",
                            ChildElements = new List <BaseElement>()
                            {
                                new Label()
                                {
                                    Text = "#Cell1#"
                                }
                            }
                        },
                        new Cell()
                        {
                            ChildElements = new List <BaseElement>()
                            {
                                new Label()
                                {
                                    Text = "#Cell2#"
                                }
                            }
                        }
                    }
                },
                DataSourceKey = "#Datasource#"
            };

            var tableDataSourceWithPrefix = new Table()
            {
                TableWidth = new TableWidthModel()
                {
                    Width = "5000", Type = TableWidthUnitValues.Pct
                },
                ColsWidth = new int[2] {
                    750, 4250
                },
                Borders = new BorderModel()
                {
                    BorderPositions = (BorderPositions)63,
                    BorderColor     = "328864",
                    BorderWidth     = 20,
                },
                DataSourceKey             = "#DatasourcePrefix#",
                AutoContextAddItemsPrefix = "DataSourcePrefix",
                RowModel = new Row()
                {
                    Cells = new List <Cell>()
                    {
                        new Cell()
                        {
                            Shading       = "FFA0FF",
                            ChildElements = new List <BaseElement>()
                            {
                                new Label()
                                {
                                    Text    = "Item Datasource (0 index) #DataSourcePrefix_TableRow_IndexBaseZero# - ",
                                    ShowKey = "#DataSourcePrefix_TableRow_IsFirstItem#"
                                },
                                new Label()
                                {
                                    Text = "#Cell1#"
                                }
                            }
                        },
                        new Cell()
                        {
                            ChildElements = new List <BaseElement>()
                            {
                                new Label()
                                {
                                    Text    = "Item Datasource (1 index) #DataSourcePrefix_TableRow_IndexBaseOne# - ",
                                    ShowKey = "#DataSourcePrefix_TableRow_IsLastItem#"
                                },
                                new Label()
                                {
                                    Text = "#Cell2#"
                                }
                            }
                        }
                    }
                }
            };

            page1.ChildElements.Add(tableDataSource);

            page1.ChildElements.Add(tableDataSourceWithPrefix);

            // page 2
            var p21 = new Paragraph();

            p21.Justification    = JustificationValues.Center;
            p21.ParagraphStyleId = "Red";
            p21.ChildElements.Add(new Label()
            {
                Text = "texte page2", FontName = "Arial"
            });
            page2.ChildElements.Add(p21);

            var p22 = new Paragraph();

            p22.SpacingBefore    = 800;
            p22.SpacingAfter     = 800;
            p22.Justification    = JustificationValues.Both;
            p22.ParagraphStyleId = "Yellow";
            p22.ChildElements.Add(new Label()
            {
                Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse urna augue, convallis eu enim vitae, maximus ultrices nulla. Sed egestas volutpat luctus. Maecenas sodales erat eu elit auctor, eu mattis neque maximus. Duis ac risus quis sem bibendum efficitur. Vivamus justo augue, molestie quis orci non, maximus imperdiet justo. Donec condimentum rhoncus est, ut varius lorem efficitur sed. Donec accumsan sit amet nisl vel ornare. Duis aliquet urna eu mauris porttitor facilisis. "
            });
            page2.ChildElements.Add(p22);

            var p23 = new Paragraph();

            p23.Borders = new BorderModel()
            {
                BorderPositions = (BorderPositions)13,
                BorderWidth     = 20,
                BorderColor     = "#ParagraphBorderColor#"
            };
            p23.SpacingBetweenLines = 360;
            p23.ChildElements.Add(new Label()
            {
                Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse urna augue, convallis eu enim vitae, maximus ultrices nulla. Sed egestas volutpat luctus. Maecenas sodales erat eu elit auctor, eu mattis neque maximus. Duis ac risus quis sem bibendum efficitur. Vivamus justo augue, molestie quis orci non, maximus imperdiet justo. Donec condimentum rhoncus est, ut varius lorem efficitur sed. Donec accumsan sit amet nisl vel ornare. Duis aliquet urna eu mauris porttitor facilisis. "
            });
            page2.ChildElements.Add(p23);

            // Adding a foreach page :
            var foreachPage = new ForEachPage();

            foreachPage.DataSourceKey = "#DatasourceTableFusion#";

            foreachPage.Margin = new SpacingModel()
            {
                Top = 1418, Left = 845, Header = 709, Footer = 709
            };
            var paragraph21 = new Paragraph();

            paragraph21.ChildElements.Add(new Label()
            {
                Text = "Page label : #Label#"
            });
            foreachPage.ChildElements.Add(paragraph21);
            var p223 = new Paragraph();

            p223.Shading = "#ParagraphShading#";
            p223.ChildElements.Add(new Label()
            {
                Text = "Texte paragraph2 avec espace avant", FontSize = "20", SpaceProcessingModeValue = SpaceProcessingModeValues.Preserve
            });
            foreachPage.ChildElements.Add(p223);
            doc.Pages.Add(foreachPage);

            // page 3
            var page3 = new Page();
            var p31   = new Paragraph()
            {
                FontColor = "FF0000", FontSize = "26"
            };

            p31.ChildElements.Add(new Label()
            {
                Text = "Test the HeritFromParent"
            });
            var p311 = new Paragraph()
            {
                FontSize = "16"
            };

            p311.ChildElements.Add(new Label()
            {
                Text = " Success (not the same size)"
            });
            p31.ChildElements.Add(p311);
            page3.ChildElements.Add(p31);

            TableOfContents tableOfContents = new TableOfContents()
            {
                StylesAndLevels = new List <Tuple <string, string> >()
                {
                    new Tuple <string, string>("Red", "1"),
                    new Tuple <string, string>("Yellow", "2"),
                },
                Title        = "Tessssssst !",
                TitleStyleId = "Yellow",
                ToCStylesId  = new List <string>()
                {
                    "Red"
                },
                LeaderCharValue = TabStopLeaderCharValues.underscore
            };

            page3.ChildElements.Add(tableOfContents);

            paragraph = new Paragraph()
            {
                ParagraphStyleId = "#ParagraphStyleIdTestYellow#"
            };
            paragraph.ChildElements.Add(new Label()
            {
                Text = "Ceci est un test de paragraph avec Style", FontSize = "30", FontName = "Arial"
            });
            page3.ChildElements.Add(paragraph);

            doc.Pages.Add(page3);

            var page4 = new Page();
            //New page to manage UniformGrid:
            var uniformGrid = new UniformGrid()
            {
                DataSourceKey = "#UniformGridSample#",
                ColsWidth     = new int[2] {
                    2500, 2500
                },
                TableWidth = new TableWidthModel()
                {
                    Width = "5000", Type = TableWidthUnitValues.Pct
                },
                CellModel = new Cell()
                {
                    VerticalAlignment = TableVerticalAlignmentValues.Center,
                    Justification     = JustificationValues.Center,
                    ChildElements     = new List <BaseElement>()
                    {
                        new Paragraph()
                        {
                            ChildElements = new List <BaseElement>()
                            {
                                new Label()
                                {
                                    Text = "#CellUniformGridTitle#"
                                }
                            }
                        },
                        new Paragraph()
                        {
                            ChildElements = new List <BaseElement>()
                            {
                                new Label()
                                {
                                    Text = "Cell 1 - Second paragraph"
                                }
                            }
                        }
                    }
                },
                HeaderRow = new Row()
                {
                    Cells = new List <Cell>()
                    {
                        new Cell()
                        {
                            ChildElements = new List <BaseElement>()
                            {
                                new Paragraph()
                                {
                                    ChildElements = new List <BaseElement>()
                                    {
                                        new Label()
                                        {
                                            Text = "header1"
                                        }
                                    }
                                }
                            }
                        },
                        new Cell()
                        {
                            ChildElements = new List <BaseElement>()
                            {
                                new Label()
                                {
                                    Text = "header2"
                                }
                            }
                        }
                    }
                },
                Borders = new BorderModel()
                {
                    BorderPositions           = BorderPositions.BOTTOM | BorderPositions.INSIDEVERTICAL,
                    BorderWidthBottom         = 50,
                    BorderWidthInsideVertical = 1,
                    UseVariableBorders        = true,
                    BorderColor = "FF0000"
                }
            };

            page4.ChildElements.Add(uniformGrid);

            doc.Pages.Add(page4);

            var page5 = new Page();
            var tableDataSourceWithBeforeAfter = new Table()
            {
                TableWidth = new TableWidthModel()
                {
                    Width = "5000", Type = TableWidthUnitValues.Pct
                },
                ColsWidth = new int[2] {
                    750, 4250
                },
                Borders = new BorderModel()
                {
                    BorderPositions = (BorderPositions)63,
                    BorderColor     = "328864",
                    BorderWidth     = 20,
                },
                BeforeRows = new List <Row>()
                {
                    new Row()
                    {
                        Cells = new List <Cell>()
                        {
                            new Cell()
                            {
                                VerticalAlignment = TableVerticalAlignmentValues.Bottom,
                                Justification     = JustificationValues.Left,
                                ChildElements     = new List <BaseElement>()
                                {
                                    new Paragraph()
                                    {
                                        ChildElements = new List <BaseElement>()
                                        {
                                            new Label()
                                            {
                                                Text = "Cell 1 - A small paragraph"
                                            }
                                        }, ParagraphStyleId = "Yellow"
                                    },
                                    new Image()
                                    {
                                        MaxHeight     = 100,
                                        MaxWidth      = 100,
                                        Path          = @"Resources\Desert.jpg",
                                        ImagePartType = OpenXMLSDK.Engine.Packaging.ImagePartType.Jpeg
                                    },
                                    new Label()
                                    {
                                        Text = "Custom header"
                                    },
                                    new Paragraph()
                                    {
                                        ChildElements = new List <BaseElement>()
                                        {
                                            new Label()
                                            {
                                                Text = "Cell 1 - an other paragraph"
                                            }
                                        }
                                    }
                                },
                                Fusion = true
                            },
                            new Cell()
                            {
                                ChildElements = new List <BaseElement>()
                                {
                                    new Label()
                                    {
                                        Text = "Cell 2 - an other label"
                                    },
                                    new Image()
                                    {
                                        MaxHeight     = 100,
                                        MaxWidth      = 100,
                                        Path          = @"Resources\Desert.jpg",
                                        ImagePartType = OpenXMLSDK.Engine.Packaging.ImagePartType.Jpeg
                                    },
                                    new Label()
                                    {
                                        Text = "Cell 2 - an other other label"
                                    }
                                },
                                Borders = new BorderModel()
                                {
                                    BorderColor     = "00FF22",
                                    BorderWidth     = 15,
                                    BorderPositions = BorderPositions.RIGHT | BorderPositions.TOP
                                }
                            }
                        }
                    },
                    new Row()
                    {
                        Cells = new List <Cell>()
                        {
                            new Cell()
                            {
                                Fusion      = true,
                                FusionChild = true
                            },
                            new Cell()
                            {
                                VerticalAlignment = TableVerticalAlignmentValues.Bottom,
                                Justification     = JustificationValues.Right,
                                ChildElements     = new List <BaseElement>()
                                {
                                    new Label()
                                    {
                                        Text = "celluleX"
                                    }
                                }
                            }
                        }
                    }
                },
                RowModel = new Row()
                {
                    Cells = new List <Cell>()
                    {
                        new Cell()
                        {
                            Shading       = "FFA2FF",
                            ChildElements = new List <BaseElement>()
                            {
                                new Label()
                                {
                                    Text = "Cell : #Cell1#"
                                }
                            }
                        },
                        new Cell()
                        {
                            ChildElements = new List <BaseElement>()
                            {
                                new Label()
                                {
                                    Text = "Cell : #Cell2#"
                                }
                            }
                        }
                    }
                },
                DataSourceKey = "#Datasource#"
            };

            page5.ChildElements.Add(tableDataSourceWithBeforeAfter);

            doc.Pages.Add(page5);

            var page6 = new Page();

            var pr = new Paragraph()
            {
                ChildElements = new List <BaseElement>()
                {
                    new OpenXMLSDK.Engine.Word.ReportEngine.Models.Charts.BarModel()
                    {
                        Title              = "Graph test",
                        ShowTitle          = true,
                        FontSize           = "23",
                        ShowBarBorder      = true,
                        BarChartType       = BarChartType.BarChart,
                        BarDirectionValues = BarDirectionValues.Column,
                        BarGroupingValues  = BarGroupingValues.PercentStacked,
                        DataSourceKey      = "#GrahSampleData#",
                        ShowMajorGridlines = true,
                        HasBorder          = true,
                        BorderColor        = "#A80890"
                    }
                }
            };

            page6.ChildElements.Add(pr);

            doc.Pages.Add(page6);

            var page7 = new Page();

            var tableDataSourceWithCellFusion = new Table()
            {
                TableWidth = new TableWidthModel()
                {
                    Width = "5000", Type = TableWidthUnitValues.Pct
                },
                ColsWidth = new int[3] {
                    1200, 1200, 1200
                },
                Borders = new BorderModel()
                {
                    BorderPositions = (BorderPositions)63,
                    BorderColor     = "328864",
                    BorderWidth     = 20,
                },
                RowModel = new Row()
                {
                    Cells = new List <Cell>()
                    {
                        new Cell()
                        {
                            Shading       = "FFA0FF",
                            ChildElements = new List <BaseElement>()
                            {
                                new Label()
                                {
                                    Text = "#Cell1#"
                                }
                            },
                            FusionKey      = "#IsInGroup#",
                            FusionChildKey = "#IsNotFirstLineGroup#"
                        },
                        new Cell()
                        {
                            ChildElements = new List <BaseElement>()
                            {
                                new Label()
                                {
                                    Text = "#Cell2#"
                                }
                            }
                        },
                        new Cell()
                        {
                            ChildElements = new List <BaseElement>()
                            {
                                new Label()
                                {
                                    Text = "#Cell2#"
                                }
                            }
                        }
                    }
                },
                DataSourceKey = "#DatasourceTableFusion#"
            };

            page7.ChildElements.Add(tableDataSourceWithCellFusion);

            doc.Pages.Add(page7);

            // page 8
            var page8 = new Page();
            var p8    = new Paragraph()
            {
                FontColor = "FF0000", FontSize = "26"
            };

            p8.ChildElements.Add(new Label()
            {
                Text = "Label with" + Environment.NewLine + Environment.NewLine + "A new line"
            });
            page8.ChildElements.Add(p8);

            doc.Pages.Add(page8);

            // Header
            var header = new Header();

            header.Type = HeaderFooterValues.Default;
            var ph = new Paragraph();

            ph.ChildElements.Add(new Label()
            {
                Text = "Header Text"
            });
            if (File.Exists(@"Resources\Desert.jpg"))
            {
                ph.ChildElements.Add(new Image()
                {
                    MaxHeight     = 100,
                    MaxWidth      = 100,
                    Path          = @"Resources\Desert.jpg",
                    ImagePartType = OpenXMLSDK.Engine.Packaging.ImagePartType.Jpeg
                });
            }
            header.ChildElements.Add(ph);
            doc.Headers.Add(header);

            // first header
            var firstHeader = new Header();

            firstHeader.Type = HeaderFooterValues.First;
            var fph = new Paragraph();

            fph.ChildElements.Add(new Label()
            {
                Text = "first header Text"
            });
            firstHeader.ChildElements.Add(fph);
            doc.Headers.Add(firstHeader);

            // Footer
            var footer = new Footer();

            footer.Type = HeaderFooterValues.Default;
            var pf = new Paragraph();

            pf.ChildElements.Add(new Label()
            {
                Text = "Footer Text"
            });
            pf.ChildElements.Add(new Label()
            {
                IsPageNumber = true
            });
            footer.ChildElements.Add(pf);
            doc.Footers.Add(footer);

            return(doc);
        }
Exemplo n.º 37
0
        // Generates content of footerPart1.
        private void GenerateFooterPart1Content(FooterPart footerPart1)
        {
            Footer footer1 = new Footer() {MCAttributes = new MarkupCompatibilityAttributes() {Ignorable = "w14 wp14"}};
            footer1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
            footer1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            footer1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
            footer1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            footer1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
            footer1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
            footer1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
            footer1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
            footer1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
            footer1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            footer1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            footer1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
            footer1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
            footer1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
            footer1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");

            Paragraph paragraph24 = new Paragraph()
                                    {
                                        RsidParagraphAddition = "0005059E",
                                        RsidParagraphProperties = "00367B71",
                                        RsidRunAdditionDefault = "0005059E"
                                    };

            ParagraphProperties paragraphProperties5 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId1 = new ParagraphStyleId() {Val = "Footer"};

            Tabs tabs3 = new Tabs();
            TabStop tabStop5 = new TabStop() {Val = TabStopValues.Clear, Position = 4680};
            TabStop tabStop6 = new TabStop() {Val = TabStopValues.Clear, Position = 9360};
            TabStop tabStop7 = new TabStop() {Val = TabStopValues.Left, Position = 1896};

            tabs3.Append(tabStop5);
            tabs3.Append(tabStop6);
            tabs3.Append(tabStop7);

            paragraphProperties5.Append(paragraphStyleId1);
            paragraphProperties5.Append(tabs3);

            Run run27 = new Run();

            RunProperties runProperties13 = new RunProperties();
            Color color5 = new Color() {Val = "808080", ThemeColor = ThemeColorValues.Background1, ThemeShade = "80"};
            Spacing spacing3 = new Spacing() {Val = 60};

            runProperties13.Append(color5);
            runProperties13.Append(spacing3);
            Text text23 = new Text();
            text23.Text = "Page";

            run27.Append(runProperties13);
            run27.Append(text23);

            Run run28 = new Run();
            Text text24 = new Text() {Space = SpaceProcessingModeValues.Preserve};
            text24.Text = " | ";

            run28.Append(text24);

            Run run29 = new Run();
            FieldChar fieldChar1 = new FieldChar() {FieldCharType = FieldCharValues.Begin};

            run29.Append(fieldChar1);

            Run run30 = new Run();
            FieldCode fieldCode1 = new FieldCode() {Space = SpaceProcessingModeValues.Preserve};
            fieldCode1.Text = " PAGE   \\* MERGEFORMAT ";

            run30.Append(fieldCode1);

            Run run31 = new Run();
            FieldChar fieldChar2 = new FieldChar() {FieldCharType = FieldCharValues.Separate};

            run31.Append(fieldChar2);

            Run run32 = new Run() {RsidRunProperties = "007977E5", RsidRunAddition = "007977E5"};

            RunProperties runProperties14 = new RunProperties();
            Bold bold4 = new Bold();
            BoldComplexScript boldComplexScript4 = new BoldComplexScript();
            NoProof noProof14 = new NoProof();

            runProperties14.Append(bold4);
            runProperties14.Append(boldComplexScript4);
            runProperties14.Append(noProof14);
            Text text25 = new Text();
            text25.Text = "1";

            run32.Append(runProperties14);
            run32.Append(text25);

            Run run33 = new Run();

            RunProperties runProperties15 = new RunProperties();
            Bold bold5 = new Bold();
            BoldComplexScript boldComplexScript5 = new BoldComplexScript();
            NoProof noProof15 = new NoProof();

            runProperties15.Append(bold5);
            runProperties15.Append(boldComplexScript5);
            runProperties15.Append(noProof15);
            FieldChar fieldChar3 = new FieldChar() {FieldCharType = FieldCharValues.End};

            run33.Append(runProperties15);
            run33.Append(fieldChar3);

            Run run34 = new Run();

            RunProperties runProperties16 = new RunProperties();
            Bold bold6 = new Bold();
            BoldComplexScript boldComplexScript6 = new BoldComplexScript();
            NoProof noProof16 = new NoProof();

            runProperties16.Append(bold6);
            runProperties16.Append(boldComplexScript6);
            runProperties16.Append(noProof16);
            Text text26 = new Text() {Space = SpaceProcessingModeValues.Preserve};
            text26.Text = " of ";

            run34.Append(runProperties16);
            run34.Append(text26);

            Run run35 = new Run();

            RunProperties runProperties17 = new RunProperties();
            Bold bold7 = new Bold();
            BoldComplexScript boldComplexScript7 = new BoldComplexScript();
            NoProof noProof17 = new NoProof();

            runProperties17.Append(bold7);
            runProperties17.Append(boldComplexScript7);
            runProperties17.Append(noProof17);
            FieldChar fieldChar4 = new FieldChar() {FieldCharType = FieldCharValues.Begin};

            run35.Append(runProperties17);
            run35.Append(fieldChar4);

            Run run36 = new Run();

            RunProperties runProperties18 = new RunProperties();
            Bold bold8 = new Bold();
            BoldComplexScript boldComplexScript8 = new BoldComplexScript();
            NoProof noProof18 = new NoProof();

            runProperties18.Append(bold8);
            runProperties18.Append(boldComplexScript8);
            runProperties18.Append(noProof18);
            FieldCode fieldCode2 = new FieldCode() {Space = SpaceProcessingModeValues.Preserve};
            fieldCode2.Text = " NUMPAGES  \\* Arabic  \\* MERGEFORMAT ";

            run36.Append(runProperties18);
            run36.Append(fieldCode2);

            Run run37 = new Run();

            RunProperties runProperties19 = new RunProperties();
            Bold bold9 = new Bold();
            BoldComplexScript boldComplexScript9 = new BoldComplexScript();
            NoProof noProof19 = new NoProof();

            runProperties19.Append(bold9);
            runProperties19.Append(boldComplexScript9);
            runProperties19.Append(noProof19);
            FieldChar fieldChar5 = new FieldChar() {FieldCharType = FieldCharValues.Separate};

            run37.Append(runProperties19);
            run37.Append(fieldChar5);

            Run run38 = new Run() {RsidRunAddition = "007977E5"};

            RunProperties runProperties20 = new RunProperties();
            Bold bold10 = new Bold();
            BoldComplexScript boldComplexScript10 = new BoldComplexScript();
            NoProof noProof20 = new NoProof();

            runProperties20.Append(bold10);
            runProperties20.Append(boldComplexScript10);
            runProperties20.Append(noProof20);
            Text text27 = new Text();
            text27.Text = "1";

            run38.Append(runProperties20);
            run38.Append(text27);

            Run run39 = new Run();

            RunProperties runProperties21 = new RunProperties();
            Bold bold11 = new Bold();
            BoldComplexScript boldComplexScript11 = new BoldComplexScript();
            NoProof noProof21 = new NoProof();

            runProperties21.Append(bold11);
            runProperties21.Append(boldComplexScript11);
            runProperties21.Append(noProof21);
            FieldChar fieldChar6 = new FieldChar() {FieldCharType = FieldCharValues.End};

            run39.Append(runProperties21);
            run39.Append(fieldChar6);

            Run run40 = new Run();

            RunProperties runProperties22 = new RunProperties();
            Bold bold12 = new Bold();
            BoldComplexScript boldComplexScript12 = new BoldComplexScript();
            NoProof noProof22 = new NoProof();

            runProperties22.Append(bold12);
            runProperties22.Append(boldComplexScript12);
            runProperties22.Append(noProof22);
            TabChar tabChar1 = new TabChar();

            run40.Append(runProperties22);
            run40.Append(tabChar1);

            paragraph24.Append(paragraphProperties5);
            paragraph24.Append(run27);
            paragraph24.Append(run28);
            paragraph24.Append(run29);
            paragraph24.Append(run30);
            paragraph24.Append(run31);
            paragraph24.Append(run32);
            paragraph24.Append(run33);
            paragraph24.Append(run34);
            paragraph24.Append(run35);
            paragraph24.Append(run36);
            paragraph24.Append(run37);
            paragraph24.Append(run38);
            paragraph24.Append(run39);
            paragraph24.Append(run40);

            footer1.Append(paragraph24);

            footerPart1.Footer = footer1;
        }
Exemplo n.º 38
0
 public RegisterPage(IWebDriver driver)
 {
     _driver = driver;
     Header  = new Header(_driver);
     Footer  = new Footer(_driver);
 }
Exemplo n.º 39
0
Arquivo: Read.cs Projeto: paulyc/Aaru
        public bool Open(IFilter imageFilter)
        {
            Header     = new ScpHeader();
            _scpStream = imageFilter.GetDataForkStream();
            _scpStream.Seek(0, SeekOrigin.Begin);

            if (_scpStream.Length < Marshal.SizeOf <ScpHeader>())
            {
                return(false);
            }

            byte[] hdr = new byte[Marshal.SizeOf <ScpHeader>()];
            _scpStream.Read(hdr, 0, Marshal.SizeOf <ScpHeader>());

            Header = Marshal.ByteArrayToStructureLittleEndian <ScpHeader>(hdr);

            AaruConsole.DebugWriteLine("SuperCardPro plugin", "header.signature = \"{0}\"",
                                       StringHandlers.CToString(Header.signature));

            AaruConsole.DebugWriteLine("SuperCardPro plugin", "header.version = {0}.{1}", (Header.version & 0xF0) >> 4,
                                       Header.version & 0xF);

            AaruConsole.DebugWriteLine("SuperCardPro plugin", "header.type = {0}", Header.type);
            AaruConsole.DebugWriteLine("SuperCardPro plugin", "header.revolutions = {0}", Header.revolutions);
            AaruConsole.DebugWriteLine("SuperCardPro plugin", "header.start = {0}", Header.start);
            AaruConsole.DebugWriteLine("SuperCardPro plugin", "header.end = {0}", Header.end);
            AaruConsole.DebugWriteLine("SuperCardPro plugin", "header.flags = {0}", Header.flags);
            AaruConsole.DebugWriteLine("SuperCardPro plugin", "header.bitCellEncoding = {0}", Header.bitCellEncoding);
            AaruConsole.DebugWriteLine("SuperCardPro plugin", "header.heads = {0}", Header.heads);
            AaruConsole.DebugWriteLine("SuperCardPro plugin", "header.reserved = {0}", Header.reserved);
            AaruConsole.DebugWriteLine("SuperCardPro plugin", "header.checksum = 0x{0:X8}", Header.checksum);

            if (!_scpSignature.SequenceEqual(Header.signature))
            {
                return(false);
            }

            ScpTracks = new Dictionary <byte, TrackHeader>();

            for (byte t = Header.start; t <= Header.end; t++)
            {
                if (t >= Header.offsets.Length)
                {
                    break;
                }

                _scpStream.Position = Header.offsets[t];

                var trk = new TrackHeader
                {
                    Signature = new byte[3],
                    Entries   = new TrackEntry[Header.revolutions]
                };

                _scpStream.Read(trk.Signature, 0, trk.Signature.Length);
                trk.TrackNumber = (byte)_scpStream.ReadByte();

                if (!trk.Signature.SequenceEqual(_trkSignature))
                {
                    AaruConsole.DebugWriteLine("SuperCardPro plugin",
                                               "Track header at {0} contains incorrect signature.", Header.offsets[t]);

                    continue;
                }

                if (trk.TrackNumber != t)
                {
                    AaruConsole.DebugWriteLine("SuperCardPro plugin", "Track number at {0} should be {1} but is {2}.",
                                               Header.offsets[t], t, trk.TrackNumber);

                    continue;
                }

                AaruConsole.DebugWriteLine("SuperCardPro plugin", "Found track {0} at {1}.", t, Header.offsets[t]);

                for (byte r = 0; r < Header.revolutions; r++)
                {
                    byte[] rev = new byte[Marshal.SizeOf <TrackEntry>()];
                    _scpStream.Read(rev, 0, Marshal.SizeOf <TrackEntry>());

                    trk.Entries[r] = Marshal.ByteArrayToStructureLittleEndian <TrackEntry>(rev);

                    // De-relative offsets
                    trk.Entries[r].dataOffset += Header.offsets[t];
                }

                ScpTracks.Add(t, trk);
            }

            if (Header.flags.HasFlag(ScpFlags.HasFooter))
            {
                long position = _scpStream.Position;
                _scpStream.Seek(-4, SeekOrigin.End);

                while (_scpStream.Position >= position)
                {
                    byte[] footerSig = new byte[4];
                    _scpStream.Read(footerSig, 0, 4);
                    uint footerMagic = BitConverter.ToUInt32(footerSig, 0);

                    if (footerMagic == FOOTER_SIGNATURE)
                    {
                        _scpStream.Seek(-Marshal.SizeOf <Footer>(), SeekOrigin.Current);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "Found footer at {0}", _scpStream.Position);

                        byte[] ftr = new byte[Marshal.SizeOf <Footer>()];
                        _scpStream.Read(ftr, 0, Marshal.SizeOf <Footer>());

                        Footer footer = Marshal.ByteArrayToStructureLittleEndian <Footer>(ftr);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.manufacturerOffset = 0x{0:X8}",
                                                   footer.manufacturerOffset);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.modelOffset = 0x{0:X8}",
                                                   footer.modelOffset);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.serialOffset = 0x{0:X8}",
                                                   footer.serialOffset);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.creatorOffset = 0x{0:X8}",
                                                   footer.creatorOffset);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.applicationOffset = 0x{0:X8}",
                                                   footer.applicationOffset);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.commentsOffset = 0x{0:X8}",
                                                   footer.commentsOffset);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.creationTime = {0}",
                                                   footer.creationTime);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.modificationTime = {0}",
                                                   footer.modificationTime);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.applicationVersion = {0}.{1}",
                                                   (footer.applicationVersion & 0xF0) >> 4,
                                                   footer.applicationVersion & 0xF);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.hardwareVersion = {0}.{1}",
                                                   (footer.hardwareVersion & 0xF0) >> 4, footer.hardwareVersion & 0xF);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.firmwareVersion = {0}.{1}",
                                                   (footer.firmwareVersion & 0xF0) >> 4, footer.firmwareVersion & 0xF);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.imageVersion = {0}.{1}",
                                                   (footer.imageVersion & 0xF0) >> 4, footer.imageVersion & 0xF);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "footer.signature = \"{0}\"",
                                                   StringHandlers.CToString(BitConverter.GetBytes(footer.signature)));

                        _imageInfo.DriveManufacturer = ReadPStringUtf8(_scpStream, footer.manufacturerOffset);
                        _imageInfo.DriveModel        = ReadPStringUtf8(_scpStream, footer.modelOffset);
                        _imageInfo.DriveSerialNumber = ReadPStringUtf8(_scpStream, footer.serialOffset);
                        _imageInfo.Creator           = ReadPStringUtf8(_scpStream, footer.creatorOffset);
                        _imageInfo.Application       = ReadPStringUtf8(_scpStream, footer.applicationOffset);
                        _imageInfo.Comments          = ReadPStringUtf8(_scpStream, footer.commentsOffset);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.driveManufacturer = \"{0}\"",
                                                   _imageInfo.DriveManufacturer);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.driveModel = \"{0}\"",
                                                   _imageInfo.DriveModel);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.driveSerialNumber = \"{0}\"",
                                                   _imageInfo.DriveSerialNumber);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.imageCreator = \"{0}\"",
                                                   _imageInfo.Creator);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.imageApplication = \"{0}\"",
                                                   _imageInfo.Application);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.imageComments = \"{0}\"",
                                                   _imageInfo.Comments);

                        _imageInfo.CreationTime = footer.creationTime != 0
                                                      ? DateHandlers.UnixToDateTime(footer.creationTime)
                                                      : imageFilter.GetCreationTime();

                        _imageInfo.LastModificationTime = footer.modificationTime != 0
                                                              ? DateHandlers.UnixToDateTime(footer.modificationTime)
                                                              : imageFilter.GetLastWriteTime();

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.imageCreationTime = {0}",
                                                   _imageInfo.CreationTime);

                        AaruConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.imageLastModificationTime = {0}",
                                                   _imageInfo.LastModificationTime);

                        _imageInfo.ApplicationVersion =
                            $"{(footer.applicationVersion & 0xF0) >> 4}.{footer.applicationVersion & 0xF}";

                        _imageInfo.DriveFirmwareRevision =
                            $"{(footer.firmwareVersion & 0xF0) >> 4}.{footer.firmwareVersion & 0xF}";

                        _imageInfo.Version = $"{(footer.imageVersion & 0xF0) >> 4}.{footer.imageVersion & 0xF}";

                        break;
                    }

                    _scpStream.Seek(-8, SeekOrigin.Current);
                }
            }
            else
            {
                _imageInfo.Application          = "SuperCardPro";
                _imageInfo.ApplicationVersion   = $"{(Header.version & 0xF0) >> 4}.{Header.version & 0xF}";
                _imageInfo.CreationTime         = imageFilter.GetCreationTime();
                _imageInfo.LastModificationTime = imageFilter.GetLastWriteTime();
                _imageInfo.Version = "1.5";
            }

            throw new NotImplementedException("Flux decoding is not yet implemented.");
        }
Exemplo n.º 40
0
 public static void UpdateFooter(this Footer footer, FooterViewModel footerVm)
 {
     footer.ID      = footerVm.ID;
     footer.Content = footerVm.Content;
 }
        // Generates content of footerPart1.
        private void GenerateFooterPart1Content(FooterPart footerPart1)
        {
            Footer footer1 = new Footer();

            Paragraph paragraph27 = new Paragraph() { RsidParagraphAddition = "00C91FAF", RsidParagraphProperties = "00C91FAF", RsidRunAdditionDefault = "00740A1C" };

            ParagraphProperties paragraphProperties26 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId25 = new ParagraphStyleId() { Val = "FooterRankLegend" };

            Tabs tabs1 = new Tabs();
            TabStop tabStop1 = new TabStop() { Val = TabStopValues.Left, Position = 3315 };

            tabs1.Append(tabStop1);
            SpacingBetweenLines spacingBetweenLines18 = new SpacingBetweenLines() { After = "240" };

            paragraphProperties26.Append(paragraphStyleId25);
            paragraphProperties26.Append(tabs1);
            paragraphProperties26.Append(spacingBetweenLines18);

            Run run39 = new Run();

            RunProperties runProperties22 = new RunProperties();
            NoProof noProof10 = new NoProof();
            Languages languages10 = new Languages() { Val = "fr-CA", EastAsia = "fr-CA" };

            runProperties22.Append(noProof10);
            runProperties22.Append(languages10);

            Drawing drawing10 = new Drawing();

            Wp.Inline inline10 = new Wp.Inline() { DistanceFromTop = (UInt32Value)0U, DistanceFromBottom = (UInt32Value)0U, DistanceFromLeft = (UInt32Value)0U, DistanceFromRight = (UInt32Value)0U };
            Wp.Extent extent10 = new Wp.Extent() { Cx = 1447800L, Cy = 314325L };
            Wp.EffectExtent effectExtent10 = new Wp.EffectExtent() { LeftEdge = 19050L, TopEdge = 0L, RightEdge = 0L, BottomEdge = 0L };
            Wp.DocProperties docProperties10 = new Wp.DocProperties() { Id = (UInt32Value)23U, Name = "Image 23", Description = "RADAR_RankLegend" };

            Wp.NonVisualGraphicFrameDrawingProperties nonVisualGraphicFrameDrawingProperties10 = new Wp.NonVisualGraphicFrameDrawingProperties();
            A.GraphicFrameLocks graphicFrameLocks10 = new A.GraphicFrameLocks() { NoChangeAspect = true };

            nonVisualGraphicFrameDrawingProperties10.Append(graphicFrameLocks10);

            A.Graphic graphic10 = new A.Graphic();

            A.GraphicData graphicData10 = new A.GraphicData() { Uri = "http://schemas.openxmlformats.org/drawingml/2006/picture" };

            Pic.Picture picture10 = new Pic.Picture();

            Pic.NonVisualPictureProperties nonVisualPictureProperties10 = new Pic.NonVisualPictureProperties();
            Pic.NonVisualDrawingProperties nonVisualDrawingProperties10 = new Pic.NonVisualDrawingProperties() { Id = (UInt32Value)0U, Name = "Picture 23", Description = "RADAR_RankLegend" };

            Pic.NonVisualPictureDrawingProperties nonVisualPictureDrawingProperties10 = new Pic.NonVisualPictureDrawingProperties();
            A.PictureLocks pictureLocks10 = new A.PictureLocks() { NoChangeAspect = true, NoChangeArrowheads = true };

            nonVisualPictureDrawingProperties10.Append(pictureLocks10);

            nonVisualPictureProperties10.Append(nonVisualDrawingProperties10);
            nonVisualPictureProperties10.Append(nonVisualPictureDrawingProperties10);

            Pic.BlipFill blipFill10 = new Pic.BlipFill();
            A.Blip blip10 = new A.Blip() { Embed = "rId1" };
            A.SourceRectangle sourceRectangle10 = new A.SourceRectangle();

            A.Stretch stretch10 = new A.Stretch();
            A.FillRectangle fillRectangle10 = new A.FillRectangle();

            stretch10.Append(fillRectangle10);

            blipFill10.Append(blip10);
            blipFill10.Append(sourceRectangle10);
            blipFill10.Append(stretch10);

            Pic.ShapeProperties shapeProperties10 = new Pic.ShapeProperties() { BlackWhiteMode = A.BlackWhiteModeValues.Auto };

            A.Transform2D transform2D10 = new A.Transform2D();
            A.Offset offset10 = new A.Offset() { X = 0L, Y = 0L };
            A.Extents extents10 = new A.Extents() { Cx = 1447800L, Cy = 314325L };

            transform2D10.Append(offset10);
            transform2D10.Append(extents10);

            A.PresetGeometry presetGeometry10 = new A.PresetGeometry() { Preset = A.ShapeTypeValues.Rectangle };
            A.AdjustValueList adjustValueList10 = new A.AdjustValueList();

            presetGeometry10.Append(adjustValueList10);
            A.NoFill noFill19 = new A.NoFill();

            A.Outline outline10 = new A.Outline() { Width = 9525 };
            A.NoFill noFill20 = new A.NoFill();
            A.Miter miter10 = new A.Miter() { Limit = 800000 };
            A.HeadEnd headEnd10 = new A.HeadEnd();
            A.TailEnd tailEnd10 = new A.TailEnd();

            outline10.Append(noFill20);
            outline10.Append(miter10);
            outline10.Append(headEnd10);
            outline10.Append(tailEnd10);

            shapeProperties10.Append(transform2D10);
            shapeProperties10.Append(presetGeometry10);
            shapeProperties10.Append(noFill19);
            shapeProperties10.Append(outline10);

            picture10.Append(nonVisualPictureProperties10);
            picture10.Append(blipFill10);
            picture10.Append(shapeProperties10);

            graphicData10.Append(picture10);

            graphic10.Append(graphicData10);

            inline10.Append(extent10);
            inline10.Append(effectExtent10);
            inline10.Append(docProperties10);
            inline10.Append(nonVisualGraphicFrameDrawingProperties10);
            inline10.Append(graphic10);

            drawing10.Append(inline10);

            run39.Append(runProperties22);
            run39.Append(drawing10);

            Run run40 = new Run() { RsidRunAddition = "00C91FAF" };
            TabChar tabChar1 = new TabChar();

            run40.Append(tabChar1);

            paragraph27.Append(paragraphProperties26);
            paragraph27.Append(run39);
            paragraph27.Append(run40);

            Paragraph paragraph28 = new Paragraph() { RsidParagraphAddition = "00C91FAF", RsidParagraphProperties = "00C91FAF", RsidRunAdditionDefault = "00C91FAF" };

            ParagraphProperties paragraphProperties27 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId26 = new ParagraphStyleId() { Val = "Disclaimer" };

            ParagraphBorders paragraphBorders1 = new ParagraphBorders();
            TopBorder topBorder3 = new TopBorder() { Val = BorderValues.Single, Color = "66AADD", Size = (UInt32Value)48U, Space = (UInt32Value)1U };

            paragraphBorders1.Append(topBorder3);

            paragraphProperties27.Append(paragraphStyleId26);
            paragraphProperties27.Append(paragraphBorders1);

            paragraph28.Append(paragraphProperties27);

            Table table3 = new Table();

            TableProperties tableProperties3 = new TableProperties();
            TableStyle tableStyle3 = new TableStyle() { Val = "Grilledutableau" };
            TableWidth tableWidth3 = new TableWidth() { Width = "0", Type = TableWidthUnitValues.Auto };

            TableBorders tableBorders3 = new TableBorders();
            TopBorder topBorder4 = new TopBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };
            LeftBorder leftBorder3 = new LeftBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };
            BottomBorder bottomBorder3 = new BottomBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };
            RightBorder rightBorder3 = new RightBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };
            InsideHorizontalBorder insideHorizontalBorder3 = new InsideHorizontalBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };
            InsideVerticalBorder insideVerticalBorder3 = new InsideVerticalBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };

            tableBorders3.Append(topBorder4);
            tableBorders3.Append(leftBorder3);
            tableBorders3.Append(bottomBorder3);
            tableBorders3.Append(rightBorder3);
            tableBorders3.Append(insideHorizontalBorder3);
            tableBorders3.Append(insideVerticalBorder3);
            TableLayout tableLayout3 = new TableLayout() { Type = TableLayoutValues.Fixed };
            TableLook tableLook3 = new TableLook() { Val = "01E0" };

            tableProperties3.Append(tableStyle3);
            tableProperties3.Append(tableWidth3);
            tableProperties3.Append(tableBorders3);
            tableProperties3.Append(tableLayout3);
            tableProperties3.Append(tableLook3);

            TableGrid tableGrid3 = new TableGrid();
            GridColumn gridColumn8 = new GridColumn() { Width = "8388" };
            GridColumn gridColumn9 = new GridColumn() { Width = "540" };

            tableGrid3.Append(gridColumn8);
            tableGrid3.Append(gridColumn9);

            TableRow tableRow4 = new TableRow() { RsidTableRowAddition = "00C91FAF", RsidTableRowProperties = "008F7383" };

            TableRowProperties tableRowProperties2 = new TableRowProperties();
            TableRowHeight tableRowHeight2 = new TableRowHeight() { Val = (UInt32Value)618U };

            tableRowProperties2.Append(tableRowHeight2);

            TableCell tableCell12 = new TableCell();

            TableCellProperties tableCellProperties12 = new TableCellProperties();
            TableCellWidth tableCellWidth12 = new TableCellWidth() { Width = "8388", Type = TableWidthUnitValues.Dxa };

            tableCellProperties12.Append(tableCellWidth12);

            CustomXmlBlock customXmlBlock13 = new CustomXmlBlock() { Uri = "http://hubblereports.com/namespace", Element = "reportdoc" };

            CustomXmlBlock customXmlBlock14 = new CustomXmlBlock() { Uri = "http://hubblereports.com/namespace", Element = "footer" };

            CustomXmlBlock customXmlBlock15 = new CustomXmlBlock() { Uri = "http://hubblereports.com/namespace", Element = "ShortDisclaimer" };

            Paragraph paragraph29 = new Paragraph() { RsidParagraphMarkRevision = "003F1967", RsidParagraphAddition = "00C91FAF", RsidParagraphProperties = "008F7383", RsidRunAdditionDefault = "00C91FAF" };

            ParagraphProperties paragraphProperties28 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId27 = new ParagraphStyleId() { Val = "Disclaimer" };

            ParagraphBorders paragraphBorders2 = new ParagraphBorders();
            TopBorder topBorder5 = new TopBorder() { Val = BorderValues.None, Color = "auto", Size = (UInt32Value)0U, Space = (UInt32Value)0U };

            paragraphBorders2.Append(topBorder5);

            paragraphProperties28.Append(paragraphStyleId27);
            paragraphProperties28.Append(paragraphBorders2);

            Run run41 = new Run() { RsidRunProperties = "004B56C1" };
            Text text29 = new Text();
            text29.Text = "Confidential Proprietary Information of Russell Investments not to be distributed to third party without the express written consent of Russell Investments. Please see Important Legal Information for further information on this material.";

            run41.Append(text29);

            paragraph29.Append(paragraphProperties28);
            paragraph29.Append(run41);

            customXmlBlock15.Append(paragraph29);

            customXmlBlock14.Append(customXmlBlock15);

            customXmlBlock13.Append(customXmlBlock14);

            Paragraph paragraph30 = new Paragraph() { RsidParagraphAddition = "00C91FAF", RsidParagraphProperties = "008F7383", RsidRunAdditionDefault = "00C91FAF" };

            ParagraphProperties paragraphProperties29 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId28 = new ParagraphStyleId() { Val = "FooterLogo" };

            paragraphProperties29.Append(paragraphStyleId28);

            paragraph30.Append(paragraphProperties29);

            tableCell12.Append(tableCellProperties12);
            tableCell12.Append(customXmlBlock13);
            tableCell12.Append(paragraph30);

            TableCell tableCell13 = new TableCell();

            TableCellProperties tableCellProperties13 = new TableCellProperties();
            TableCellWidth tableCellWidth13 = new TableCellWidth() { Width = "540", Type = TableWidthUnitValues.Dxa };
            TableCellVerticalAlignment tableCellVerticalAlignment1 = new TableCellVerticalAlignment() { Val = TableVerticalAlignmentValues.Center };

            tableCellProperties13.Append(tableCellWidth13);
            tableCellProperties13.Append(tableCellVerticalAlignment1);

            Paragraph paragraph31 = new Paragraph() { RsidParagraphMarkRevision = "00FB4EAB", RsidParagraphAddition = "00C91FAF", RsidParagraphProperties = "008F7383", RsidRunAdditionDefault = "00740A1C" };

            ParagraphProperties paragraphProperties30 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId29 = new ParagraphStyleId() { Val = "FooterLogo" };
            Justification justification1 = new Justification() { Val = JustificationValues.Left };

            paragraphProperties30.Append(paragraphStyleId29);
            paragraphProperties30.Append(justification1);

            Run run42 = new Run();

            RunProperties runProperties23 = new RunProperties();
            NoProof noProof11 = new NoProof();
            Languages languages11 = new Languages() { Val = "fr-CA", EastAsia = "fr-CA" };

            runProperties23.Append(noProof11);
            runProperties23.Append(languages11);

            Drawing drawing11 = new Drawing();

            Wp.Anchor anchor1 = new Wp.Anchor() { DistanceFromTop = (UInt32Value)0U, DistanceFromBottom = (UInt32Value)0U, DistanceFromLeft = (UInt32Value)114300U, DistanceFromRight = (UInt32Value)114300U, SimplePos = false, RelativeHeight = (UInt32Value)251657216U, BehindDoc = false, Locked = false, LayoutInCell = true, AllowOverlap = true };
            Wp.SimplePosition simplePosition1 = new Wp.SimplePosition() { X = 0L, Y = 0L };

            Wp.HorizontalPosition horizontalPosition1 = new Wp.HorizontalPosition() { RelativeFrom = Wp.HorizontalRelativePositionValues.Column };
            Wp.PositionOffset positionOffset1 = new Wp.PositionOffset();
            positionOffset1.Text = "398145";

            horizontalPosition1.Append(positionOffset1);

            Wp.VerticalPosition verticalPosition1 = new Wp.VerticalPosition() { RelativeFrom = Wp.VerticalRelativePositionValues.Paragraph };
            Wp.PositionOffset positionOffset2 = new Wp.PositionOffset();
            positionOffset2.Text = "-127635";

            verticalPosition1.Append(positionOffset2);
            Wp.Extent extent11 = new Wp.Extent() { Cx = 1085850L, Cy = 323850L };
            Wp.EffectExtent effectExtent11 = new Wp.EffectExtent() { LeftEdge = 19050L, TopEdge = 0L, RightEdge = 0L, BottomEdge = 0L };
            Wp.WrapNone wrapNone1 = new Wp.WrapNone();
            Wp.DocProperties docProperties11 = new Wp.DocProperties() { Id = (UInt32Value)71U, Name = "Image 71", Description = "RADAR_RLogo" };

            Wp.NonVisualGraphicFrameDrawingProperties nonVisualGraphicFrameDrawingProperties11 = new Wp.NonVisualGraphicFrameDrawingProperties();
            A.GraphicFrameLocks graphicFrameLocks11 = new A.GraphicFrameLocks() { NoChangeAspect = true };

            nonVisualGraphicFrameDrawingProperties11.Append(graphicFrameLocks11);

            A.Graphic graphic11 = new A.Graphic();

            A.GraphicData graphicData11 = new A.GraphicData() { Uri = "http://schemas.openxmlformats.org/drawingml/2006/picture" };

            Pic.Picture picture11 = new Pic.Picture();

            Pic.NonVisualPictureProperties nonVisualPictureProperties11 = new Pic.NonVisualPictureProperties();
            Pic.NonVisualDrawingProperties nonVisualDrawingProperties11 = new Pic.NonVisualDrawingProperties() { Id = (UInt32Value)0U, Name = "Picture 71", Description = "RADAR_RLogo" };

            Pic.NonVisualPictureDrawingProperties nonVisualPictureDrawingProperties11 = new Pic.NonVisualPictureDrawingProperties();
            A.PictureLocks pictureLocks11 = new A.PictureLocks() { NoChangeAspect = true, NoChangeArrowheads = true };

            nonVisualPictureDrawingProperties11.Append(pictureLocks11);

            nonVisualPictureProperties11.Append(nonVisualDrawingProperties11);
            nonVisualPictureProperties11.Append(nonVisualPictureDrawingProperties11);

            Pic.BlipFill blipFill11 = new Pic.BlipFill();
            A.Blip blip11 = new A.Blip() { Embed = "rId2" };
            A.SourceRectangle sourceRectangle11 = new A.SourceRectangle();

            A.Stretch stretch11 = new A.Stretch();
            A.FillRectangle fillRectangle11 = new A.FillRectangle();

            stretch11.Append(fillRectangle11);

            blipFill11.Append(blip11);
            blipFill11.Append(sourceRectangle11);
            blipFill11.Append(stretch11);

            Pic.ShapeProperties shapeProperties11 = new Pic.ShapeProperties() { BlackWhiteMode = A.BlackWhiteModeValues.Auto };

            A.Transform2D transform2D11 = new A.Transform2D();
            A.Offset offset11 = new A.Offset() { X = 0L, Y = 0L };
            A.Extents extents11 = new A.Extents() { Cx = 1085850L, Cy = 323850L };

            transform2D11.Append(offset11);
            transform2D11.Append(extents11);

            A.PresetGeometry presetGeometry11 = new A.PresetGeometry() { Preset = A.ShapeTypeValues.Rectangle };
            A.AdjustValueList adjustValueList11 = new A.AdjustValueList();

            presetGeometry11.Append(adjustValueList11);
            A.NoFill noFill21 = new A.NoFill();

            shapeProperties11.Append(transform2D11);
            shapeProperties11.Append(presetGeometry11);
            shapeProperties11.Append(noFill21);

            picture11.Append(nonVisualPictureProperties11);
            picture11.Append(blipFill11);
            picture11.Append(shapeProperties11);

            graphicData11.Append(picture11);

            graphic11.Append(graphicData11);

            anchor1.Append(simplePosition1);
            anchor1.Append(horizontalPosition1);
            anchor1.Append(verticalPosition1);
            anchor1.Append(extent11);
            anchor1.Append(effectExtent11);
            anchor1.Append(wrapNone1);
            anchor1.Append(docProperties11);
            anchor1.Append(nonVisualGraphicFrameDrawingProperties11);
            anchor1.Append(graphic11);

            drawing11.Append(anchor1);

            run42.Append(runProperties23);
            run42.Append(drawing11);

            paragraph31.Append(paragraphProperties30);
            paragraph31.Append(run42);

            tableCell13.Append(tableCellProperties13);
            tableCell13.Append(paragraph31);

            tableRow4.Append(tableRowProperties2);
            tableRow4.Append(tableCell12);
            tableRow4.Append(tableCell13);

            table3.Append(tableProperties3);
            table3.Append(tableGrid3);
            table3.Append(tableRow4);

            Paragraph paragraph32 = new Paragraph() { RsidParagraphAddition = "00C91FAF", RsidParagraphProperties = "00C91FAF", RsidRunAdditionDefault = "00C91FAF" };

            ParagraphProperties paragraphProperties31 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId30 = new ParagraphStyleId() { Val = "FooterLogo" };

            paragraphProperties31.Append(paragraphStyleId30);

            paragraph32.Append(paragraphProperties31);

            Paragraph paragraph33 = new Paragraph() { RsidParagraphMarkRevision = "00F34666", RsidParagraphAddition = "00C91FAF", RsidParagraphProperties = "00C91FAF", RsidRunAdditionDefault = "00C91FAF" };

            ParagraphProperties paragraphProperties32 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId31 = new ParagraphStyleId() { Val = "FooterPageNumber" };
            SpacingBetweenLines spacingBetweenLines19 = new SpacingBetweenLines() { After = "320" };

            paragraphProperties32.Append(paragraphStyleId31);
            paragraphProperties32.Append(spacingBetweenLines19);

            paragraph33.Append(paragraphProperties32);

            Paragraph paragraph34 = new Paragraph() { RsidParagraphMarkRevision = "00C91FAF", RsidParagraphAddition = "002E7D22", RsidParagraphProperties = "00C91FAF", RsidRunAdditionDefault = "002E7D22" };

            ParagraphProperties paragraphProperties33 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId32 = new ParagraphStyleId() { Val = "Pieddepage" };

            paragraphProperties33.Append(paragraphStyleId32);

            paragraph34.Append(paragraphProperties33);

            footer1.Append(paragraph27);
            footer1.Append(paragraph28);
            footer1.Append(table3);
            footer1.Append(paragraph32);
            footer1.Append(paragraph33);
            footer1.Append(paragraph34);

            footerPart1.Footer = footer1;
        }
Exemplo n.º 42
0
        protected void btnPrint_Click(object sender, EventArgs e)
        {
            try {
                DocumentReplacemetsController cont = new DocumentReplacemetsController();
                List <DocumentReplacemetB>    reps = new List <DocumentReplacemetB>();
                reps = cont.GetDocumentReplacemets(sqlUniqueName);
                string imgFolderPath = Server.MapPath(fileUploadFolder);
                DocumentReplacemetB curRep;
                BookmarkRangeStart  bookmarkRangeStart;
                RadFlowDocument     curDoc = LoadSampleDocument(sqlUniqueName);

                RadFlowDocumentEditor editor = new RadFlowDocumentEditor(curDoc);
                //System.Text.RegularExpressions.Regex textRegex = new System.Text.RegularExpressions.Regex("ΣΑΟΥΣΟΠΟΥΛΟΥ ΑΝΝΑ");
                //editor.ReplaceText("ΣΑΟΥΣΟΠΟΥΛΟΥ ΑΝΝΑ", txtNew.Text, true, true);
                List <BookmarkRangeStart> test = editor.Document.EnumerateChildrenOfType <BookmarkRangeStart>().ToList();
                Telerik.Windows.Documents.Flow.Model.TableCell currCell;
                Run currRun;

                Header defaultHeader = editor.Document.Sections.First().Headers.Default;
                Footer defaultFooter = editor.Document.Sections.First().Footers.Default;
                //Telerik.Windows.Documents.Flow.Model.Table headerTable = defaultHeader.Blocks.OfType<Telerik.Windows.Documents.Flow.Model.Table>().First();
                //Telerik.Windows.Documents.Flow.Model.TableCell firstCell = headerTable.Rows[0].Cells[0];

                Telerik.Windows.Documents.Flow.Model.Styles.Style tableStyle = new Telerik.Windows.Documents.Flow.Model.Styles.Style("TableStyle", StyleType.Table);
                tableStyle.Name = "Table Style";
                tableStyle.TableProperties.Borders.LocalValue               = new TableBorders(new Border(1, Telerik.Windows.Documents.Flow.Model.Styles.BorderStyle.Single, new ThemableColor(System.Windows.Media.Colors.Black)));
                tableStyle.TableProperties.Alignment.LocalValue             = Alignment.Left;
                tableStyle.TableCellProperties.VerticalAlignment.LocalValue = VerticalAlignment.Center;
                tableStyle.TableCellProperties.PreferredWidth.LocalValue    = new TableWidthUnit(TableWidthUnitType.Percent, 100);
                tableStyle.TableCellProperties.Padding.LocalValue           = new Telerik.Windows.Documents.Primitives.Padding(8);
                editor.Document.StyleRepository.Add(tableStyle);

                curRep   = reps.Find(o => o.UniqueName == "KET_Header_OTELogo");
                currCell = (Telerik.Windows.Documents.Flow.Model.TableCell)test.Where(o => o.Bookmark.Name == curRep.BookmarkTitle).FirstOrDefault().Paragraph.BlockContainer;
                using (Stream firstImage = File.OpenRead(imgFolderPath + curRep.Text)) {
                    var inImage = ((Paragraph)currCell.Blocks.First()).Inlines.AddImageInline();
                    inImage.Image.ImageSource = new Telerik.Windows.Documents.Media.ImageSource(firstImage, curRep.Text.Split('.').Last());
                    if (curRep.ImageHeight != null && curRep.ImageWidth != null)
                    {
                        inImage.Image.Height = curRep.ImageHeight.Value;
                        inImage.Image.Width  = curRep.ImageWidth.Value;
                    }
                }

                curRep       = reps.Find(o => o.UniqueName == "KET_Header_OTEMoto");
                currCell     = (Telerik.Windows.Documents.Flow.Model.TableCell)test.Where(o => o.Bookmark.Name == curRep.BookmarkTitle).FirstOrDefault().Paragraph.BlockContainer;
                currRun      = ((Paragraph)currCell.Blocks.First()).Inlines.AddRun();
                currRun.Text = curRep.Text;
                currRun.Properties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
                currRun.Properties.FontSize.LocalValue   = 13.0;
                currRun.Properties.FontWeight.LocalValue = FontWeights.Normal;
                currRun.Properties.FontStyle.LocalValue  = FontStyles.Normal;

                curRep       = reps.Find(o => o.UniqueName == "KET_Header_Title");
                currCell     = (Telerik.Windows.Documents.Flow.Model.TableCell)test.Where(o => o.Bookmark.Name == curRep.BookmarkTitle).FirstOrDefault().Paragraph.BlockContainer;
                currRun      = ((Paragraph)currCell.Blocks.First()).Inlines.AddRun();
                currRun.Text = curRep.Text;
                currRun.Properties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
                currRun.Properties.FontSize.LocalValue   = 15.0;
                currRun.Properties.FontWeight.LocalValue = FontWeights.Bold;
                currRun.Properties.FontStyle.LocalValue  = FontStyles.Normal;

                curRep   = reps.Find(o => o.UniqueName == "KET_Header_Department");
                currCell = (Telerik.Windows.Documents.Flow.Model.TableCell)test.Where(o => o.Bookmark.Name == curRep.BookmarkTitle).FirstOrDefault().Paragraph.BlockContainer;
                string[]  arrText = curRep.Text.Replace("\r\n", "#").Replace("\n", "#").Split(new char[] { '#' });
                Paragraph newPar  = (Paragraph)currCell.Blocks.First();
                newPar.Properties.TextAlignment.LocalValue = Alignment.Center;
                editor.MoveToInlineStart(((Paragraph)currCell.Blocks.First()).Inlines.First());
                for (int i = 0; i < arrText.Length; i++)
                {
                    currRun = editor.InsertLine(arrText[i]);
                    currRun.Paragraph.Properties.TextAlignment.LocalValue = Alignment.Center;
                    currRun.Properties.FontFamily.LocalValue = new ThemableFontFamily("Times New Roman");
                    currRun.Properties.FontSize.LocalValue   = 15.0;
                    currRun.Properties.FontWeight.LocalValue = FontWeights.Normal;
                    currRun.Properties.FontStyle.LocalValue  = FontStyles.Normal;
                }
                currCell.Blocks.Remove(currCell.Blocks.Last());

                curRep       = reps.Find(o => o.UniqueName == "KET_Header_EDEPPOI");
                currCell     = (Telerik.Windows.Documents.Flow.Model.TableCell)test.Where(o => o.Bookmark.Name == curRep.BookmarkTitle).FirstOrDefault().Paragraph.BlockContainer;
                currRun      = ((Paragraph)currCell.Blocks.First()).Inlines.AddRun();
                currRun.Text = curRep.Text;
                currRun.Properties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
                currRun.Properties.FontSize.LocalValue   = 15.0;
                currRun.Properties.FontWeight.LocalValue = FontWeights.Normal;
                currRun.Properties.FontStyle.LocalValue  = FontStyles.Normal;

                curRep   = reps.Find(o => o.UniqueName == "KET_Header_PageNo");
                currCell = (Telerik.Windows.Documents.Flow.Model.TableCell)test.Where(o => o.Bookmark.Name == curRep.BookmarkTitle).FirstOrDefault().Paragraph.BlockContainer;
                editor.MoveToParagraphStart((Paragraph)currCell.Blocks.First());
                editor.InsertText("ΣΕΛΙΔΑ ");
                editor.InsertField("PAGE", "3");
                if (curRep.Text == "Σελίδα Χ από Υ")
                {
                    editor.InsertText(" ΑΠΟ ");
                    editor.InsertField("NUMPAGES", "5");
                }

                curRep             = reps.Find(o => o.UniqueName == "KET_Header_Date");
                bookmarkRangeStart = defaultHeader.EnumerateChildrenOfType <BookmarkRangeStart>().Where(rangeStart => rangeStart.Bookmark.Name == curRep.BookmarkTitle).FirstOrDefault();
                editor.MoveToInlineEnd(bookmarkRangeStart);
                editor.InsertText(DateTime.Now.ToString(curRep.Text, new System.Globalization.CultureInfo("el-GR")));

                curRep             = reps.Find(o => o.UniqueName == "KET_Header_To");
                bookmarkRangeStart = defaultHeader.EnumerateChildrenOfType <BookmarkRangeStart>().Where(rangeStart => rangeStart.Bookmark.Name == curRep.BookmarkTitle).FirstOrDefault();
                editor.MoveToInlineEnd(bookmarkRangeStart);
                editor.InsertText(curRep.Text);

                curRep   = reps.Find(o => o.UniqueName == "KET_Footer_OTELogo");
                currCell = (Telerik.Windows.Documents.Flow.Model.TableCell)test.Where(o => o.Bookmark.Name == curRep.BookmarkTitle).FirstOrDefault().Paragraph.BlockContainer;
                using (Stream firstImage = File.OpenRead(imgFolderPath + curRep.Text)) {
                    var inImage = ((Paragraph)currCell.Blocks.First()).Inlines.AddImageInline();
                    inImage.Image.ImageSource = new Telerik.Windows.Documents.Media.ImageSource(firstImage, curRep.Text.Split('.').Last());
                    if (curRep.ImageHeight != null && curRep.ImageWidth != null)
                    {
                        inImage.Image.Height = curRep.ImageHeight.Value;
                        inImage.Image.Width  = curRep.ImageWidth.Value;
                    }
                }

                curRep   = reps.Find(o => o.UniqueName == "KET_Footer_ELOT");
                currCell = (Telerik.Windows.Documents.Flow.Model.TableCell)test.Where(o => o.Bookmark.Name == curRep.BookmarkTitle).FirstOrDefault().Paragraph.BlockContainer;
                using (Stream firstImage = File.OpenRead(imgFolderPath + curRep.Text)) {
                    var inImage = ((Paragraph)currCell.Blocks.First()).Inlines.AddImageInline();
                    inImage.Image.ImageSource = new Telerik.Windows.Documents.Media.ImageSource(firstImage, curRep.Text.Split('.').Last());
                    if (curRep.ImageHeight != null && curRep.ImageWidth != null)
                    {
                        inImage.Image.Height = curRep.ImageHeight.Value;
                        inImage.Image.Width  = curRep.ImageWidth.Value;
                    }
                }

                List <TaskForH> lstDummy = createDummyList();
                bookmarkRangeStart = editor.Document.EnumerateChildrenOfType <BookmarkRangeStart>().Where(rangeStart => rangeStart.Bookmark.Name == "Body_Main").FirstOrDefault();
                editor.MoveToInlineEnd(bookmarkRangeStart);
                Telerik.Windows.Documents.Flow.Model.Table tblContent = editor.InsertTable();
                tblContent.StyleId    = "TableStyle";
                tblContent.LayoutType = TableLayoutType.AutoFit;
                ThemableColor cellBackground = new ThemableColor(System.Windows.Media.Colors.Beige);
                for (int i = 0; i < lstDummy.Count; i++)
                {
                    Telerik.Windows.Documents.Flow.Model.TableRow row = tblContent.Rows.AddTableRow();
                    for (int j = 0; j < 5; j++)
                    {
                        Telerik.Windows.Documents.Flow.Model.TableCell cell = row.Cells.AddTableCell();
                        if (i == 0)
                        {
                            if (j == 0)
                            {
                                currRun = cell.Blocks.AddParagraph().Inlines.AddRun("A/A");
                                currRun.Properties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
                                currRun.Properties.FontSize.LocalValue   = 15.0;
                                currRun.Properties.FontWeight.LocalValue = FontWeights.Bold;
                                currRun.Properties.FontStyle.LocalValue  = FontStyles.Normal;
                                cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 5);
                            }
                            else if (j == 1)
                            {
                                currRun = cell.Blocks.AddParagraph().Inlines.AddRun("ΑΙΤΩΝ");
                                currRun.Properties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
                                currRun.Properties.FontSize.LocalValue   = 15.0;
                                currRun.Properties.FontWeight.LocalValue = FontWeights.Bold;
                                currRun.Properties.FontStyle.LocalValue  = FontStyles.Normal;
                                cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 20);
                            }
                            else if (j == 2)
                            {
                                currRun = cell.Blocks.AddParagraph().Inlines.AddRun("ΑΠΟ");
                                currRun.Properties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
                                currRun.Properties.FontSize.LocalValue   = 15.0;
                                currRun.Properties.FontWeight.LocalValue = FontWeights.Bold;
                                currRun.Properties.FontStyle.LocalValue  = FontStyles.Normal;
                                cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 20);
                            }
                            else if (j == 3)
                            {
                                currRun = cell.Blocks.AddParagraph().Inlines.AddRun("ΩΡΑ");
                                currRun.Properties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
                                currRun.Properties.FontSize.LocalValue   = 15.0;
                                currRun.Properties.FontWeight.LocalValue = FontWeights.Bold;
                                currRun.Properties.FontStyle.LocalValue  = FontStyles.Normal;
                                cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 20);
                            }
                            else if (j == 4)
                            {
                                currRun = cell.Blocks.AddParagraph().Inlines.AddRun("ΠΑΡΑΤΗΡΗΣΕΙΣ");
                                currRun.Properties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
                                currRun.Properties.FontSize.LocalValue   = 15.0;
                                currRun.Properties.FontWeight.LocalValue = FontWeights.Bold;
                                currRun.Properties.FontStyle.LocalValue  = FontStyles.Normal;
                                cell.PreferredWidth = new TableWidthUnit(TableWidthUnitType.Percent, 35);
                            }
                        }
                        else
                        {
                            if (j == 0)
                            {
                                currRun = cell.Blocks.AddParagraph().Inlines.AddRun(lstDummy.Where(o => o.Count == i).FirstOrDefault().Count.ToString());
                                currRun.Properties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
                                currRun.Properties.FontSize.LocalValue   = 15.0;
                                currRun.Properties.FontWeight.LocalValue = FontWeights.Bold;
                                currRun.Properties.FontStyle.LocalValue  = FontStyles.Normal;
                            }
                            else if (j == 1)
                            {
                                cell.Blocks.AddParagraph().Inlines.AddRun(lstDummy.Where(o => o.Count == i).FirstOrDefault().Customer);
                            }
                            else if (j == 2)
                            {
                                cell.Blocks.AddParagraph().Inlines.AddRun(lstDummy.Where(o => o.Count == i).FirstOrDefault().FromPlace);
                            }
                            else if (j == 3)
                            {
                                cell.Blocks.AddParagraph().Inlines.AddRun(lstDummy.Where(o => o.Count == i).FirstOrDefault().FromTime + " - " + lstDummy.Where(o => o.Count == i).FirstOrDefault().ToTime);
                            }
                            else if (j == 4)
                            {
                                cell.Blocks.AddParagraph().Inlines.AddRun(lstDummy.Where(o => o.Count == i).FirstOrDefault().Comments);
                            }
                        }
                    }
                }
                curDoc.UpdateFields();
                exportDOCX(curDoc);
            }
            catch (Exception ex) { }
        }
Exemplo n.º 43
0
 /// <summary>
 /// Returns an <see cref="Array"/> with items from the <see cref="Footer"/> <see cref="Stack"/>.
 /// </summary>
 /// <returns></returns>
 public T[] GetFooter() => Footer.ToArray();
Exemplo n.º 44
0
            /// <summary>
            /// Adds a footer to the embed message
            /// </summary>
            /// <param name="text">Text to be added to the footer</param>
            /// <param name="iconUrl">Icon url to add in the footer. Appears to the left of the text</param>
            /// <param name="proxyIconUrl">Backup icon url. Can be left null if you only have one icon url</param>
            /// <returns>This</returns>
            public Embed AddFooter(string text, string iconUrl = null, string proxyIconUrl = null)
            {
                Footer = new Footer(text, iconUrl, proxyIconUrl);

                return(this);
            }
Exemplo n.º 45
0
        // Generates content of footerPart1.
        private void GenerateFooterPart1Content(FooterPart footerPart1)
        {
            Footer footer1 = new Footer() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 w15 w16se wp14" } };
            footer1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
            footer1.AddNamespaceDeclaration("cx", "http://schemas.microsoft.com/office/drawing/2014/chartex");
            footer1.AddNamespaceDeclaration("cx1", "http://schemas.microsoft.com/office/drawing/2015/9/8/chartex");
            footer1.AddNamespaceDeclaration("cx2", "http://schemas.microsoft.com/office/drawing/2015/10/21/chartex");
            footer1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            footer1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
            footer1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            footer1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
            footer1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
            footer1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
            footer1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
            footer1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
            footer1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            footer1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            footer1.AddNamespaceDeclaration("w15", "http://schemas.microsoft.com/office/word/2012/wordml");
            footer1.AddNamespaceDeclaration("w16se", "http://schemas.microsoft.com/office/word/2015/wordml/symex");
            footer1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
            footer1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
            footer1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
            footer1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");

            SdtBlock sdtBlock1 = new SdtBlock();

            SdtProperties sdtProperties50 = new SdtProperties();
            SdtId sdtId50 = new SdtId() { Val = -1161223993 };

            SdtContentDocPartObject sdtContentDocPartObject1 = new SdtContentDocPartObject();
            DocPartGallery docPartGallery1 = new DocPartGallery() { Val = "Page Numbers (Bottom of Page)" };
            DocPartUnique docPartUnique1 = new DocPartUnique();

            sdtContentDocPartObject1.Append(docPartGallery1);
            sdtContentDocPartObject1.Append(docPartUnique1);

            sdtProperties50.Append(sdtId50);
            sdtProperties50.Append(sdtContentDocPartObject1);
            SdtEndCharProperties sdtEndCharProperties50 = new SdtEndCharProperties();

            SdtContentBlock sdtContentBlock1 = new SdtContentBlock();

            Paragraph paragraph369 = new Paragraph() { RsidParagraphAddition = "0094109A", RsidParagraphProperties = "00697199", RsidRunAdditionDefault = "00A563A2", ParagraphId = "3CF2B95B", TextId = "59B2ED64" };

            ParagraphProperties paragraphProperties366 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId26 = new ParagraphStyleId() { Val = "Footer" };

            paragraphProperties366.Append(paragraphStyleId26);

            Hyperlink hyperlink1 = new Hyperlink() { History = true, Id = "rId1" };

            Run run738 = new Run() { RsidRunProperties = "00697199", RsidRunAddition = "00697199" };

            RunProperties runProperties780 = new RunProperties();
            FontSize fontSize1048 = new FontSize() { Val = "20" };
            FontSizeComplexScript fontSizeComplexScript1034 = new FontSizeComplexScript() { Val = "20" };

            runProperties780.Append(fontSize1048);
            runProperties780.Append(fontSizeComplexScript1034);
            Text text700 = new Text();
            text700.Text = "BJC IS Tech Management Standards";

            run738.Append(runProperties780);
            run738.Append(text700);

            hyperlink1.Append(run738);

            Run run739 = new Run() { RsidRunProperties = "00697199", RsidRunAddition = "00697199" };

            RunProperties runProperties781 = new RunProperties();
            FontSize fontSize1049 = new FontSize() { Val = "20" };
            FontSizeComplexScript fontSizeComplexScript1035 = new FontSizeComplexScript() { Val = "20" };

            runProperties781.Append(fontSize1049);
            runProperties781.Append(fontSizeComplexScript1035);
            Text text701 = new Text() { Space = SpaceProcessingModeValues.Preserve };
            text701.Text = "  can be found at: ";

            run739.Append(runProperties781);
            run739.Append(text701);

            Hyperlink hyperlink2 = new Hyperlink() { History = true, Id = "rId2" };

            Run run740 = new Run() { RsidRunProperties = "00697199", RsidRunAddition = "00697199" };

            RunProperties runProperties782 = new RunProperties();
            RunStyle runStyle2 = new RunStyle() { Val = "Hyperlink" };
            FontSize fontSize1050 = new FontSize() { Val = "20" };
            FontSizeComplexScript fontSizeComplexScript1036 = new FontSizeComplexScript() { Val = "20" };

            runProperties782.Append(runStyle2);
            runProperties782.Append(fontSize1050);
            runProperties782.Append(fontSizeComplexScript1036);
            Text text702 = new Text();
            text702.Text = "http://bjcis/sites/techservices/Informational%20Documents/Forms/AllItems.aspx";

            run740.Append(runProperties782);
            run740.Append(text702);

            hyperlink2.Append(run740);

            Run run741 = new Run() { RsidRunProperties = "00697199", RsidRunAddition = "00697199" };

            RunProperties runProperties783 = new RunProperties();
            FontSize fontSize1051 = new FontSize() { Val = "20" };
            FontSizeComplexScript fontSizeComplexScript1037 = new FontSizeComplexScript() { Val = "20" };

            runProperties783.Append(fontSize1051);
            runProperties783.Append(fontSizeComplexScript1037);
            TabChar tabChar45 = new TabChar();

            run741.Append(runProperties783);
            run741.Append(tabChar45);

            Run run742 = new Run() { RsidRunAddition = "00697199" };

            RunProperties runProperties784 = new RunProperties();
            FontSize fontSize1052 = new FontSize() { Val = "20" };
            FontSizeComplexScript fontSizeComplexScript1038 = new FontSizeComplexScript() { Val = "20" };

            runProperties784.Append(fontSize1052);
            runProperties784.Append(fontSizeComplexScript1038);
            Text text703 = new Text() { Space = SpaceProcessingModeValues.Preserve };
            text703.Text = "       ";

            run742.Append(runProperties784);
            run742.Append(text703);

            SdtRun sdtRun50 = new SdtRun();

            SdtProperties sdtProperties51 = new SdtProperties();

            RunProperties runProperties785 = new RunProperties();
            FontSize fontSize1053 = new FontSize() { Val = "20" };
            FontSizeComplexScript fontSizeComplexScript1039 = new FontSizeComplexScript() { Val = "20" };

            runProperties785.Append(fontSize1053);
            runProperties785.Append(fontSizeComplexScript1039);
            SdtId sdtId51 = new SdtId() { Val = 860082579 };

            SdtContentDocPartObject sdtContentDocPartObject2 = new SdtContentDocPartObject();
            DocPartGallery docPartGallery2 = new DocPartGallery() { Val = "Page Numbers (Top of Page)" };
            DocPartUnique docPartUnique2 = new DocPartUnique();

            sdtContentDocPartObject2.Append(docPartGallery2);
            sdtContentDocPartObject2.Append(docPartUnique2);

            sdtProperties51.Append(runProperties785);
            sdtProperties51.Append(sdtId51);
            sdtProperties51.Append(sdtContentDocPartObject2);

            SdtEndCharProperties sdtEndCharProperties51 = new SdtEndCharProperties();

            RunProperties runProperties786 = new RunProperties();
            FontSize fontSize1054 = new FontSize() { Val = "24" };
            FontSizeComplexScript fontSizeComplexScript1040 = new FontSizeComplexScript() { Val = "24" };

            runProperties786.Append(fontSize1054);
            runProperties786.Append(fontSizeComplexScript1040);

            sdtEndCharProperties51.Append(runProperties786);

            SdtContentRun sdtContentRun50 = new SdtContentRun();

            Run run743 = new Run() { RsidRunAddition = "0094109A" };
            Text text704 = new Text() { Space = SpaceProcessingModeValues.Preserve };
            text704.Text = "Page ";

            run743.Append(text704);

            Run run744 = new Run() { RsidRunAddition = "0094109A" };

            RunProperties runProperties787 = new RunProperties();
            Bold bold109 = new Bold();
            BoldComplexScript boldComplexScript4 = new BoldComplexScript();

            runProperties787.Append(bold109);
            runProperties787.Append(boldComplexScript4);
            FieldChar fieldChar1 = new FieldChar() { FieldCharType = FieldCharValues.Begin };

            run744.Append(runProperties787);
            run744.Append(fieldChar1);

            Run run745 = new Run() { RsidRunAddition = "0094109A" };

            RunProperties runProperties788 = new RunProperties();
            Bold bold110 = new Bold();
            BoldComplexScript boldComplexScript5 = new BoldComplexScript();

            runProperties788.Append(bold110);
            runProperties788.Append(boldComplexScript5);
            FieldCode fieldCode1 = new FieldCode() { Space = SpaceProcessingModeValues.Preserve };
            fieldCode1.Text = " PAGE ";

            run745.Append(runProperties788);
            run745.Append(fieldCode1);

            Run run746 = new Run() { RsidRunAddition = "0094109A" };

            RunProperties runProperties789 = new RunProperties();
            Bold bold111 = new Bold();
            BoldComplexScript boldComplexScript6 = new BoldComplexScript();

            runProperties789.Append(bold111);
            runProperties789.Append(boldComplexScript6);
            FieldChar fieldChar2 = new FieldChar() { FieldCharType = FieldCharValues.Separate };

            run746.Append(runProperties789);
            run746.Append(fieldChar2);

            Run run747 = new Run() { RsidRunAddition = "007F6223" };

            RunProperties runProperties790 = new RunProperties();
            Bold bold112 = new Bold();
            BoldComplexScript boldComplexScript7 = new BoldComplexScript();
            NoProof noProof2 = new NoProof();

            runProperties790.Append(bold112);
            runProperties790.Append(boldComplexScript7);
            runProperties790.Append(noProof2);
            Text text705 = new Text();
            text705.Text = "1";

            run747.Append(runProperties790);
            run747.Append(text705);

            Run run748 = new Run() { RsidRunAddition = "0094109A" };

            RunProperties runProperties791 = new RunProperties();
            Bold bold113 = new Bold();
            BoldComplexScript boldComplexScript8 = new BoldComplexScript();

            runProperties791.Append(bold113);
            runProperties791.Append(boldComplexScript8);
            FieldChar fieldChar3 = new FieldChar() { FieldCharType = FieldCharValues.End };

            run748.Append(runProperties791);
            run748.Append(fieldChar3);

            Run run749 = new Run() { RsidRunAddition = "0094109A" };
            Text text706 = new Text() { Space = SpaceProcessingModeValues.Preserve };
            text706.Text = " of ";

            run749.Append(text706);

            Run run750 = new Run() { RsidRunAddition = "0094109A" };

            RunProperties runProperties792 = new RunProperties();
            Bold bold114 = new Bold();
            BoldComplexScript boldComplexScript9 = new BoldComplexScript();

            runProperties792.Append(bold114);
            runProperties792.Append(boldComplexScript9);
            FieldChar fieldChar4 = new FieldChar() { FieldCharType = FieldCharValues.Begin };

            run750.Append(runProperties792);
            run750.Append(fieldChar4);

            Run run751 = new Run() { RsidRunAddition = "0094109A" };

            RunProperties runProperties793 = new RunProperties();
            Bold bold115 = new Bold();
            BoldComplexScript boldComplexScript10 = new BoldComplexScript();

            runProperties793.Append(bold115);
            runProperties793.Append(boldComplexScript10);
            FieldCode fieldCode2 = new FieldCode() { Space = SpaceProcessingModeValues.Preserve };
            fieldCode2.Text = " NUMPAGES  ";

            run751.Append(runProperties793);
            run751.Append(fieldCode2);

            Run run752 = new Run() { RsidRunAddition = "0094109A" };

            RunProperties runProperties794 = new RunProperties();
            Bold bold116 = new Bold();
            BoldComplexScript boldComplexScript11 = new BoldComplexScript();

            runProperties794.Append(bold116);
            runProperties794.Append(boldComplexScript11);
            FieldChar fieldChar5 = new FieldChar() { FieldCharType = FieldCharValues.Separate };

            run752.Append(runProperties794);
            run752.Append(fieldChar5);

            Run run753 = new Run() { RsidRunAddition = "007F6223" };

            RunProperties runProperties795 = new RunProperties();
            Bold bold117 = new Bold();
            BoldComplexScript boldComplexScript12 = new BoldComplexScript();
            NoProof noProof3 = new NoProof();

            runProperties795.Append(bold117);
            runProperties795.Append(boldComplexScript12);
            runProperties795.Append(noProof3);
            Text text707 = new Text();
            text707.Text = "8";

            run753.Append(runProperties795);
            run753.Append(text707);

            Run run754 = new Run() { RsidRunAddition = "0094109A" };

            RunProperties runProperties796 = new RunProperties();
            Bold bold118 = new Bold();
            BoldComplexScript boldComplexScript13 = new BoldComplexScript();

            runProperties796.Append(bold118);
            runProperties796.Append(boldComplexScript13);
            FieldChar fieldChar6 = new FieldChar() { FieldCharType = FieldCharValues.End };

            run754.Append(runProperties796);
            run754.Append(fieldChar6);

            sdtContentRun50.Append(run743);
            sdtContentRun50.Append(run744);
            sdtContentRun50.Append(run745);
            sdtContentRun50.Append(run746);
            sdtContentRun50.Append(run747);
            sdtContentRun50.Append(run748);
            sdtContentRun50.Append(run749);
            sdtContentRun50.Append(run750);
            sdtContentRun50.Append(run751);
            sdtContentRun50.Append(run752);
            sdtContentRun50.Append(run753);
            sdtContentRun50.Append(run754);

            sdtRun50.Append(sdtProperties51);
            sdtRun50.Append(sdtEndCharProperties51);
            sdtRun50.Append(sdtContentRun50);

            paragraph369.Append(paragraphProperties366);
            paragraph369.Append(hyperlink1);
            paragraph369.Append(run739);
            paragraph369.Append(hyperlink2);
            paragraph369.Append(run741);
            paragraph369.Append(run742);
            paragraph369.Append(sdtRun50);

            sdtContentBlock1.Append(paragraph369);

            sdtBlock1.Append(sdtProperties50);
            sdtBlock1.Append(sdtEndCharProperties50);
            sdtBlock1.Append(sdtContentBlock1);

            Paragraph paragraph370 = new Paragraph() { RsidParagraphAddition = "0094109A", RsidParagraphProperties = "000F55C6", RsidRunAdditionDefault = "0094109A", ParagraphId = "0AAC1AD4", TextId = "7EFCA27E" };

            ParagraphProperties paragraphProperties367 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId27 = new ParagraphStyleId() { Val = "Footer" };
            Justification justification77 = new Justification() { Val = JustificationValues.Center };

            paragraphProperties367.Append(paragraphStyleId27);
            paragraphProperties367.Append(justification77);

            paragraph370.Append(paragraphProperties367);

            footer1.Append(sdtBlock1);
            footer1.Append(paragraph370);

            footerPart1.Footer = footer1;
        }
Exemplo n.º 46
0
        public void I_press_first_Flickr_post()
        {
            var element = Footer.GetFirstFlickrPost();

            element.Click();
        }
Exemplo n.º 47
0
 /// <summary>
 /// Inserts the <paramref name="collection"/> into the <see cref="Footer"/> <see cref="Stack"/>.
 /// </summary>
 /// <param name="collection"></param>
 public void InsertFooter(IEnumerable <T> collection)
 {
     Footer?.GetEnumerator().Dispose();
     Footer = null;
     Footer = new Stack <T>(collection);
 }
Exemplo n.º 48
0
 public int GetTotalLines()
 {
     return((Header.GetLineCount() + Body.GetLineCount() + Footer.GetLineCount()) * (1 + InlineCopies));
 }
Exemplo n.º 49
0
        private void Initialize()
        {
            base.HeaderTitle.Anchor    = Alignment.MiddleCenter;
            base.HeaderTitle.FontStyle = FontStyle.Bold | FontStyle.DropShadow;
            Footer.ChildAnchor         = Alignment.MiddleCenter;
            GuiTextElement t;

            Footer.AddChild(t = new GuiTextElement()
            {
                Text      = "We are NOT in anyway or form affiliated with Mojang/Minecraft or Microsoft!",
                TextColor = TextColor.Yellow,
                Scale     = 1f,
                FontStyle = FontStyle.DropShadow,

                Anchor = Alignment.MiddleCenter
            });

            GuiTextElement info;

            Footer.AddChild(info = new GuiTextElement()
            {
                Text = "We will never collect/store or do anything with your data.",

                TextColor = TextColor.Yellow,
                Scale     = 0.8f,
                FontStyle = FontStyle.DropShadow,

                Anchor  = Alignment.MiddleCenter,
                Padding = new Thickness(0, 5, 0, 0)
            });

            /*
             *  "We will never collect/store or do anything with your data.\n" +
             *                 "You can read more about the authentication method we use on here: https://wiki.vg/Authentication"
             */
            Body.BackgroundOverlay = new Color(Color.Black, 0.5f);
            Body.ChildAnchor       = Alignment.MiddleCenter;

            var usernameRow = AddGuiRow(new GuiTextElement()
            {
                Text   = "Username:"******"Username...",
                Margin      = new Thickness(5),
            });

            usernameRow.ChildAnchor = Alignment.MiddleCenter;

            var passwordRow = AddGuiRow(new GuiTextElement()
            {
                Text   = "Password:"******"Password...",
                Margin          = new Thickness(5),
                IsPasswordInput = true
            });

            passwordRow.ChildAnchor = Alignment.MiddleCenter;

            var buttonRow = AddGuiRow(LoginButton = new GuiButton(OnLoginButtonPressed)
            {
                AccessKey = Keys.Enter,

                Text     = "Login",
                Margin   = new Thickness(5),
                Modern   = false,
                Width    = 100,
                TabIndex = 3
            }, new GuiButton(OnCancelButtonPressed)
            {
                AccessKey = Keys.Escape,

                TranslationKey = "gui.cancel",
                Margin         = new Thickness(5),
                Modern         = false,
                Width          = 100,
                TabIndex       = 4
            });

            buttonRow.ChildAnchor = Alignment.MiddleCenter;

            AddGuiElement(ErrorMessage = new GuiTextElement()
            {
                TextColor = TextColor.Yellow
            });

            Initialized();
        }
Exemplo n.º 50
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head data-contentversion=\"");

            #line 5 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.ContentVersion.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffff")));

            #line default
            #line hidden
            this.Write("\" data-generationversion=\"");

            #line 5 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(GenerationVersion?.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffff") ?? string.Empty));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta charset=\"utf-8\">\r\n    <title>");

            #line 7 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Title.HtmlEncode()));

            #line default
            #line hidden
            this.Write("</title>\r\n    <meta name=\"description\" content=\"");

            #line 8 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Summary.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name=\"author\" content=\"");

            #line 9 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.CreatedBy.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name=\"keywords\" content=\"");

            #line 10 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Tags.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\" >\r\n\r\n    <meta property=\"og:site_name\" content=\"");

            #line 12 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SiteName.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\" />\r\n    <meta property=\"og:url\" content=\"https:");

            #line 13 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(PageUrl));

            #line default
            #line hidden
            this.Write("\" />\r\n    <meta property=\"og:type\" content=\"article\" />\r\n    <meta property=\"og:t" +
                       "itle\" content=\"");

            #line 15 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Title.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\" />\r\n    <meta property=\"og:description\" content=\"");

            #line 16 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Summary.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\" />\r\n\r\n    <link rel = \"schema.DC\" href = \"http://purl.org/DC/elements/1.0/\">\r\n " +
                       "   <meta name=\"DC.Title\" content=\"");

            #line 19 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Title.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name =\"DC.Creator\" content=\"");

            #line 20 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.CreatedBy.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name =\"DC.Publisher\" content=\"");

            #line 21 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SiteName.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name=\"DC.Description\" content=\"");

            #line 22 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.Summary.HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name=\"DC.Date\" content=\"");

            #line 23 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DbEntry.CreatedOn.ToString("yyyy-MM-dd").HtmlEncode()));

            #line default
            #line hidden
            this.Write("\">\r\n    <meta name=\"DC.Format\" content=\"text/html\">\r\n    <meta name=\"DC.Language\"" +
                       " content=\"en-US\">\r\n\r\n    ");

            #line 28 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.OpenGraphImageMetaTags(PictureInformation)));

            #line default
            #line hidden
            this.Write("\r\n\r\n    <link rel=\"alternate\" type=\"application/rss+xml\" \r\n      title=\"");

            #line 32 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture($"RSS Feed for {UserSettingsSingleton.CurrentSettings().SiteName} - Images".HtmlEncode()));

            #line default
            #line hidden
            this.Write("\"\r\n      href=\"https:");

            #line 34 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(UserSettingsSingleton.CurrentSettings().ImageRssUrl()));

            #line default
            #line hidden
            this.Write("\" />\r\n\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"" +
                       ">\r\n\r\n    ");

            #line 39 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.CssStyleFileString()));

            #line default
            #line hidden
            this.Write("\r\n    ");

            #line 40 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.FavIconFileString()));

            #line default
            #line hidden
            this.Write("\r\n\r\n    ");

            #line 42 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SpatialScripts.IncludeIfNeeded(DbEntry)));

            #line default
            #line hidden
            this.Write("\r\n</head>\r\n\r\n<body class=\"single-photo-body\">\r\n    ");

            #line 46 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(PictureInformation.PictureFigureWithCaptionTag("100vw")));

            #line default
            #line hidden
            this.Write("\r\n    ");

            #line 48 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.PostBodyDiv(DbEntry).ToString()));

            #line default
            #line hidden
            this.Write("\r\n    <div class=\"information-section\">\r\n        ");

            #line 50 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.TagList(DbEntry).ToString()));

            #line default
            #line hidden
            this.Write("\r\n        ");

            #line 51 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(BodyContentReferences.RelatedContentTag(DbEntry, GenerationVersion).Result));

            #line default
            #line hidden
            this.Write("\r\n        ");

            #line 53 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.CreatedByAndUpdatedOnDiv(DbEntry).ToString()));

            #line default
            #line hidden
            this.Write("\r\n        ");

            #line 55 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Tags.UpdateNotesDiv(DbEntry).ToString()));

            #line default
            #line hidden
            this.Write("\r\n    </div>\r\n    ");

            #line 57 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(HorizontalRule.StandardRule()));

            #line default
            #line hidden
            this.Write("\r\n    ");

            #line 58 "C:\Code\PointlessWaymarksCms05\PointlessWaymarksCmsData\Html\ImageHtml\SingleImagePage.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Footer.StandardFooterDiv()));

            #line default
            #line hidden
            this.Write("\r\n</body>\r\n\r\n</html>\r\n");
            return(this.GenerationEnvironment.ToString());
        }
Exemplo n.º 51
0
 public Document(Title title, Body body, Footer footer)
 {
     this.title = title;
     this.body = body;
     this.footer = footer;
 }
    protected void LoadSiteContact()
    {
        Footer footer = new Footer();
        DataSet dsContact = new DataSet();
        StringBuilder sb = new StringBuilder();
        dsContact = footer.GetAllSiteContact();
        foreach (DataTable table in dsContact.Tables)
        {
            foreach (DataRow row in table.Rows)
            {
                sb.AppendLine("<img src='" + Global.globalSiteImagesPath + "/" + row["SiteContImage"].ToString() + "' width='78' height='36' />");
                sb.AppendLine("<h3>" + row["SiteContTitle"].ToString() + "</h3>");
                sb.AppendLine("<p>" + row["SiteContAddress"].ToString() + "</p>");
                sb.AppendLine("<h3>Email</h3>");
                sb.AppendLine("<p><span>Customer Service:</span> <a href='mailto:" + row["SiteContEmailCus"].ToString() + "'>" + row["SiteContEmailCus"].ToString() + "</a>");
                sb.AppendLine("<br />");
                sb.AppendLine("<span>Sales:</span> <a href='mailto:" + row["SiteContEmailSal"].ToString() + "'>" + row["SiteContEmailSal"].ToString() + "</a>");
                sb.AppendLine("</p>");
                break;
            }
        }

        PlaceHolder_SiteContact.Controls.Add(new LiteralControl(sb.ToString()));
        sb = null;
    }
Exemplo n.º 53
0
 Footer GetFooter(BinaryReader binReader)
 {
     Footer footer = new Footer();
     binReader.ReadInt32(); //null
     footer.path = GetString(binReader);
     footer.unknown = binReader.ReadBytes(64);
     return footer;
 }
Exemplo n.º 54
0
 public bool Insert(Footer entity)
 {
     db.Footers.Add(entity);
     db.SaveChanges();
     return(true);
 }
Exemplo n.º 55
0
        private void OpenFooter(OXmlOpenFooterElement element)
        {
            CreateSectionProperties();
            //if (element.Header)
            //{
            //HeaderPart headerPart = _mainPart.AddNewPart<HeaderPart>();
            //OpenXmlCompositeElement header = new Header();
            //headerPart.Header = (Header)header;
            //string headerPartId = _mainPart.GetIdOfPart(headerPart);
            //_sectionProperties.AppendChild(new HeaderReference { Id = headerPartId, Type = element.HeaderType });
            //}
            //else
            //{
            FooterPart footerPart = _mainPart.AddNewPart<FooterPart>();
            OpenXmlCompositeElement footer = new Footer();
            footerPart.Footer = (Footer)footer;
            string footerPartId = _mainPart.GetIdOfPart(footerPart);
            _sectionProperties.AppendChild(new FooterReference { Id = footerPartId, Type = element.FooterType });
            //}
            AddHeaderFooterNamespaceDeclaration((OpenXmlPartRootElement)footer);

            SetHeaderFooterProperties(element.FooterType);

            _element = footer;
            //_headerFooter = true;
            _currentElement = OXmlDocElementType.Footer;
        }
        // Generates content of footerPart1.
        private void GenerateFooterPart1Content(FooterPart footerPart1)
        {
            Footer footer1 = new Footer() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = "w14 wp14" } };
            footer1.AddNamespaceDeclaration("wpc", "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
            footer1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            footer1.AddNamespaceDeclaration("o", "urn:schemas-microsoft-com:office:office");
            footer1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            footer1.AddNamespaceDeclaration("m", "http://schemas.openxmlformats.org/officeDocument/2006/math");
            footer1.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");
            footer1.AddNamespaceDeclaration("wp14", "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
            footer1.AddNamespaceDeclaration("wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
            footer1.AddNamespaceDeclaration("w10", "urn:schemas-microsoft-com:office:word");
            footer1.AddNamespaceDeclaration("w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
            footer1.AddNamespaceDeclaration("w14", "http://schemas.microsoft.com/office/word/2010/wordml");
            footer1.AddNamespaceDeclaration("wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
            footer1.AddNamespaceDeclaration("wpi", "http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
            footer1.AddNamespaceDeclaration("wne", "http://schemas.microsoft.com/office/word/2006/wordml");
            footer1.AddNamespaceDeclaration("wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape");

            Paragraph paragraph77 = new Paragraph() { RsidParagraphAddition = "00271936", RsidRunAdditionDefault = "00271936" };

            ParagraphProperties paragraphProperties77 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId2 = new ParagraphStyleId() { Val = "a6" };

            paragraphProperties77.Append(paragraphStyleId2);

            paragraph77.Append(paragraphProperties77);

            Paragraph paragraph78 = new Paragraph() { RsidParagraphAddition = "00271936", RsidRunAdditionDefault = "00271936" };

            ParagraphProperties paragraphProperties78 = new ParagraphProperties();
            ParagraphStyleId paragraphStyleId3 = new ParagraphStyleId() { Val = "a6" };

            paragraphProperties78.Append(paragraphStyleId3);

            paragraph78.Append(paragraphProperties78);

            footer1.Append(paragraph77);
            footer1.Append(paragraph78);

            footerPart1.Footer = footer1;
        }
    protected void LoadSite()
    {
        Footer footer = new Footer();
        DataSet dsSite = new DataSet();

        dsSite = footer.GetSiteInformation();
        foreach (DataTable table in dsSite.Tables)
        {
            foreach (DataRow row in table.Rows)
            {

                _site_Phone = row["sitephone"].ToString();
                _site_Copy = row["sitecopy"].ToString();
                _site_Name = row["sitename"].ToString();
                _site_Description = row["sitedescription"].ToString();
                _site_TagLine = row["sitetagline"].ToString();
                _site_Url = row["siteurl"].ToString();
                _site_Privacy = row["siteprivacy"].ToString();
                _site_Term = row["siteterm"].ToString();
                _site_keyWords = row["SiteKeyWords"].ToString();

                SiteConstants.SiteName = _site_Name;
                SiteConstants.SiteTagLine = _site_TagLine;
                SiteConstants.SiteUrl = _site_Url;
            }
        }

        dsSite = null;
    }
Exemplo n.º 58
0
 public DeletePage(IWebDriver driver)
 {
     _driver = driver;
     Header  = new Header(_driver);
     Footer  = new Footer(_driver);
 }
Exemplo n.º 59
0
        private void Initialize()
        {
            _playerProfileService = GetService <IPlayerProfileService>();
            _playerProfileService.Authenticate += PlayerProfileServiceOnAuthenticate;

            base.HeaderTitle.Anchor    = Alignment.MiddleCenter;
            base.HeaderTitle.FontStyle = FontStyle.Bold | FontStyle.DropShadow;
            Footer.ChildAnchor         = Alignment.MiddleCenter;
            GuiTextElement t;

            Footer.AddChild(t = new GuiTextElement()
            {
                Text      = "We are NOT in anyway or form affiliated with Mojang/Minecraft or Microsoft!",
                TextColor = TextColor.Yellow,
                Scale     = 1f,
                FontStyle = FontStyle.DropShadow,

                Anchor = Alignment.MiddleCenter
            });

            GuiTextElement info;

            Footer.AddChild(info = new GuiTextElement()
            {
                Text = "We will never collect/store or do anything with your data.",

                TextColor = TextColor.Yellow,
                Scale     = 0.8f,
                FontStyle = FontStyle.DropShadow,

                Anchor  = Alignment.MiddleCenter,
                Padding = new Thickness(0, 5, 0, 0)
            });

            Body.BackgroundOverlay = new Color(Color.Black, 0.5f);
            Body.ChildAnchor       = Alignment.MiddleCenter;

            Body.AddChild(_authCodeElement);
            //ShowCode();

            if (CanUseClipboard)
            {
                AddGuiElement(new GuiTextElement()
                {
                    Text = $"If you click Sign-In, the above auth code will be copied to your clipboard!"
                });
            }

            var buttonRow = AddGuiRow(LoginButton = new GuiButton(OnLoginButtonPressed)
            {
                AccessKey = Keys.Enter,

                Text    = "Sign-In with Xbox",
                Margin  = new Thickness(5),
                Modern  = false,
                Width   = 100,
                Enabled = ConnectResponse != null
            }, new GuiButton(OnCancelButtonPressed)
            {
                AccessKey = Keys.Escape,

                TranslationKey = "gui.cancel",
                Margin         = new Thickness(5),
                Modern         = false,
                Width          = 100
            });

            buttonRow.ChildAnchor = Alignment.MiddleCenter;
        }
Exemplo n.º 60
0
        //设置页眉页脚
        //        DocXClass.setHeaderFooter("F:\\example.docx","header","footer");
        public static void setHeaderFooter(string docx, string headerstr, string footerstr)
        {
            if (!File.Exists(docx))
            {
                MessageBox.Show(docx + "文件不存在");
                return;
            }
            DocX document = DocX.Load(docx);

            document.AddHeaders();
            document.AddFooters();
            // Force the first page to have a different Header and Footer.
            document.DifferentFirstPage = false;
            // Force odd & even pages to have different Headers and Footers.
            document.DifferentOddAndEvenPages = false;
            #region 设置第一页、奇偶页眉页脚
            // Get the first, odd and even Headers for this document.
            //Header header_first = document.Headers.first;
            //Header header_odd = document.Headers.odd;
            //Header header_even = document.Headers.even;

            //// Get the first, odd and even Footer for this document.
            //Footer footer_first = document.Footers.first;
            //Footer footer_odd = document.Footers.odd;
            //Footer footer_even = document.Footers.even;

            // Insert a Paragraph into the first Header.
            //Paragraph p0 = header_first.InsertParagraph();
            //p0.Append("Hello First Header.").Bold();



            // Insert a Paragraph into the odd Header.
            //Paragraph p1 = header_odd.InsertParagraph();
            //p1.Append("Hello Odd Header.").Bold();


            //// Insert a Paragraph into the even Header.
            //Paragraph p2 = header_even.InsertParagraph();
            //p2.Append("Hello Even Header.").Bold();

            //// Insert a Paragraph into the first Footer.
            //Paragraph p3 = footer_first.InsertParagraph();
            //p3.Append("Hello First Footer.").Bold();

            //// Insert a Paragraph into the odd Footer.
            //Paragraph p4 = footer_odd.InsertParagraph();
            //p4.Append("Hello Odd Footer.").Bold();

            //// Insert a Paragraph into the even Header.
            //Paragraph p5 = footer_even.InsertParagraph();
            //p5.Append("Hello Even Footer.").Bold();
            #endregion

            #region 插入新页、节
            // Insert a Paragraph into the document.
            //Paragraph p6 = document.InsertParagraph();
            //p6.AppendLine("Hello First page.");

            //// Create a second page to show that the first page has its own header and footer.
            //p6.InsertPageBreakAfterSelf();

            //// Insert a Paragraph after the page break.
            //Paragraph p7 = document.InsertParagraph();
            //p7.AppendLine("Hello Second page.");

            //// Create a third page to show that even and odd pages have different headers and footers.
            //p7.InsertPageBreakAfterSelf();

            //// Insert a Paragraph after the page break.
            //Paragraph p8 = document.InsertParagraph();
            //p8.AppendLine("Hello Third page.");

            ////Insert a next page break, which is a section break combined with a page break
            //document.InsertSectionPageBreak();

            ////Insert a paragraph after the "Next" page break
            //Paragraph p9 = document.InsertParagraph();
            //p9.Append("Next page section break.");

            ////Insert a continuous section break
            //document.InsertSection();

            //Create a paragraph in the new section
            //var p10 = document.InsertParagraph();
            //p10.Append("Continuous section paragraph.");
            #endregion
            Header header = document.Headers.odd;
            //header.Tables.First().SetBorder(TableBorderType.Bottom, new Border(Novacode.BorderStyle.Tcbs_single, BorderSize.one, 1, Color.Black));
            Paragraph p_header = header.Paragraphs.First();

            p_header.Append(headerstr);//在此处设置格式
            p_header.Alignment = Alignment.center;

            Footer    footer   = document.Footers.odd;
            Paragraph p_footer = footer.Paragraphs.First();
            p_footer.Append(footerstr);
            p_footer.Alignment = Alignment.center;
            //document.Footers.even = footer;
            //document.Footers.odd = footer;

            document.Save();
        }