using System;
using System.Collections;
using System.Runtime.Serialization;
using DataHolder.Containers;
namespace GEGeneratorWizzard{
#region WizzardDBTable
[Serializable]
public class WizzardDBTable : DataHolder.Containers.GenericData
{
#region Constructors
public WizzardDBTable()
{
GUID = Guid.NewGuid().ToString();
}
public WizzardDBTable(SerializationInfo info, StreamingContext context):base(info, context)
{
if(GUID.Length == 0)
GUID = Guid.NewGuid().ToString();
}
#endregion
protected override DataHolder.Containers.Property.PropertyCollection NewPropertyCollection
{
get
{
return new DataHolder.Containers.Property.PropertyCollection(
new DataHolder.Containers.Property.GenericDataProperty [] {
new DataHolder.Containers.Property.Property("TableName", typeof(string) )
,
new DataHolder.Containers.Property.Property("Alias", typeof(string) )
,
new DataHolder.Containers.Property.Property("Index", typeof(int) , 0, true)
,
new DataHolder.Containers.Property.TypedProperty("Joins", typeof(GenericDataCollection<WizzardTableJoin>) )
,
new DataHolder.Containers.Property.Property("JoinsCount", typeof(int) , 0, true)
,
new DataHolder.Containers.Property.Property("GUID", typeof(string), string.Empty, true)
}
);
}
}
public String TableName
{
get{return GetValue<string>( 0, string.Empty);}
set{SetValue<string>(0, value, string.Empty);}
}
public String Alias
{
get{return GetValue<string>( 1, string.Empty);}
set{SetValue<string>(1, value, string.Empty);}
}
public Int32 Index
{
get{return (Int32)this[2];}
set{this[2] = value;}
}
public GenericDataCollection<WizzardTableJoin> Joins
{
get{return (GenericDataCollection<WizzardTableJoin>)this[3];}
set{this[3] = value;}
}
public Int32 JoinsCount
{
get{return (Int32)this[4];}
set{this[4] = value;}
}
public String GUID
{
get{return GetValue<string>( 5, string.Empty);}
set{SetValue<string>(5, value, string.Empty);}
}
public string TableFullName
{
get
{
if(Alias != null && Alias.Length == 0)
return TableName;
else
return string.Format("{0} ({1})",new object[]{TableName, Alias});
}
set{}
}
}
#endregion
}
|