Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataMemberAttribute"/> class.
 /// </summary>
 /// <param name="order">The order.</param>
 /// <param name="name">The name.</param>
 /// <param name="mode">The mode.</param>
 public DataMemberAttribute(int order, string name, DataMemberMode mode)
 {
     Order     = order;
     this.name = name;
     this.mode = mode;
 }
Ejemplo n.º 2
0
        internal static bool IsMemberIgnored(ICollection <CustomAttribute> customAttributes, ComplexTypeSerializerFlags flags, DataMemberMode dataMemberMode)
        {
            // Check for DataMemberIgnore
            if (customAttributes.Any(x => x.AttributeType.FullName == "Stride.Core.DataMemberIgnoreAttribute"))
            {
                // Still allow members with DataMemberUpdatable if we are running UpdateEngineProcessor
                if (!((flags & ComplexTypeSerializerFlags.Updatable) != 0 &&
                      customAttributes.Any(x => x.AttributeType.FullName == "Stride.Updater.DataMemberUpdatableAttribute")))
                {
                    return(true);
                }
            }
            var dataMemberAttribute = customAttributes.FirstOrDefault(x => x.AttributeType.FullName == "Stride.Core.DataMemberAttribute");

            if (dataMemberAttribute != null)
            {
                var dataMemberModeArg = dataMemberAttribute.ConstructorArguments.FirstOrDefault(x => x.Type.Name == nameof(DataMemberMode));
                if (dataMemberModeArg.Value != null)
                {
                    dataMemberMode = (DataMemberMode)(int)dataMemberModeArg.Value;
                }
                else
                {
                    // Default value if not specified in .ctor
                    dataMemberMode = DataMemberMode.Default;
                }
            }

            // Ignored?
            if (dataMemberMode == DataMemberMode.Never)
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Specify the way to store a property or field of some class or structure.
 /// </summary>
 /// <param name="mode">The serialize method.</param>
 public DataMemberAttribute(DataMemberMode mode)
 {
     this.mode = mode;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataMemberAttribute"/> class.
 /// </summary>
 /// <param name="order">The order.</param>
 /// <param name="mode">The mode.</param>
 public DataMemberAttribute(int order, DataMemberMode mode)
 {
     Order     = order;
     this.mode = mode;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataMemberAttribute"/> class.
 /// </summary>
 /// <param name="order">The order.</param>
 /// <param name="name">The name.</param>
 /// <param name="mode">The mode.</param>
 public DataMemberAttribute(int order, string name, DataMemberMode mode)
 {
     Order = order;
     this.name = name;
     this.mode = mode;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Specify the way to store a property or field of some class or structure.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="mode">The serialize method.</param>
 public DataMemberAttribute(string name, DataMemberMode mode)
 {
     this.name = name;
     this.mode = mode;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataMemberAttribute"/> class.
 /// </summary>
 /// <param name="order">The order.</param>
 /// <param name="mode">The mode.</param>
 public DataMemberAttribute(int order, DataMemberMode mode)
 {
     Order = order;
     this.mode = mode;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Specify the way to store a property or field of some class or structure.
 /// </summary>
 /// <param name="mode">The serialize method.</param>
 public DataMemberAttribute(DataMemberMode mode)
 {
     this.mode = mode;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Specify the way to store a property or field of some class or structure.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="mode">The serialize method.</param>
 public DataMemberAttribute(string name, DataMemberMode mode)
 {
     this.name = name;
     this.mode = mode;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Specify the way to store a property or field of some class or structure.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="mode">The serialize method.</param>
 public DataMemberAttribute(string name, DataMemberMode mode)
 {
     Name = name;
     Mode = mode;
 }
 /// <summary>
 /// Specify the way to store a property or field of some class or structure.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="mode">The serialize method.</param>
 public DataMemberAttribute(string name, DataMemberMode mode)
 {
     Name = name;
     Mode = mode;
 }