Skip to content

Commit

Permalink
Rename Csla.NonSerializedAttribute to NonSerializedPropertyAttribute (#…
Browse files Browse the repository at this point in the history
…4405)

* #4387 Rename Csla.NonSerializedAttribute to NonSerializedPropertyAttribute

* #4387 Rename attribute to DoNotSerialize
  • Loading branch information
rockfordlhotka authored Dec 30, 2024
1 parent e4e8ab6 commit 6f557eb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class DefinitionExtractionContext
private const string _cslaNamespace = "Csla";
private const string _autoSerializableAttributeName = "AutoSerializableAttribute";
private const string _autoSerializedAttributeName = "AutoSerializedAttribute";
private const string _autoNonSerializedAttributeName = "NonSerializedAttribute";
private const string _autoNonSerializedPropertyAttributeName = "NonSerializedPropertyAttribute";
private const string _iMobileObjectInterfaceNamespace = "Csla.Serialization.Mobile";
private const string _iMobileObjectInterfaceName = "IMobileObject";

Expand Down Expand Up @@ -128,7 +128,7 @@ public bool IsPropertyDecoratedWithAutoSerialized(PropertyDeclarationSyntax prop
/// <returns>Boolean true if the property is decorated with the AutoNonSerialized attribute, otherwise false</returns>
public bool IsPropertyDecoratedWithAutoNonSerialized(PropertyDeclarationSyntax propertyDeclaration)
{
return IsPropertyDecoratedWith(propertyDeclaration, _autoNonSerializedAttributeName, _cslaNamespace);
return IsPropertyDecoratedWith(propertyDeclaration, _autoNonSerializedPropertyAttributeName, _cslaNamespace);
}

/// <summary>
Expand All @@ -148,7 +148,7 @@ public bool IsFieldDecoratedWithAutoSerialized(FieldDeclarationSyntax fieldDecla
/// <returns>Boolean true if the field is decorated with the AutoNonSerialized attribute, otherwise false</returns>
public bool IsFieldDecoratedWithAutoNonSerialized(FieldDeclarationSyntax fieldDeclaration)
{
return IsFieldDecoratedWith(fieldDeclaration, _autoNonSerializedAttributeName, _cslaNamespace);
return IsFieldDecoratedWith(fieldDeclaration, _autoNonSerializedPropertyAttributeName, _cslaNamespace);
}

#region Private Helper Methods
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------
// <copyright file="NonSerializedAttribute.cs" company="Marimer LLC">
// <copyright file="NonSerializedPropertyAttribute.cs" company="Marimer LLC">
// Copyright (c) Marimer LLC. All rights reserved.
// Website: https://cslanet.com
// </copyright>
Expand All @@ -12,5 +12,5 @@ namespace Csla
/// Indicate that a public field or property should be excluded from auto serialization
/// </summary>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public class NonSerializedAttribute : Attribute;
public class DoNotSerializeAttribute : Attribute;
}
4 changes: 2 additions & 2 deletions Source/Csla/PropertyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public virtual string FriendlyName
/// Gets or sets a value indicating whether this property is serializable.
/// </summary>
/// <remarks>
/// If the property is marked with the <see cref="Csla.NonSerializedAttribute"/>,
/// If the property is marked with the <see cref="DoNotSerializeAttribute"/>,
/// it is considered not serializable. Otherwise, it is considered serializable.
/// </remarks>
public virtual bool IsSerializable
Expand All @@ -217,7 +217,7 @@ public virtual bool IsSerializable
}
else if (_propertyInfo != null)
{
var nonSerialized = _propertyInfo.GetCustomAttributes(typeof(Csla.NonSerializedAttribute), true).OfType<NonSerializedAttribute>().Any();
var nonSerialized = _propertyInfo.GetCustomAttributes(typeof(DoNotSerializeAttribute), true).OfType<DoNotSerializeAttribute>().Any();
_isSerializable = !nonSerialized;
return !nonSerialized;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/csla.netcore.test/Basic/Root.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public string Data
}

public static PropertyInfo<string> NotSerializableDataProperty = RegisterProperty<string>(c => c.NotSerializableData);
[NonSerialized]
[DoNotSerialize]
public string NotSerializableData
{
get { return GetProperty(NotSerializableDataProperty); }
Expand Down

0 comments on commit 6f557eb

Please sign in to comment.