예제 #1
0
        public void AddActivation <TParent>(RootNode root, AlphaNode <TParent> activation)
        {
            AlphaNode <T> alphaNode = root.GetAlphaNode <T>();

            var adapter =
                (Activation <TParent>)
                FastActivator.Create(typeof(ConvertNode <,>), new[] { typeof(TParent), typeof(T) },
                                     new object[] { alphaNode });

            activation.AddActivation(adapter);
        }
예제 #2
0
파일: RootNode.cs 프로젝트: yonglehou/Stact
        Activation CreateMissingAlphaNode <T>(Type type)
        {
            var alphaNode = new AlphaNode <T>();

            foreach (Type nestedType in GetNestedMessageTypes(typeof(T)))
            {
                _initializers[nestedType].AddActivation(this, alphaNode);
            }

            return(alphaNode);
        }