コード例 #1
0
 public CSharpParserService(
     IStringUtilService stringUtilService,
     ICSharpCommonStgService cSharpCommonStgService)
 {
     _stringUtilService      = stringUtilService;
     _cSharpCommonStgService = cSharpCommonStgService;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 public BreadcrumbClassInjectorFactory(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     IBreadcrumbCommandParserService breadcrumbCommandParserService)
 {
     _stringUtilService              = stringUtilService;
     _cSharpParserService            = cSharpParserService;
     _breadcrumbCommandParserService = breadcrumbCommandParserService;
 }
コード例 #4
0
 public ServiceStartupRegistrationFactory(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     IServiceCommandStgService serviceCommandStgService)
 {
     _stringUtilService        = stringUtilService;
     _cSharpParserService      = cSharpParserService;
     _serviceCommandStgService = serviceCommandStgService;
 }
コード例 #5
0
        public StringUtilView()
        {
            InitializeComponent();

            IStringUtilService service = ObjectRegistry.GetRegisteredObject <IStringUtilService>();

            presenter = ObjectRegistry.GetRegisteredObject <IStringUtilPresenter>(this, service);
            presenter.Initialize();
        }
コード例 #6
0
 public ServiceInterfaceInjectorFactory(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     IServiceCommandParserService serviceCommandParserService)
 {
     _stringUtilService           = stringUtilService;
     _cSharpParserService         = cSharpParserService;
     _serviceCommandParserService = serviceCommandParserService;
 }
コード例 #7
0
 public ServiceCommandParserService(
     IStringUtilService stringUtilService,
     ICSharpCommonStgService cSharpCommonStgService,
     IServiceCommandStgService serviceCommandStgService)
 {
     _stringUtilService        = stringUtilService;
     _cSharpCommonStgService   = cSharpCommonStgService;
     _serviceCommandStgService = serviceCommandStgService;
 }
コード例 #8
0
 public BreadcrumbCommandParserService(
     IStringUtilService stringUtilService,
     ICSharpCommonStgService cSharpCommonStgService,
     IBreadcrumbCommandStgService breadcrumbCommandStgService)
 {
     _stringUtilService           = stringUtilService;
     _cSharpCommonStgService      = cSharpCommonStgService;
     _breadcrumbCommandStgService = breadcrumbCommandStgService;
 }
コード例 #9
0
        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);
                    }
                }
            }
        }
コード例 #10
0
 public ServiceConstructorInjectorFactory(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     ICSharpCommonStgService cSharpCommonStgService,
     ILogger <MvcPodiumController> logger)
 {
     _stringUtilService      = stringUtilService;
     _cSharpParserService    = cSharpParserService;
     _cSharpCommonStgService = cSharpCommonStgService;
     _logger = logger;
 }
コード例 #11
0
 public BreadcrumbControllerInjectorFactory(
     IStringUtilService stringUtilService,
     ICSharpParserService cSharpParserService,
     IBreadcrumbCommandParserService breadcrumbCommandParserService,
     ICSharpCommonStgService cSharpCommonStgService)
 {
     _stringUtilService              = stringUtilService;
     _cSharpParserService            = cSharpParserService;
     _breadcrumbCommandParserService = breadcrumbCommandParserService;
     _cSharpCommonStgService         = cSharpCommonStgService;
 }
コード例 #12
0
        public StringUtilPresenter(IStringUtilViewModel viewModel, IStringUtilService service)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }
            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }

            this.viewModel = viewModel;
            this.service   = service;
        }
コード例 #13
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;
 }
コード例 #14
0
 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;
 }
コード例 #15
0
        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();
        }
コード例 #16
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);
                    }
                }
            }
        }