private DPAPIBackupKey GetLSASecret(string distinguishedName, BasicSchema schema)
        {
            var secretObj = this.drsConnection.ReplicateSingleObject(distinguishedName);

            secretObj.Schema = schema;
            return(new DPAPIBackupKey(secretObj, this.SecretDecryptor));
        }
Beispiel #2
0
        public Instruction ReadBasicValue(BasicSchema schema)
        {
            if (!DocBuilder.SchemaBasicReader.IBasicReaderMethods.TryGetValue(schema, out var method))
            {
                throw new Exception();
            }

            return(new Instruction.Set(
                       new Instruction.LoadArgument(1),
                       new Instruction.VirtualCall(method)
                       ));
        }
Beispiel #3
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            //Create a new PDF Document. The pdfDoc object represents the PDF document.
            //This document has one page by default and additional pages have to be added.
            PdfDocument pdfDoc = new PdfDocument();
            PdfPage     page   = pdfDoc.Pages.Add();

            // Get xmp object.
            XmpMetadata xmp = pdfDoc.DocumentInformation.XmpMetadata;


            // XMP Basic Schema.
            BasicSchema basic = xmp.BasicSchema;

            basic.Advisory.Add("advisory");
            basic.BaseURL     = new Uri("http://google.com");
            basic.CreateDate  = DateTime.Now;
            basic.CreatorTool = "creator tool";
            basic.Identifier.Add("identifier");
            basic.Label        = "label";
            basic.MetadataDate = DateTime.Now;
            basic.ModifyDate   = DateTime.Now;
            basic.Nickname     = "nickname";
            basic.Rating.Add(-25);

            //Setting various Document properties.
            pdfDoc.DocumentInformation.Title        = "Document Properties Information";
            pdfDoc.DocumentInformation.Author       = "Syncfusion";
            pdfDoc.DocumentInformation.Keywords     = "PDF";
            pdfDoc.DocumentInformation.Subject      = "PDF demo";
            pdfDoc.DocumentInformation.Producer     = "Syncfusion Software";
            pdfDoc.DocumentInformation.CreationDate = DateTime.Now;

            PdfFont  font     = new PdfStandardFont(PdfFontFamily.Helvetica, 10f);
            PdfFont  boldFont = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold);
            PdfBrush brush    = PdfBrushes.Black;

            PdfGraphics     g      = page.Graphics;
            PdfStringFormat format = new PdfStringFormat();

            format.LineSpacing = 10f;

            g.DrawString("Press Ctrl+D to see Document Properties", boldFont, brush, 10, 10);
            g.DrawString("Basic Schema Xml:", boldFont, brush, 10, 50);
            g.DrawString(basic.XmlData.OuterXml, font, brush, new RectangleF(10, 70, 500, 500), format);

            //Defines and set values for Custom metadata and add them to the Pdf document
            CustomSchema custom = new CustomSchema(xmp, "custom", "http://www.syncfusion.com/");

            custom["Company"] = "Syncfusion";
            custom["Website"] = "http://www.syncfusion.com/";
            custom["Product"] = "Essential PDF";


            //Save the PDF Document to disk.
            pdfDoc.Save("Sample.pdf");

            //Message box confirmation to view the created PDF document.
            if (MessageBox.Show("Do you want to view the PDF file?", "PDF File Created",
                                MessageBoxButtons.YesNo, MessageBoxIcon.Information)
                == DialogResult.Yes)
            {
                //Launching the PDF file using the default Application.[Acrobat Reader]
#if NETCORE
                System.Diagnostics.Process process = new System.Diagnostics.Process();
                process.StartInfo = new System.Diagnostics.ProcessStartInfo("Sample.pdf")
                {
                    UseShellExecute = true
                };
                process.Start();
#else
                System.Diagnostics.Process.Start("Sample.pdf");
#endif
                this.Close();
            }
            else
            {
                // Exit
                this.Close();
            }
        }
