1
1
using SIPackages . Core ;
2
2
using System . ComponentModel ;
3
3
using System . Diagnostics ;
4
- using System . Text ;
5
4
6
5
namespace SIPackages ;
7
6
8
7
/// <summary>
9
8
/// Defines a question scenario minimal item.
10
9
/// </summary>
11
10
[ Obsolete ]
12
- internal sealed class Atom : PropertyChangedNotifier , ITyped , IEquatable < Atom >
11
+ internal sealed class Atom
13
12
{
14
13
[ DebuggerBrowsable ( DebuggerBrowsableState . Never ) ]
15
14
private string _type = AtomTypes . Text ;
@@ -36,9 +35,7 @@ public string Type
36
35
{
37
36
if ( _type != value )
38
37
{
39
- var oldValue = _type ;
40
38
_type = value ;
41
- OnPropertyChanged ( oldValue ) ;
42
39
}
43
40
}
44
41
}
@@ -54,9 +51,7 @@ public int AtomTime
54
51
{
55
52
if ( _atomTime != value )
56
53
{
57
- var oldValue = _atomTime ;
58
54
_atomTime = value ;
59
- OnPropertyChanged ( oldValue ) ;
60
55
}
61
56
}
62
57
}
@@ -71,44 +66,8 @@ public string Text
71
66
{
72
67
if ( _text != value )
73
68
{
74
- var oldValue = _text ;
75
69
_text = value ;
76
- OnPropertyChanged ( oldValue ) ;
77
70
}
78
71
}
79
72
}
80
-
81
- /// <summary>
82
- /// Does the atom text contain specified value.
83
- /// </summary>
84
- /// <param name="value">Text value.</param>
85
- public bool Contains ( string value ) => _text . IndexOf ( value , StringComparison . CurrentCultureIgnoreCase ) > - 1 ;
86
-
87
- /// <inheritdoc />
88
- public override string ToString ( )
89
- {
90
- if ( _type == AtomTypes . Text )
91
- {
92
- return _text ;
93
- }
94
-
95
- var res = new StringBuilder ( ) ;
96
- res . AppendFormat ( "#{0} " , _type ) ;
97
- res . Append ( _text ) ;
98
-
99
- return res . ToString ( ) ;
100
- }
101
-
102
- /// <inheritdoc />
103
- public bool Equals ( Atom ? other ) =>
104
- other is not null
105
- && Type . Equals ( other . Type )
106
- && AtomTime . Equals ( other . AtomTime )
107
- && Text . Equals ( other . Text ) ;
108
-
109
- /// <inheritdoc />
110
- public override bool Equals ( object ? obj ) => Equals ( obj as Atom ) ;
111
-
112
- /// <inheritdoc />
113
- public override int GetHashCode ( ) => HashCode . Combine ( base . GetHashCode ( ) , Type , AtomTime , Text ) ;
114
73
}
0 commit comments