Esempio n. 1
0
        private void CompareProperties(OPCPackage p)
        {
            SimpleDateFormat df           = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
            DateTime         expectedDate = DateTime.Parse("2007/05/12T08:00:00Z").ToUniversalTime();

            // Gets the core properties
            PackageProperties props = p.GetPackageProperties();

            Assert.AreEqual("MyCategory", props.GetCategoryProperty());
            Assert.AreEqual("MyContentStatus", props.GetContentStatusProperty()
                            );
            Assert.AreEqual("MyContentType", props.GetContentTypeProperty());
            Assert.AreEqual(expectedDate, props.GetCreatedProperty());
            Assert.AreEqual("MyCreator", props.GetCreatorProperty());
            Assert.AreEqual("MyDescription", props.GetDescriptionProperty());
            Assert.AreEqual("MyIdentifier", props.GetIdentifierProperty());
            Assert.AreEqual("MyKeywords", props.GetKeywordsProperty());
            Assert.AreEqual("MyLanguage", props.GetLanguageProperty());
            Assert.AreEqual("Julien Chable", props.GetLastModifiedByProperty()
                            );
            Assert.AreEqual(expectedDate, props.GetLastPrintedProperty());
            Assert.AreEqual(expectedDate, props.GetModifiedProperty());
            Assert.AreEqual("2", props.GetRevisionProperty());
            Assert.AreEqual("MySubject", props.GetSubjectProperty());
            Assert.AreEqual("MyTitle", props.GetTitleProperty());
            Assert.AreEqual("2", props.GetVersionProperty());
        }
Esempio n. 2
0
 /**
  * Copy core namespace properties
  *
  * @param src source properties
  * @param tgt target properties
  */
 private static void CopyProperties(PackageProperties src, PackageProperties tgt)
 {
     tgt.SetCategoryProperty(src.GetCategoryProperty());
     tgt.SetContentStatusProperty(src.GetContentStatusProperty());
     tgt.SetContentTypeProperty(src.GetContentTypeProperty());
     tgt.SetCreatorProperty(src.GetCreatorProperty());
     tgt.SetDescriptionProperty(src.GetDescriptionProperty());
     tgt.SetIdentifierProperty(src.GetIdentifierProperty());
     tgt.SetKeywordsProperty(src.GetKeywordsProperty());
     tgt.SetLanguageProperty(src.GetLanguageProperty());
     tgt.SetRevisionProperty(src.GetRevisionProperty());
     tgt.SetSubjectProperty(src.GetSubjectProperty());
     tgt.SetTitleProperty(src.GetTitleProperty());
     tgt.SetVersionProperty(src.GetVersionProperty());
 }
Esempio n. 3
0
 /**
  * Copy core namespace properties
  *
  * @param src source properties
  * @param tgt target properties
  */
 private static void CopyProperties(PackageProperties src, PackageProperties tgt)
 {
     tgt.SetCategoryProperty(src.GetCategoryProperty());
     tgt.SetContentStatusProperty(src.GetContentStatusProperty());
     tgt.SetContentTypeProperty(src.GetContentTypeProperty());
     tgt.SetCreatorProperty(src.GetCreatorProperty());
     tgt.SetDescriptionProperty(src.GetDescriptionProperty());
     tgt.SetIdentifierProperty(src.GetIdentifierProperty());
     tgt.SetKeywordsProperty(src.GetKeywordsProperty());
     tgt.SetLanguageProperty(src.GetLanguageProperty());
     tgt.SetRevisionProperty(src.GetRevisionProperty());
     tgt.SetSubjectProperty(src.GetSubjectProperty());
     tgt.SetTitleProperty(src.GetTitleProperty());
     tgt.SetVersionProperty(src.GetVersionProperty());
 }