Пример #1
0
        public ChoCodeDomProvider(string[] statements, string[] namespaces = null, ChoCodeProviderLanguage language = ChoCodeProviderLanguage.CSharp)
        {
            ChoGuard.ArgumentNotNullOrEmpty(statements, "statements");

            _statements = statements;
            _language   = language;
            AddNamespaces(namespaces);
        }
Пример #2
0
        public ChoCodeDomProvider(string codeBlockFilePath, string[] namespaces = null, ChoCodeProviderLanguage language = ChoCodeProviderLanguage.CSharp)
        {
            ChoGuard.ArgumentNotNullOrEmpty(codeBlockFilePath, "codeBlockFilePath");

            if (!ChoFile.Exists(codeBlockFilePath))
            {
                throw new ArgumentException("{0} file not exists.".FormatString(codeBlockFilePath));
            }

            _statements = File.ReadAllLines(codeBlockFilePath);
            AddNamespaces(namespaces);
        }