Inheritance: IDocumentProperties, IStorageItemExtraProperties
Exemplo n.º 1
0
 public static string DocTitle(DocumentProperties doc)
 {
     string txt = "";
     if (doc != null && !String.IsNullOrEmpty(doc.Title))
         txt += "  Title: " + doc.Title;
     return txt;
 }
        private static void GetDocumentProperties(ICollection<StorageFileProperty> results, DocumentProperties props)
        {
            var title = props.Title;
            var authors = props.Author;
            var comment = props.Comment;

            if (!title.IsEmpty())
            {
                if (results.FirstOrDefault(x => x.Name == "Title") == null)
                {
                    results.Add(new StorageFileProperty("Title", title));
                }
            }

            if (authors != null)
            {
                if (results.FirstOrDefault(x => x.Name == "Author") == null)
                {
                    foreach (var author in authors.Where(author => !author.IsEmpty()))
                    {
                        results.Add(new StorageFileProperty("Author", author));
                    }
                }
            }

            if (!comment.IsEmpty())
            {
                if (results.FirstOrDefault(x => x.Name == "Comment") == null)
                {
                    results.Add(new StorageFileProperty("Comment", comment));
                }
            }
        }