Beispiel #4
0
 public BasicTypeDescription(Type underlyingType, BasicSchema schema)
 {
     UnderlyingType = underlyingType;
     Schema         = schema;
 }
        public ActionResult DocumentSettings(string InsideBrowser)
        {
            //Create a new PDF Document. The pdfDoc object represents the PDF document.
            //This document has one page by default and additional pages have to be added.
            PdfDocument pdfDoc = new PdfDocument();
            PdfPage     page   = pdfDoc.Pages.Add();

            // Get xmp object.
            XmpMetadata xmp = pdfDoc.DocumentInformation.XmpMetadata;

            // XMP Basic Schema.
            BasicSchema basic = xmp.BasicSchema;

            basic.Advisory.Add("advisory");
            basic.BaseURL     = new Uri("http://google.com");
            basic.CreateDate  = DateTime.Now;
            basic.CreatorTool = "creator tool";
            basic.Identifier.Add("identifier");
            basic.Label        = "label";
            basic.MetadataDate = DateTime.Now;
            basic.ModifyDate   = DateTime.Now;
            basic.Nickname     = "nickname";
            basic.Rating.Add(-25);

            //Setting various Document properties.
            pdfDoc.DocumentInformation.Title        = "Document Properties Information";
            pdfDoc.DocumentInformation.Author       = "Syncfusion";
            pdfDoc.DocumentInformation.Keywords     = "PDF";
            pdfDoc.DocumentInformation.Subject      = "PDF demo";
            pdfDoc.DocumentInformation.Producer     = "Syncfusion Software";
            pdfDoc.DocumentInformation.CreationDate = DateTime.Now;

            PdfFont  font     = new PdfStandardFont(PdfFontFamily.Helvetica, 10f);
            PdfFont  boldFont = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold);
            PdfBrush brush    = PdfBrushes.Black;

            PdfGraphics     g      = page.Graphics;
            PdfStringFormat format = new PdfStringFormat();

            format.LineSpacing = 10f;

            g.DrawString("Press Ctrl+D to see Document Properties", boldFont, brush, 10, 10);
            g.DrawString("Basic Schema Xml:", boldFont, brush, 10, 50);
            g.DrawString(basic.XmlData.OuterXml, font, brush, new RectangleF(10, 70, 500, 500), format);

            //Defines and set values for Custom metadata and add them to the Pdf document
            CustomSchema custom = new CustomSchema(xmp, "custom", "//www.syncfusion.com/");

            custom["Company"] = "Syncfusion";
            custom["Website"] = "//www.syncfusion.com/";
            custom["Product"] = "Essential PDF";

            //Stream the output to the browser.
            if (InsideBrowser == "Browser")
            {
                return(pdfDoc.ExportAsActionResult("sample.pdf", HttpContext.ApplicationInstance.Response, HttpReadType.Open));
            }
            else
            {
                return(pdfDoc.ExportAsActionResult("sample.pdf", HttpContext.ApplicationInstance.Response, HttpReadType.Save));
            }
        }
        public void ShouldDeleteASingleItemByItsId()
        {
            using (var searchIndex = SimpleSearch<StandardAnalyzer, BasicSchema>
                .Init(DataSeeder.PathToIndex)
                .Index)
            {
                searchIndex.DeleteAll();

                var doc = new BasicSchema
                {
                    Id = 4,
                    Text = "text"
                };

                searchIndex.AddUpdateLuceneIndex(doc);
                searchIndex.Length().Should().Be(1);
                searchIndex.DeleteByIdentifier(doc);
                searchIndex.Length().Should().Be(0);
            }
        }
Beispiel #7
0
        public ActionResult DocumentSettings(string InsideBrowser)
        {
            //Create a new PDF Document. The pdfDoc object represents the PDF document.
            //This document has one page by default and additional pages have to be added.
            PdfDocument pdfDoc = new PdfDocument();
            PdfPage     page   = pdfDoc.Pages.Add();

            // Get xmp object.
            XmpMetadata xmp = pdfDoc.DocumentInformation.XmpMetadata;

            // XMP Basic Schema.
            BasicSchema basic = xmp.BasicSchema;

            basic.Advisory.Add("advisory");
            basic.BaseURL     = new Uri("http://google.com");
            basic.CreateDate  = DateTime.Now;
            basic.CreatorTool = "creator tool";
            basic.Identifier.Add("identifier");
            basic.Label        = "label";
            basic.MetadataDate = DateTime.Now;
            basic.ModifyDate   = DateTime.Now;
            basic.Nickname     = "nickname";
            basic.Rating.Add(-25);

            //Setting various Document properties.
            pdfDoc.DocumentInformation.Title        = "Document Properties Information";
            pdfDoc.DocumentInformation.Author       = "Syncfusion";
            pdfDoc.DocumentInformation.Keywords     = "PDF";
            pdfDoc.DocumentInformation.Subject      = "PDF demo";
            pdfDoc.DocumentInformation.Producer     = "Syncfusion Software";
            pdfDoc.DocumentInformation.CreationDate = DateTime.Now;

            PdfFont  font     = new PdfStandardFont(PdfFontFamily.Helvetica, 10f);
            PdfFont  boldFont = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold);
            PdfBrush brush    = PdfBrushes.Black;

            PdfGraphics     g      = page.Graphics;
            PdfStringFormat format = new PdfStringFormat();

            format.LineSpacing = 10f;

            g.DrawString("Press Ctrl+D to see Document Properties", boldFont, brush, 10, 10);
            g.DrawString("Basic Schema Xml:", boldFont, brush, 10, 50);
            g.DrawString(basic.XmlData.ToString(), font, brush, new RectangleF(10, 70, 500, 500), format);

            //Defines and set values for Custom metadata and add them to the Pdf document
            CustomSchema custom = new CustomSchema(xmp, "custom", "http://www.syncfusion.com/");

            custom["Company"] = "Syncfusion";
            custom["Website"] = "http://www.syncfusion.com/";
            custom["Product"] = "Essential PDF";

            //Save the PDF to the MemoryStream
            MemoryStream ms = new MemoryStream();

            pdfDoc.Save(ms);

            //If the position is not set to '0' then the PDF will be empty.
            ms.Position = 0;

            //Close the PDF document.
            pdfDoc.Close(true);

            //Download the PDF document in the browser.
            FileStreamResult fileStreamResult = new FileStreamResult(ms, "application/pdf");

            fileStreamResult.FileDownloadName = "DocumentSettings.pdf";
            return(fileStreamResult);
        }