Exemplo n.º 1
0
        internal static void AddSourceHashesMember(SharpYaml.Serialization.Descriptors.ObjectDescriptor objectDescriptor, List <SharpYaml.Serialization.IMemberDescriptor> memberDescriptors)
        {
            var type = objectDescriptor.Type;

            if (!typeof(Asset).IsAssignableFrom(type))
            {
                return;
            }

            memberDescriptors.Add(SourceHashesDynamicMember.Default);
        }
Exemplo n.º 2
0
        private static void PrepareMembersCallback(SharpYaml.Serialization.Descriptors.ObjectDescriptor objDesc, List <IMemberDescriptor> memberDescriptors)
        {
            var type = objDesc.Type;

            if (IdentifiableHelper.IsIdentifiable(type) && !typeof(IIdentifiable).IsAssignableFrom(type))
            {
                memberDescriptors.Add(CustomDynamicMemberDescriptor);
            }

            // Call custom callbacks to prepare members
            PrepareMembersEvent?.Invoke(objDesc, memberDescriptors);
        }
Exemplo n.º 3
0
        private static void PrepareMembersCallback(SharpYaml.Serialization.Descriptors.ObjectDescriptor objDesc, List <IMemberDescriptor> memberDescriptors)
        {
            var type = objDesc.Type;

            // Early exit if we don't need to add a unique identifier to a type
            if (!IdentifiableHelper.IsIdentifiable(type) || typeof(IIdentifiable).IsAssignableFrom(type))
            {
                return;
            }

            // Otherwise we can add it
            memberDescriptors.Add(CustomDynamicMemberDescriptor);
        }