public class Glyph : IComparable
{
//member
public UInt16 GlyfCode;
public smallGlyphMetric sMetric;
public byte[] data;
//method
public Glyph()
{
sMetric = new smallGlyphMetric();
}
public int CompareTo(object o)
{
if (!(o is Glyph))
{
throw new ArgumentException("o must be of type 'Glyph'");
}
Glyph v = (Glyph)o;
return GlyfCode - v.GlyfCode;
}
public override bool Equals(object obj)
{
if (Convert.ToUInt16(obj) == this.GlyfCode)
{
return true;
}
else
{
return false;
}
}
public UInt32 GetSize()
{
return Convert.ToUInt32(5 + data.Length);
}
}
public int CompareTo(object o)
{
if (!(o is Glyph))
{
throw new ArgumentException("o must be of type 'Glyph'");
}
Glyph v = (Glyph)o;
return GlyfCode - v.GlyfCode;
}
public override bool Equals(object obj)
{
if (Convert.ToUInt16(obj) == this.GlyfCode)
{
return true;
}
else
{
return false;
}
}
0 意見:
張貼留言張貼留言