Ejemplo n.º 1
0
        private void ReadFlags(Stream tableDirectoryEntryStream)
        {
            object outputValue = byte.MinValue;

            WoffUtility.Reader.ReadProperty(tableDirectoryEntryStream, ref outputValue);
            flags    = (byte)outputValue;
            tagIndex = (byte)(flags & 0x3f);
            transformationVersion = (byte)(flags >> 6);
            tag = Enum.GetValues(typeof(KnownTableTags)).Cast <KnownTableTags>().ToList()[tagIndex];
        }
Ejemplo n.º 2
0
        public static UInt32 Value(this KnownTableTags tag)
        {
            var attributes = tag.GetType().GetField(tag.ToString()).GetCustomAttributes(typeof(KnownTableTagValueAttribute), false);

            if (attributes != null && attributes.Count() > 0)
            {
                return(((KnownTableTagValueAttribute)attributes.First()).Value);
            }
            else
            {
                throw new WoffUtility.WoffBaseException("Attribute do not exists.");
            }
        }