Exemple #1
0
        public Type GetType(string typeName = default)
        {
            AssemblyComplier complier = new AssemblyComplier();

            complier.ComplieInFile = _complieInFile;
            complier.Domain        = _domain;
            var text = _operator
                       .GetUsingBuilder()
                       .Append(_operator.OopContentScript)
                       .ToString();

            if (typeName == default)
            {
                typeName = ScriptHelper.GetClassName(text);
                if (typeName == default)
                {
                    typeName = ScriptHelper.GetInterfaceName(text);
                    if (typeName == default)
                    {
                        typeName = ScriptHelper.GetStructName(text);
                        if (typeName == default)
                        {
                            typeName = ScriptHelper.GetEnumName(text);
                        }
                    }
                }
            }
            complier.Add(text);
            return(complier.GetType(typeName));
        }
Exemple #2
0
        public Type GetType(string code, string typeName = default)
        {
            OopOperator oopOperator = OopOperator.Create(Compiler, OptionAction);
            string      result      = oopOperator
                                      .GetUsingBuilder()
                                      .Append(code).ToString();

            oopOperator.Compiler.SyntaxInfos.Add(result, oopOperator.Usings);

            var text = result;

            if (typeName == default)
            {
                typeName = ScriptHelper.GetClassName(text);
                if (typeName == default)
                {
                    typeName = ScriptHelper.GetInterfaceName(text);
                    if (typeName == default)
                    {
                        typeName = ScriptHelper.GetStructName(text);
                        if (typeName == default)
                        {
                            typeName = ScriptHelper.GetEnumName(text);
                        }
                    }
                }
            }

            return(oopOperator.Compiler.GetType(typeName));
        }
Exemple #3
0
        public Type GetType(string typeName = default)
        {
            var text = _operator
                       .GetUsingBuilder()
                       .Append(_operator.OopContentScript)
                       .ToString();

            if (typeName == default)
            {
                typeName = ScriptHelper.GetClassName(text);
                if (typeName == default)
                {
                    typeName = ScriptHelper.GetInterfaceName(text);
                    if (typeName == default)
                    {
                        typeName = ScriptHelper.GetStructName(text);
                        if (typeName == default)
                        {
                            typeName = ScriptHelper.GetEnumName(text);
                        }
                    }
                }
            }
            Complier.Add(text);
            return(Complier.GetType(typeName));
        }