コード例 #1
0
ファイル: EventRegistry.cs プロジェクト: jhorback/Harbor
        /// <summary>
        /// <![CDATA[
        ///   Looks for all implementations of IEventSubscriber<>
        ///   then adds each implementation to be returned when calling with a specific generic.
        ///   This is to support returning things such as all implementations of: IEventSubscriber<SomeEvent>
        /// ]]>
        /// </summary>
        void registerAllGenericImplementationsFor(Type genericType)
        {
            var reflectionUtils = new ReflectionUtils();
            var implementingTypes = reflectionUtils.GetTypesImplementingGenericType(genericType, typeof(HarborApp).Assembly);

            foreach (var type in implementingTypes)
            {
                // AsImplementedInterfaces
                foreach (var implementedInterface in type.GetInterfaces())
                {
                    For(implementedInterface).Add(type);
                }
            }
        }
コード例 #2
0
ファイル: Recorder.cs プロジェクト: Chaser324/Moments
 void Awake()
 {
     m_ReflectionUtils = new ReflectionUtils<Recorder>(this);
     m_Frames = new Queue<RenderTexture>();
     Init();
 }