/// <summary>
///
/// </summary>
/// <param name="input"></param>
/// <param name="caller"></param>
public override void Parse(Stream input, TagTypes caller)
{
BinaryReader br = new BinaryReader(input);
this._lineStyleCount = br.ReadByte();
if (caller.Equals(TagTypes.DefineMorphShape2))
{
if (this._lineStyleCount.Equals(0xFF))
{
this._lineStyleCountExtended = br.ReadUInt16();
for (UInt16 i = 0; i < this._lineStyleCountExtended; i++)
{
MorphLineStyle2 temp = new MorphLineStyle2(this._SwfVersion);
temp.Parse(input);
this._lineStyles.Add(temp);
}
}
else
{
for (byte i = 0; i < this._lineStyleCount; i++)
{
MorphLineStyle2 temp = new MorphLineStyle2(this._SwfVersion);
temp.Parse(input);
this._lineStyles.Add(temp);
}
}
}
else if (caller.Equals(TagTypes.DefineMorphShape))
{
if (this._lineStyleCount.Equals(0xFF))
{
this._lineStyleCountExtended = br.ReadUInt16();
for (UInt16 i = 0; i < this._lineStyleCountExtended; i++)
{
MorphLineStyle temp = new MorphLineStyle(this._SwfVersion);
temp.Parse(input);
this._lineStyles.Add(temp);
}
}
else
{
MorphLineStyle temp = null;
for (byte i = 0; i < this._lineStyleCount; i++)
{
temp = new MorphLineStyle(this._SwfVersion);
temp.Parse(input);
this._lineStyles.Add(temp);
}
}
}
else
{
Exception e = new Exception(" Only DefineMorphShape2 and DefineMorphShape can access MorphLineStyleArray ");
Log.Error(this, e.Message);
throw e;
}
}