Exemplo n.º 1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        public static T GetAndVerifyElementAttribute <T>(Type pType) where T : WeaverElementAttribute
        {
            T att = WeaverUtil.GetElementAttribute <T>(pType);

            if (att == null)
            {
                throw new WeaverException("Type '" + pType.Name + "' must have a " + typeof(T).Name + ".");
            }

            return(att);
        }
Exemplo n.º 2
0
        /*--------------------------------------------------------------------------------------------*/
        private void BuildType <T>(Type pType, Action <Type, T> pFinish) where T : WeaverElementAttribute
        {
            T att = WeaverUtil.GetElementAttribute <T>(pType);

            if (att == null)
            {
                throw new WeaverException("Type '" + pType.Name + "' must have a " + typeof(T).Name + ".");
            }

            pFinish(pType, att);
        }
Exemplo n.º 3
0
        public void GetElementAttribute(Type pType, bool pFound)
        {
            var result = WeaverUtil.GetElementAttribute <WeaverVertexAttribute>(pType);

            if (pFound)
            {
                Assert.NotNull(result, "Result should be filled.");
            }
            else
            {
                Assert.Null(result, "Result should be null.");
            }
        }