using System; namespace Kreta.Framework.Entities { /// /// Entitás tulajdonságait leíró attribútum. /// [AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = true)] public sealed class EntityPropertyAttribute : Attribute { private string m_Name; private EntityPropertyBaseType m_BaseType; private Type m_PropertyType; private EntityCopyMethod m_CopyMethod; private string m_AssocFieldName; private string m_TableName; private string m_PartnerAssocFieldName; /// /// Az osztály konstruktora /// /// A tulajdonság neve /// A tulajdonság alaptípusa /// A tulajdonság .NET típusa /// A tulajdonság másolási módja public EntityPropertyAttribute(string name, EntityPropertyBaseType baseType, Type propertyType, EntityCopyMethod copyMethod) { m_Name = name; m_BaseType = baseType; m_PropertyType = propertyType; m_CopyMethod = copyMethod; } /// /// Az osztály konstruktora /// /// A tulajdonság neve /// A tulajdonság alaptípusa /// A tulajdonság .NET típusa /// A tulajdonság másolási módja /// A tulajdonság asszociációs osztályának kapcsoló ID mezője. public EntityPropertyAttribute(string name, EntityPropertyBaseType baseType, Type propertyType, EntityCopyMethod copyMethod, string assocfieldname) { m_Name = name; m_BaseType = baseType; m_PropertyType = propertyType; m_CopyMethod = copyMethod; m_AssocFieldName = assocfieldname; } /// /// Az osztály konstruktora /// /// A tulajdonság neve /// A tulajdonság alaptípusa /// A tulajdonság .NET típusa /// A tulajdonság másolási módja /// A tulajdonság asszociációs osztályának kapcsoló ID mezője. public EntityPropertyAttribute(string name, EntityPropertyBaseType baseType, Type propertyType, EntityCopyMethod copyMethod, string assocfieldname, string partnerassocfieldname, string tablename) { m_Name = name; m_BaseType = baseType; m_PropertyType = propertyType; m_CopyMethod = copyMethod; m_AssocFieldName = assocfieldname; m_PartnerAssocFieldName = partnerassocfieldname; m_TableName = tablename; } /// /// A tulajdonság neve. /// public string Name { get { return m_Name; } } public string AssocFieldName { get { return m_AssocFieldName; } } public string PartnerAssocFieldName { get { return m_PartnerAssocFieldName; } } public string TableName { get { return m_TableName; } } /// /// A tulajdonság fajtája. /// public EntityPropertyBaseType BaseType { get { return m_BaseType; } } /// /// A tulajdonság típusa. /// public Type PropertyType { get { return m_PropertyType; } } /// /// A tulajdonság másolási módja. /// /// /// Entitás másolásánál használatos, és megmondja, hogy a másolat entitásnál /// a tulajdonságot milyen módon kell másolni. Asszociációknál van értelmezve. /// /// /// DeepCopy /// Az asszociációs partnert is le kell másolni. /// /// /// ShallowCopy /// Az asszociációs partnert nem kell másolni, a másolat identitása megegyezhet /// az eredetivel. /// /// /// /// public EntityCopyMethod CopyMethod { get { return m_CopyMethod; } } } }