public BreadcrumbControllerInjector(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     IBreadcrumbCommandParserService breadcrumbCommandParserService,
     ICSharpCommonStgService cSharpCommonStgService,
     BufferedTokenStream tokenStream,
     ControllerDictionary controllerDictionary,
     string breadcrumbServiceNamespace,
     string controllerRootNamespace,
     string defaultAreaBreadcrumbServiceRootName,
     string tabString)
 {
     _stringUtilService              = stringUtilService;
     _cSharpParserService            = cSharpParserService;
     _breadcrumbCommandParserService = breadcrumbCommandParserService;
     _cSharpCommonStgService         = cSharpCommonStgService;
     Tokens         = tokenStream;
     Rewriter       = new TokenStreamRewriter(tokenStream);
     ControllerDict = controllerDictionary;
     _breadcrumbServiceNamespace           = breadcrumbServiceNamespace;
     _controllerRootNamespace              = controllerRootNamespace;
     _defaultAreaBreadcrumbServiceRootName = defaultAreaBreadcrumbServiceRootName;
     _tabString         = tabString;
     _currentNamespace  = new Stack <string>();
     _currentClass      = new Stack <string>();
     _isControllerClass = new Stack <bool>();
     _isControllerClass.Push(false);
     _isClassModified = new Stack <bool>();
     _isClassModified.Push(false);
     IsModified = false;
 }
 public BreadcrumbClassInjectorFactory(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     IBreadcrumbCommandParserService breadcrumbCommandParserService)
 {
     _stringUtilService              = stringUtilService;
     _cSharpParserService            = cSharpParserService;
     _breadcrumbCommandParserService = breadcrumbCommandParserService;
 }
 public ServiceStartupRegistrationFactory(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     IServiceCommandStgService serviceCommandStgService)
 {
     _stringUtilService        = stringUtilService;
     _cSharpParserService      = cSharpParserService;
     _serviceCommandStgService = serviceCommandStgService;
 }
Example #4
0
 public ServiceInterfaceInjectorFactory(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     IServiceCommandParserService serviceCommandParserService)
 {
     _stringUtilService           = stringUtilService;
     _cSharpParserService         = cSharpParserService;
     _serviceCommandParserService = serviceCommandParserService;
 }
        public ServiceClassInjector(
            IStringUtilService stringUtilService,
            ICSharpParserService cSharpParserService,
            IServiceCommandParserService serviceCommandParserService,
            BufferedTokenStream tokenStream,
            string serviceClassInterfaceName,
            ServiceFile serviceFile,
            string tabString = null)
        {
            _stringUtilService           = stringUtilService;
            _cSharpParserService         = cSharpParserService;
            _serviceCommandParserService = serviceCommandParserService;
            Tokens   = tokenStream;
            Rewriter = new TokenStreamRewriter(tokenStream);
            _serviceClassInterfaceName = serviceClassInterfaceName;
            _serviceFile      = serviceFile;
            _tabString        = tabString;
            _currentNamespace = new Stack <string>();
            _currentClass     = new Stack <string>();
            _isCorrectClass   = new Stack <bool>();
            _isCorrectClass.Push(false);
            _hasServiceNamespace   = false;
            _hasServiceClass       = false;
            _hasServiceConstructor = false;
            IsModified             = false;

            _usingSet = _serviceFile.UsingDirectives.ToHashSet();

            _ctorParamDict = new Dictionary <string, FixedParameter>();
            foreach (var fixedParam in
                     _serviceFile.ServiceDeclaration.Body.ConstructorDeclaration.FormalParameterList.FixedParameters)
            {
                _ctorParamDict.Add($"{fixedParam.Type} {fixedParam.Identifier}", fixedParam);
            }

            _fieldDict = new Dictionary <string, FieldDeclaration>();
            foreach (var fieldDec in _serviceFile.ServiceDeclaration.Body.FieldDeclarations)
            {
                _fieldDict.Add($"{fieldDec.Type} {fieldDec?.VariableDeclarator?.Identifier}", fieldDec);
            }

            _ctorAssignmentDict = new Dictionary <string, SimpleAssignment>();
            var statements = _serviceFile.ServiceDeclaration?.Body?.ConstructorDeclaration?.Body?.Statements;

            if (statements != null)
            {
                foreach (var statement in statements)
                {
                    if (statement.SimpleAssignment != null)
                    {
                        var sa = statement.SimpleAssignment;
                        _ctorAssignmentDict.Add($"{sa.LeftHandSide}={sa.RightHandSide};", sa);
                    }
                }
            }
        }
