-
Notifications
You must be signed in to change notification settings - Fork 37
/
Catalog.xsd.cs
81 lines (76 loc) · 2.27 KB
/
Catalog.xsd.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//____________________________________________________________________________________________________________________________________
//
// Copyright (C) 2023, Mariusz Postol LODZ POLAND.
//
// To be in touch join the community by pressing the `Watch` button and get started commenting using the discussion panel at
//
// https://github.com/mpostol/TP/discussions/182
//
// by introducing yourself and telling us what you do with this community.
//_____________________________________________________________________________________________________________________________________
using System.Diagnostics;
using System.Xml.Serialization;
using TP.DataStreams.Serialization;
namespace TP.DataStreams.Instrumentation
{
/// <summary>
/// class catalog
/// </summary>
public partial class Catalog : IStylesheetNameProvider
{
#region IStylesheetNameProvider Members
/// <summary>
/// The stylesheet name
/// </summary>
[XmlIgnore]
public string StylesheetName { get; set; } = "catalog.xslt";
#endregion
[Conditional("DEBUG")]
internal void AddTestingData()
{
CatalogCD _cd1 = new CatalogCD()
{
Artist = "Bob Dylan",
Title = "Empire Burlesque",
Country = "USA",
Company = "Columbia",
Price = 10.90M,
Year = 1985,
};
CatalogCD _cd2 = new CatalogCD
{
Title = "Hide your heart",
Artist = "Bonnie Tyler",
Country = "UK",
Company = "CBS Records",
Price = 9.90M,
Year = 1988
};
CD = new CatalogCD[] { _cd1, _cd2 };
}
}
partial class CatalogCD
{
public static bool operator ==(CatalogCD left, CatalogCD right)
{
return left.Equals(right);
}
public static bool operator !=(CatalogCD left, CatalogCD right)
{
return !left.Equals(right);
}
public override bool Equals(object obj)
{
CatalogCD _catalogCD = obj as CatalogCD ?? throw new System.ArgumentException(nameof(obj), "wrong parameter type");
return ToString() == _catalogCD.ToString();
}
public override int GetHashCode()
{
return ToString().GetHashCode();
}
public override string ToString()
{
return $"{Artist}, {Company}, {Country}, {Price}, {Title}, {Year}";
}
}
}