Inheritance: DocumentSystem.Encrypted
コード例 #1
0
        public static IPdfDocument CreatePdfDocument(string name, IList<KeyValuePair<string, object>> parameters)
        {
            var pdfDoc = new PDFDocument(name);
            LoadParameters(parameters, pdfDoc);

            return pdfDoc;
        }
コード例 #2
0
 private static void AddPdfDocument(string[] attributes)
 {
     PDFDocument doc = new PDFDocument();
     AddDocument(attributes, doc);
 }
コード例 #3
0
        private static void AddPdfDocument(string[] attributes)
        {
            PDFDocument doc = new PDFDocument();

            AddDocument(attributes, doc);
        }
コード例 #4
0
        private static void ListDocuments()
        {
            //
            if (documents.Count == 0)
            {
                Console.WriteLine("No documents found");
            }
            foreach (var item in documents)
            {
                if (item is IEncryptable)
                {
                    IEncryptable obj = item as IEncryptable;
                    if (obj.IsEncrypted == true)
                    {
                        Console.WriteLine("{0}[encrypted]", obj.GetType().Name);
                        continue;
                    }
                }

                Type          type = item.GetType();
                StringBuilder sb   = new StringBuilder();
                sb.Append(type.Name + "[");
                if (type.Name == "TextDocument")
                {
                    TextDocument doc = item as TextDocument;
                    if (doc.Charset != null)
                    {
                        sb.AppendFormat("charset={0};", doc.Charset);
                    }
                    if (doc.Content != null)
                    {
                        sb.AppendFormat("content={0};", doc.Content);
                    }
                    sb.AppendFormat("name={0}", doc.Name);
                }
                else if (type.Name == "PDFDocument")
                {
                    PDFDocument doc = item as PDFDocument;
                    if (doc.Content != null)
                    {
                        sb.AppendFormat("content={0};", doc.Content);
                    }
                    sb.AppendFormat("name={0}", doc.Name);
                    if (doc.Pages != null)
                    {
                        sb.AppendFormat(";pages={0}", doc.Pages);
                    }
                    if (doc.Size != null)
                    {
                        sb.AppendFormat(";size={0}", doc.Size);
                    }
                }
                else if (type.Name == "WordDocument")
                {
                    WordDocument doc = item as WordDocument;
                    if (doc.Chars != null)
                    {
                        sb.AppendFormat("chars={0};", doc.Chars);
                    }
                    if (doc.Content != null)
                    {
                        sb.AppendFormat("content={0};", doc.Content);
                    }
                    sb.AppendFormat("name={0}", doc.Name);
                    if (doc.Size != null)
                    {
                        sb.AppendFormat(";size={0}", doc.Size);
                    }
                    if (doc.Version != null)
                    {
                        sb.AppendFormat(";version={0}", doc.Version);
                    }
                }
                else if (type.Name == "ExcelDocument")
                {
                    ExcelDocument doc = item as ExcelDocument;
                    if (doc.Cols != null)
                    {
                        sb.AppendFormat("cols={0};", doc.Cols);
                    }
                    if (doc.Content != null)
                    {
                        sb.AppendFormat("content={0};", doc.Content);
                    }
                    sb.AppendFormat("name={0}", doc.Name);
                    if (doc.Rows != null)
                    {
                        sb.AppendFormat(";rows={0}", doc.Rows);
                    }
                    if (doc.Size != null)
                    {
                        sb.AppendFormat(";size={0}", doc.Size);
                    }
                    if (doc.Version != null)
                    {
                        sb.AppendFormat(";version={0}", doc.Version);
                    }
                }
                else if (type.Name == "AudioDocument")
                {
                    AudioDocument doc = item as AudioDocument;
                    if (doc.Content != null)
                    {
                        sb.AppendFormat("content={0};", doc.Content);
                    }
                    if (doc.Length != null)
                    {
                        sb.AppendFormat("length={0};", doc.Length);
                    }
                    sb.AppendFormat("name={0}", doc.Name);
                    if (doc.Samplerate != null)
                    {
                        sb.AppendFormat(";samplerate={0}", doc.Samplerate);
                    }
                    if (doc.Size != null)
                    {
                        sb.AppendFormat(";size={0}", doc.Size);
                    }
                }
                else if (type.Name == "VideoDocument")
                {
                    VideoDocument doc = item as VideoDocument;
                    if (doc.Content != null)
                    {
                        sb.AppendFormat("content={0};", doc.Content);
                    }
                    if (doc.Framerate != null)
                    {
                        sb.AppendFormat("framerate={0};", doc.Framerate);
                    }
                    sb.AppendFormat("name={0}", doc.Name);
                    if (doc.Length != null)
                    {
                        sb.AppendFormat(";length={0}", doc.Length);
                    }
                    if (doc.Size != null)
                    {
                        sb.AppendFormat(";size={0}", doc.Size);
                    }
                }
                sb.Append("]");
                Console.WriteLine(sb.ToString());
            }
        }