Example #6
0
 public ServiceConstructorInjectorFactory(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     ICSharpCommonStgService cSharpCommonStgService,
     ILogger <MvcPodiumController> logger)
 {
     _stringUtilService      = stringUtilService;
     _cSharpParserService    = cSharpParserService;
     _cSharpCommonStgService = cSharpCommonStgService;
     _logger = logger;
 }
 public BreadcrumbControllerInjectorFactory(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     IBreadcrumbCommandParserService breadcrumbCommandParserService,
     ICSharpCommonStgService cSharpCommonStgService)
 {
     _stringUtilService              = stringUtilService;
     _cSharpParserService            = cSharpParserService;
     _breadcrumbCommandParserService = breadcrumbCommandParserService;
     _cSharpCommonStgService         = cSharpCommonStgService;
 }
 public ServiceClassScraper(
     ICSharpParserService cSharpParserService,
     BufferedTokenStream tokenStream,
     string serviceClassName,
     string serviceNamespace,
     List <TypeParameter> typeParameters)
 {
     _cSharpParserService = cSharpParserService;
     Tokens            = tokenStream;
     ServiceClassName  = serviceClassName;
     TypeParameters    = typeParameters;
     _serviceNamespace = serviceNamespace;
     Rewriter          = new TokenStreamRewriter(tokenStream);
     Results           = new ServiceFile();
     _currentNamespace = new Stack <string>();
     HasServiceClass   = false;
 }
Example #9
0
 public ServiceStartupRegistration(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     IServiceCommandStgService serviceCommandStgService,
     BufferedTokenStream tokenStream,
     string rootNamespace,
     List <StartupRegistrationInfo> startupRegInfoList,
     string tabString = null)
 {
     _stringUtilService        = stringUtilService;
     _cSharpParserService      = cSharpParserService;
     _serviceCommandStgService = serviceCommandStgService;
     Tokens              = tokenStream;
     Rewriter            = new TokenStreamRewriter(tokenStream);
     _rootNamespace      = rootNamespace;
     _startupRegInfoList = startupRegInfoList;
     _tabString          = tabString;
     _currentNamespace   = new Stack <string>();
     _currentClass       = new Stack <string>();
     IsModified          = false;
 }
 public ServiceConstructorInjector(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     ICSharpCommonStgService cSharpCommonStgService,
     ILogger logger,
     BufferedTokenStream tokenStream,
     string constructorClassName,
     string constructorClassNamespace,
     string serviceIdentifier,
     string serviceNamespace,
     string serviceInterfaceType,
     FieldDeclaration fieldDeclaration,
     FixedParameter constructorParameter,
     SimpleAssignment constructorAssignment,
     ConstructorDeclaration constructorDeclaration,
     string tabString = null)
 {
     _stringUtilService      = stringUtilService;
     _cSharpParserService    = cSharpParserService;
     _cSharpCommonStgService = cSharpCommonStgService;
     _logger  = logger;
     Tokens   = tokenStream;
     Rewriter = new TokenStreamRewriter(tokenStream);
     _constructorClassName      = constructorClassName;
     _constructorClassNamespace = constructorClassNamespace;
     _serviceIdentifier         = serviceIdentifier;
     _serviceNamespace          = serviceNamespace;
     _serviceInterfaceType      = serviceInterfaceType;
     _fieldDeclaration          = fieldDeclaration;
     _constructorParameter      = constructorParameter;
     _constructorAssignment     = constructorAssignment;
     _constructorDeclaration    = constructorDeclaration;
     _tabString               = tabString;
     _currentNamespace        = new Stack <string>();
     IsModified               = false;
     _isConstructorClassFound = false;
     _isRewritten             = false;
 }
        public ServiceInterfaceInjector(
            IStringUtilService stringUtilService,
            ICSharpParserService cSharpParserService,
            IServiceCommandParserService serviceCommandParserService,
            BufferedTokenStream tokenStream,
            string serviceClassInterfaceName,
            ServiceFile serviceFile,
            string tabString = null)
        {
            _stringUtilService           = stringUtilService;
            _cSharpParserService         = cSharpParserService;
            _serviceCommandParserService = serviceCommandParserService;
            Tokens   = tokenStream;
            Rewriter = new TokenStreamRewriter(tokenStream);
            _serviceClassInterfaceName = serviceClassInterfaceName;
            _serviceFile         = serviceFile;
            _tabString           = tabString;
            _currentNamespace    = new Stack <string>();
            _hasServiceNamespace = false;
            _hasServiceInterface = false;
            IsModified           = false;

            _usingSet = _serviceFile.UsingDirectives.ToHashSet();
        }
