コード例 #1
0
        public string FindEventTypeCode <TEventDataType>(IClaptrapBox claptrapBox, TEventDataType eventDataType)
        {
            var claptrapDesign = _claptrapDesignStore.FindDesign(claptrapBox.Claptrap.State.Identity);

            var(key, _) =
                claptrapDesign.EventHandlerDesigns.SingleOrDefault(x =>
                                                                   x.Value.EventDataType == typeof(TEventDataType));
            return(key);
        }
コード例 #2
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);
        }
コード例 #3
0
 public string GetClaptrapTypeCode(IClaptrapBox claptrapBox)
 {
     return(GetClaptrapTypeCode(claptrapBox.GetType()));
 }