/*
* Namespace Summary
* Copyright (C) 2005+ Bogdan Damian Constantin
* E-Mail: damianbcpetro@gmail.com
* WEB: http://www.sourceforge.net/projects/dataholder
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License 2.1 or later, as
* published by the Free Software Foundation. See the included License.txt
* or http://www.gnu.org/copyleft/lesser.html for details.
*
*/
using System;
using System.Xml;
using System.Collections;
using System.ComponentModel;
namespace DataHolder.Containers.Property{
/// <summary>
/// This is the base class for all the Dataholder properties
/// </summary>
public abstract class GenericDataProperty
{
protected IPropAttribute [] locAttributes;
public abstract string PropertyName
{
get;
set;
}
public abstract Type PropertyType
{
get;
set;
}
/// <summary>
/// used for non XML serialization
/// </summary>
/// <param name="data"></param>
/// <param name="srinfo"></param>
public abstract void PreSerializatonAction(object data, SerializationHelper srinfo);
public abstract void ReadXml(XmlReader reader, GenericData ge,
bool SerializeOriginalValues, bool SerializeIntermediarValues);
public abstract void WriteXml(XmlWriter writer, GenericData ge, int PropertyIndex,
bool SerializeOriginalValues, bool SerializeIntermediarValues);
public IPropAttribute this[string name]
{
get
{
if(locAttributes == null)
return null;
else
foreach(IPropAttribute ipa in locAttributes)
if(ipa.Name.Equals(name))
return ipa;
return null;
}
}
public IPropAttribute this[int index]
{
get
{
if(locAttributes == null)
return null;
else
return locAttributes[index];
}
}
public int Count
{
get
{
if(locAttributes == null)
return 0;
else
return locAttributes.Length;
}
}
}
}
|