예제 #1
0
        public static AbstractTag CreateEmptyParamsTag(string className, int lineNo)
        {
            string      cn   = "Sov.AVGPart" + "." + className.ToString();
            Type        type = Type.GetType(cn);
            AbstractTag tag  = null;

            try
            {
                tag = (AbstractTag)Activator.CreateInstance(type);
            }
            catch (Exception e)
            {
                //Debug.Log(e.ToString());
            }


            if (tag != null)
            {
                TagInfo i = new TagInfo("");
                tag.Init(i, lineNo);

                tag.CheckVital();
            }
            return(tag);
        }
예제 #2
0
        public static AbstractTag Create(TagInfo info, int lineNo)
        {
            /*
             * tagName: 全小写  e.g. settext
             * ClassName 首字母大写 e.g. SettextTag
             */
            StringBuilder className = new StringBuilder(info.TagName);

            className[0] = Char.ToUpper(className[0]);
            className.Append("Tag");
            //className.Append("Sov.AVGPart" + ".", 0);
            string cn   = "Sov.AVGPart" + "." + className.ToString();
            Type   type = Type.GetType(cn);

            AbstractTag tag = null;

            try
            {
                tag = (AbstractTag)Activator.CreateInstance(type);
            }
            catch (Exception e)
            {
                //Debug.Log(e.ToString());
            }

            if (tag != null)
            {
                tag.Init(info, lineNo);

                tag.CheckVital();
            }
            return(tag);
        }