Esempio n. 1
0
        public string GetClaptrapTypeCode(IClaptrapBox claptrapBox)
        {
            // to find type code from attribute as this method is invoke before claptrap activated. Identity is unable to be used.
            var claptrapStateAttribute = claptrapBox
                                         .GetType()
                                         .GetInterfaces()
                                         .Select(x => x.GetCustomAttribute <ClaptrapStateAttribute>())
                                         .Single(x => x != null);
            var typeCode = claptrapStateAttribute.ClaptrapTypeCode;

            return(typeCode);
        }
 public string GetClaptrapTypeCode(IClaptrapBox claptrapBox)
 {
     return(GetClaptrapTypeCode(claptrapBox.GetType()));
 }