コード例 #1
0
        //todo add cache
        internal static InterfaceWrapContext GetContext(Type interfacetype)
        {
            InterfaceWrapContext interfaceWrapContext = new InterfaceWrapContext();

            interfaceWrapContext.InterfaceType = interfacetype;

            object[] interfaceAttibuts = interfacetype.GetCustomAttributes(true);


            BaseAttribute LarkAttribute;

            for (int i = 0; i < interfaceAttibuts.Length; i++)
            {
                object o = interfaceAttibuts[i];

                if (false == typeof(BaseAttribute).IsInstanceOfType(o))
                {
                    continue;
                }
                LarkAttribute = o as BaseAttribute;
                LarkAttribute.SaveToInterfaceContext(interfaceWrapContext);
            }

            interfaceWrapContext.CreateBind();

            interfaceWrapContext.SaveMethod();

            interfaceWrapContext.Validate();

            return(interfaceWrapContext);
        }