File tree Expand file tree Collapse file tree 2 files changed +6
-24
lines changed
Orm/Xtensive.Orm/Orm/Model Expand file tree Collapse file tree 2 files changed +6
-24
lines changed Original file line number Diff line number Diff line change @@ -249,8 +249,7 @@ public override bool Equals(object obj) =>
249249 /// </summary>
250250 public ColumnInfo Clone ( )
251251 {
252- ColumnInfo clone = new ColumnInfo ( fld ) ;
253- clone . Name = Name ;
252+ ColumnInfo clone = new ( fld ) { Name = Name } ;
254253 clone . attributes = attributes ;
255254 clone . valueType = valueType ;
256255 clone . length = length ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ namespace Xtensive.Orm.Model
1515 ///An abstract base class for model node.
1616 /// </summary>
1717 [ Serializable ]
18- public abstract class Node : LockableBase , IChangeNotifier
18+ public abstract class Node : LockableBase
1919 {
2020 private string name ;
2121
@@ -24,23 +24,16 @@ public abstract class Node : LockableBase, IChangeNotifier
2424 /// </summary>
2525 public string Name
2626 {
27- get { return name ; }
27+ get => name ;
2828 set {
2929 EnsureNotLocked ( ) ;
30+ if ( name is not null )
31+ throw new InvalidOperationException ( "The node Name is locked." ) ;
3032 ValidateName ( value ) ;
31- ChangeState ( "Name" , delegate { name = value ; } ) ;
33+ name = value ;
3234 }
3335 }
3436
35- private void ChangeState ( string property , Action onChangeStateDelegate )
36- {
37- if ( Changing != null )
38- Changing ( this , new ChangeNotifierEventArgs ( property ) ) ;
39- onChangeStateDelegate ( ) ;
40- if ( Changed != null )
41- Changed ( this , new ChangeNotifierEventArgs ( property ) ) ;
42- }
43-
4437 /// <summary>
4538 /// Performs additional custom processes before setting new name to this instance.
4639 /// </summary>
@@ -49,16 +42,6 @@ protected virtual void ValidateName(string newName)
4942 {
5043 }
5144
52- #region IChangeNotifier Members
53-
54- /// <inheritdoc/>
55- public event EventHandler < ChangeNotifierEventArgs > Changing ;
56-
57- /// <inheritdoc/>
58- public event EventHandler < ChangeNotifierEventArgs > Changed ;
59-
60- #endregion
61-
6245 /// <summary>
6346 /// Updates the internal state of this instance.
6447 /// </summary>
You can’t perform that action at this time.
0 commit comments