Example #1
0
        public new TextItemOptions GetOptions()
        {
            var options = new TextItemOptions();

            CopyToOptions(options);
            return(options);
        }
Example #2
0
 public TextItem(string id, string parentId, TextItemOptions options)
     : base(id, parentId, options)
 {
     Protection      = options.Protection;
     LongDescription = options.LongDescription;
     Description     = options.Description;
     StorageMedium   = options.StorageMedium;
     Rating          = options.Rating;
     Date            = options.Date;
     Language        = options.Language;
     Authors         = Helper.MakeReadOnlyCopy(options.Authors);
     Publishers      = Helper.MakeReadOnlyCopy(options.Publishers);
     Contributors    = Helper.MakeReadOnlyCopy(options.Contributors);
     Relations       = Helper.MakeReadOnlyCopy(options.Relations);
     Rights          = Helper.MakeReadOnlyCopy(options.Rights);
 }
Example #3
0
 public TextItem (string id, string parentId, TextItemOptions options)
     : base (id, parentId, options)
 {
     Protection = options.Protection;
     LongDescription = options.LongDescription;
     Description = options.Description;
     StorageMedium = options.StorageMedium;
     Rating = options.Rating;
     Date = options.Date;
     Language = options.Language;
     Authors = Helper.MakeReadOnlyCopy (options.Authors);
     Publishers = Helper.MakeReadOnlyCopy (options.Publishers);
     Contributors = Helper.MakeReadOnlyCopy (options.Contributors);
     Relations = Helper.MakeReadOnlyCopy (options.Relations);
     Rights = Helper.MakeReadOnlyCopy (options.Rights);
 }
Example #4
0
        protected void CopyToOptions(TextItemOptions options)
        {
            base.CopyToOptions(options);

            options.Protection      = Protection;
            options.LongDescription = LongDescription;
            options.Description     = Description;
            options.StorageMedium   = StorageMedium;
            options.Rating          = Rating;
            options.Date            = Date;
            options.Language        = Language;
            options.Authors         = new List <PersonWithRole> (Authors);
            options.Publishers      = new List <string> (Publishers);
            options.Contributors    = new List <string> (Contributors);
            options.Relations       = new List <Uri> (Relations);
            options.Rights          = new List <string> (Rights);
        }
Example #5
0
        protected void CopyToOptions (TextItemOptions options)
        {
            base.CopyToOptions (options);

            options.Protection = Protection;
            options.LongDescription = LongDescription;
            options.Description = Description;
            options.StorageMedium = StorageMedium;
            options.Rating = Rating;
            options.Date = Date;
            options.Language = Language;
            options.Authors = new List<PersonWithRole> (Authors);
            options.Publishers = new List<string> (Publishers);
            options.Contributors = new List<string> (Contributors);
            options.Relations = new List<Uri> (Relations);
            options.Rights = new List<string> (Rights);
        }
Example #6
0
 static void AssertTextItem (TextItem textItem, TextItemOptions options)
 {
     AssertItem (textItem, options);
     Assert.AreEqual (textItem.Protection, options.Protection);
     Assert.AreEqual (textItem.LongDescription, options.LongDescription);
     Assert.AreEqual (textItem.Description, options.Description);
     Assert.AreEqual (textItem.Rating, options.Rating);
     Assert.AreEqual (textItem.Date, options.Date);
     Assert.AreEqual (textItem.Language, options.Language);
     Assert.IsTrue (textItem.Authors.IsReadOnly);
     Assert.IsTrue (textItem.Publishers.IsReadOnly);
     Assert.IsTrue (textItem.Contributors.IsReadOnly);
     Assert.IsTrue (textItem.Relations.IsReadOnly);
     Assert.IsTrue (textItem.Rights.IsReadOnly);
     CollectionAssert.AreEqual (textItem.Authors, options.Authors);
     CollectionAssert.AreEqual (textItem.Publishers, options.Publishers);
     CollectionAssert.AreEqual (textItem.Contributors, options.Contributors);
     CollectionAssert.AreEqual (textItem.Relations, options.Relations);
     CollectionAssert.AreEqual (textItem.Rights, options.Rights);
 }
Example #7
0
 static void SetTextItemOptions (TextItemOptions options)
 {
     SetItemOptions (options);
     options.Protection = "57";
     options.LongDescription = "58";
     options.StorageMedium = "59";
     options.Description = "60";
     options.Rating = "61";
     options.Date = "62";
     options.Language = "63";
     options.Authors = new[] { new PersonWithRole ("artist", "role") };
     options.Publishers = new[] { "publisher" };
     options.Contributors = new[] { "contributor" };
     options.Relations = new[] { new Uri ("http://relation") };
     options.Rights = new[] { "right" };
 }
Example #8
0
 public void TextItemInstantiation ()
 {
     var options = new TextItemOptions ();
     SetTextItemOptions (options);
     var text_item = new TextItem ("-1", "-1", options);
     AssertTextItem (text_item, options);
     AssertTextItem (text_item, text_item.GetOptions ());
 }
Example #9
0
 public new TextItemOptions GetOptions ()
 {
     var options = new TextItemOptions ();
     CopyToOptions (options);
     return options;
 }