Example #12
0
        public BreadcrumbClassInjector(
            IStringUtilService stringUtilService,
            ICSharpParserService cSharpParserService,
            IBreadcrumbCommandParserService breadcrumbCommandParserService,
            BufferedTokenStream tokenStream,
            List <string> usingDirectives,
            string breadcrumbNamespace,
            BreadcrumbServiceDeclaration breadcrumbDeclaration,
            string tabString)
        {
            _stringUtilService              = stringUtilService;
            _cSharpParserService            = cSharpParserService;
            _breadcrumbCommandParserService = breadcrumbCommandParserService;
            Tokens                    = tokenStream;
            Rewriter                  = new TokenStreamRewriter(tokenStream);
            _breadcrumbNamespace      = breadcrumbNamespace;
            _breadcrumbDeclaration    = breadcrumbDeclaration;
            _tabString                = tabString;
            _currentNamespace         = new Stack <string>();
            _currentClass             = new Stack <string>();
            _hasBreadcrumbNamespace   = false;
            _hasBreadcrumbClass       = false;
            _hasBreadcrumbConstructor = false;
            IsModified                = false;

            _methodDictionary = new Dictionary <string, BreadcrumbMethodDeclaration>();
            foreach (var method in breadcrumbDeclaration.Body.MethodDeclarations)
            {
                _methodDictionary.Add(GetActionMethodName(method.ControllerRoot, method.Action), method);
            }

            _usingSet = usingDirectives.ToHashSet();

            _ctorParamDict = new Dictionary <string, FixedParameter>();
            foreach (var fixedParam in
                     _breadcrumbDeclaration.Body.ConstructorDeclaration.FormalParameterList.FixedParameters)
            {
                _ctorParamDict.Add($"{fixedParam.Type} {fixedParam.Identifier}", fixedParam);
            }

            _fieldDict = new Dictionary <string, FieldDeclaration>();
            foreach (var fieldDec in _breadcrumbDeclaration.Body.FieldDeclarations)
            {
                _fieldDict.Add($"{fieldDec.Type} {fieldDec?.VariableDeclarator?.Identifier}", fieldDec);
            }

            _ctorAssignmentDict = new Dictionary <string, SimpleAssignment>();
            var statements = _breadcrumbDeclaration?.Body?.ConstructorDeclaration?.Body?.Statements;

            if (statements != null)
            {
                foreach (var statement in statements)
                {
                    if (statement.SimpleAssignment != null)
                    {
                        var sa = statement.SimpleAssignment;
                        _ctorAssignmentDict.Add($"{sa.LeftHandSide}={sa.RightHandSide};", sa);
                    }
                }
            }
        }
Example #13
0
 public ServiceInterfaceScraperFactory(
     ICSharpParserService cSharpParserService)
 {
     _cSharpParserService = cSharpParserService;
 }
Example #14
0
 public ServiceClassScraperFactory(ICSharpParserService cSharpParserService)
 {
     _cSharpParserService = cSharpParserService;
 }