Ejemplo n.º 1
0
 public void Setup()
 {
     _mocks       = new MockRepository();
     _treeService = _mocks.DynamicMock <ITreeCreationService>();
     _naming      = _mocks.DynamicMock <INamingService>();
     _mapper      = new ViewSourceMapper(new NullLogger(), _treeService, _naming);
 }
Ejemplo n.º 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseBrowserLink();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            INamingService namingService = app.ApplicationServices.GetRequiredService <INamingService>();

            namingService.Setup();
        }
Ejemplo n.º 3
0
        public void Setup()
        {
            ccu            = new CodeCompileUnit();
            mocks          = new MockRepository();
            engine         = Engine.GlobalEngine;
            engine.BinPath = @"C:\Program Files (x86)\MSBuild";
            project        = new Project();
            buildEngine    = mocks.DynamicMock <MockBuildEngine>(project);

            logger           = new NullLogger();
            parserService    = mocks.DynamicMock <ISiteTreeGeneratorService>();
            naming           = mocks.DynamicMock <INamingService>();
            sourceStorage    = mocks.DynamicMock <IParsedSourceStorageService>();
            source           = mocks.DynamicMock <ISourceGenerator>();
            typeResolver     = mocks.DynamicMock <ITypeResolver>();
            treeService      = mocks.DynamicMock <ITreeCreationService>();
            viewSourceMapper = mocks.DynamicMock <IViewSourceMapper>();
            generator        = mocks.DynamicMock <IGenerator>();

            task = new GenerateMonoRailSiteTreeTask(logger, parserService, naming, source, sourceStorage, typeResolver,
                                                    treeService, viewSourceMapper, generator);

            item         = mocks.DynamicMock <ITaskItem>();
            parsedSource = mocks.DynamicMock <IParser>();
        }
		public virtual void Setup()
		{
			naming = new DefaultNamingService();
			source = new DefaultSourceGenerator();
			logging = new NullLogger();
			generator = new RouteMapGenerator(logging, source, naming, "TargetNamespace", typeof (IServiceProvider).FullName);
		}
Ejemplo n.º 5
0
 public void Setup()
 {
   _mocks = new MockRepository();
   _treeService = _mocks.DynamicMock<ITreeCreationService>();
   _naming = _mocks.DynamicMock<INamingService>();
   _mapper = new ViewSourceMapper(new NullLogger(), _treeService, _naming);
 }
		public void Setup()
		{
			ccu = new CodeCompileUnit();
			mocks = new MockRepository();
			engine = Engine.GlobalEngine;
			engine.BinPath = @"C:\Program Files (x86)\MSBuild";
			project = new Project();
			buildEngine = mocks.DynamicMock<MockBuildEngine>(project);

			logger = new NullLogger();
			parserService = mocks.DynamicMock<ISiteTreeGeneratorService>();
			naming = mocks.DynamicMock<INamingService>();
			sourceStorage = mocks.DynamicMock<IParsedSourceStorageService>();
			source = mocks.DynamicMock<ISourceGenerator>();
			typeResolver = mocks.DynamicMock<ITypeResolver>();
			treeService = mocks.DynamicMock<ITreeCreationService>();
			viewSourceMapper = mocks.DynamicMock<IViewSourceMapper>();
			generator = mocks.DynamicMock<IGenerator>();

			task = new GenerateMonoRailSiteTreeTask(logger, parserService, naming, source, sourceStorage, typeResolver,
			                                         treeService, viewSourceMapper, generator);

			item = mocks.DynamicMock<ITaskItem>();
			parsedSource = mocks.DynamicMock<IParser>();
		}
Ejemplo n.º 7
0
 public virtual void Setup()
 {
     naming    = new DefaultNamingService();
     source    = new DefaultSourceGenerator();
     logging   = new NullLogger();
     generator = new RouteMapGenerator(logging, source, naming, "TargetNamespace", typeof(IServiceProvider).FullName);
 }
 	public virtual void Setup()
 	{
 		_mocks = new MockRepository();
     _naming = new DefaultNamingService();
     _source = new DefaultSourceGenerator();
     _logging = new NullLogger();
     _generator = new ControllerMapGenerator(_logging, _source, _naming, "TargetNamespace", typeof(IServiceProvider).FullName);
 	}
Ejemplo n.º 9
0
 public ActiveRecordDescriptorBuilder(INamingService namingService,
                                      IPlainFieldInferenceService plainFieldsService,
                                      IRelationshipInferenceService relationsService)
 {
     _namingService      = namingService;
     _plainFieldsService = plainFieldsService;
     _relationsService   = relationsService;
 }
Ejemplo n.º 10
0
		public MappingPage() : base("Fields mapping")
		{
			// This call is required by the Windows Form Designer.
			InitializeComponent();

			naming = ServiceRegistry.Instance[ typeof(INamingService) ] as INamingService;
			typeInference = ServiceRegistry.Instance[ typeof(ITypeInferenceService) ] as ITypeInferenceService;
		}
Ejemplo n.º 11
0
        public MappingPage() : base("Fields mapping")
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            naming        = ServiceRegistry.Instance[typeof(INamingService)] as INamingService;
            typeInference = ServiceRegistry.Instance[typeof(ITypeInferenceService)] as ITypeInferenceService;
        }
Ejemplo n.º 12
0
 public virtual void Setup()
 {
     _mocks     = new MockRepository();
     _naming    = new DefaultNamingService();
     _source    = new DefaultSourceGenerator();
     _logging   = new NullLogger();
     _generator = new ActionMapGenerator(_logging, _source, _naming, "TargetNamespace", typeof(IServiceProvider).FullName);
 }
		public virtual void Setup()
		{
			mocks = new MockRepository();
			naming = new DefaultNamingService();
			source = new DefaultSourceGenerator();
			logging = new NullLogger();
			generator = new ActionMapGenerator(logging, source, naming, "TargetNamespace", typeof (IServiceProvider).FullName);
		}
Ejemplo n.º 14
0
 public virtual void Setup()
 {
     mocks     = new MockRepository();
     naming    = new DefaultNamingService();
     source    = new DefaultSourceGenerator();
     logging   = new NullLogger();
     generator = new ControllerMapGenerator(logging, source, naming, "TargetNamespace", typeof(IServiceProvider).FullName);
 }
Ejemplo n.º 15
0
		public ActiveRecordDescriptorBuilder(INamingService namingService,
			IPlainFieldInferenceService plainFieldsService, 
			IRelationshipInferenceService relationsService)
		{
			_namingService = namingService;
			_plainFieldsService = plainFieldsService;
			_relationsService = relationsService;
		}
Ejemplo n.º 16
0
 public virtual void Setup()
 {
     naming = new DefaultNamingService();
     source = new DefaultSourceGenerator();             // I found a more integration style of testing was better, I started off
     // mocking calls to ISourceGenerator, and that was just stupid, we want the classes and types and members.
     // and the assertions here ensure that.
     logging   = new NullLogger();
     generator = new ActionMapGenerator(logging, source, naming, "TargetNamespace", typeof(IServiceProvider).FullName);
 }
Ejemplo n.º 17
0
		public AbstractGenerator(ILogger logger, ISourceGenerator source, INamingService naming, string targetNamespace, string serviceType)
		{
			_logger = logger;
			_source = source;
			_naming = naming;
			_namespace = targetNamespace;
			_serviceType = serviceType;
			_serviceIdentifier = "services";
		}
		public virtual void Setup()
		{
			naming = new DefaultNamingService();
			source = new DefaultSourceGenerator(); // I found a more integration style of testing was better, I started off
			// mocking calls to ISourceGenerator, and that was just stupid, we want the classes and types and members.
			// and the assertions here ensure that.
			logging = new NullLogger();
			generator = new ActionMapGenerator(logging, source, naming, "TargetNamespace", typeof (IServiceProvider).FullName);
		}
Ejemplo n.º 19
0
 public AbstractGenerator(ILogger logger, ISourceGenerator source, INamingService naming, string targetNamespace, string serviceType)
 {
     _logger            = logger;
     _source            = source;
     _naming            = naming;
     _namespace         = targetNamespace;
     _serviceType       = serviceType;
     _serviceIdentifier = "services";
 }
Ejemplo n.º 20
0
 protected RouteCreator(string @namespace, ISourceGenerator sourceGenerator, INamingService namingService, T node, CodeTypeDeclaration routeDefinitions, CodeTypeDeclaration routes)
 {
     this.@namespace       = @namespace;
     this.sourceGenerator  = sourceGenerator;
     this.namingService    = namingService;
     this.node             = node;
     this.routeDefinitions = routeDefinitions;
     this.routes           = routes;
 }
 public NamingService(INamingService defaultService)
 {
     DefaultService = defaultService;
     EntityAttributeSpecifiedNames = ConfigHelper.GetDictionaryHash("EntityAttributeSpecifiedNames", false);
     OptionNameValueDuplicates     = new Dictionary <OptionSetMetadataBase, Dictionary <string, bool> >();
     InvalidCSharpNamePrefix       = ConfigHelper.GetAppSettingOrDefault("InvalidCSharpNamePrefix", "_");
     LocalOptionSetFormat          = ConfigHelper.GetAppSettingOrDefault("LocalOptionSetFormat", "{0}_{1}");
     UseDeprecatedOptionSetNaming  = ConfigHelper.GetAppSettingOrDefault("UseDeprecatedOptionSetNaming", false);
     ValidCSharpNameRegEx          = ConfigHelper.GetAppSettingOrDefault("ValidCSharpNameRegEx", @"[^a-zA-Z0-9_]");
 }
Ejemplo n.º 22
0
 public Generator(string nameSpace, string outputFile, string serviceTypeName, ILogger logger, INamingService namingService, ISourceGenerator sourceGenerator, ITreeCreationService treeCreationService)
 {
     this.nameSpace           = nameSpace;
     this.outputFile          = outputFile;
     this.serviceTypeName     = serviceTypeName;
     this.logger              = logger;
     this.namingService       = namingService;
     this.sourceGenerator     = sourceGenerator;
     this.treeCreationService = treeCreationService;
 }
Ejemplo n.º 23
0
		public Generator(string nameSpace, string outputFile, string serviceTypeName, ILogger logger, INamingService namingService, ISourceGenerator sourceGenerator, ITreeCreationService treeCreationService)
		{
			this.nameSpace = nameSpace;
			this.outputFile = outputFile;
			this.serviceTypeName = serviceTypeName;
			this.logger = logger;
			this.namingService = namingService;
			this.sourceGenerator = sourceGenerator;
			this.treeCreationService = treeCreationService;
		}
 public NamingService(INamingService defaultService)
 {
     DefaultService = defaultService;
     EntityAttributeSpecifiedNames = ConfigHelper.GetDictionaryHash("EntityAttributeSpecifiedNames", false);
     OptionNameValueDuplicates = new Dictionary<OptionSetMetadataBase, Dictionary<string, bool>>();
     InvalidCSharpNamePrefix = ConfigHelper.GetAppSettingOrDefault("InvalidCSharpNamePrefix", "_");
     LocalOptionSetFormat = ConfigHelper.GetAppSettingOrDefault("LocalOptionSetFormat", "{0}_{1}");
     UseDeprecatedOptionSetNaming = ConfigHelper.GetAppSettingOrDefault("UseDeprecatedOptionSetNaming", false);
     ValidCSharpNameRegEx = ConfigHelper.GetAppSettingOrDefault("ValidCSharpNameRegEx", @"[^a-zA-Z0-9_]");
 }
Ejemplo n.º 25
0
 public virtual void Setup()
 {
     _mocks  = new MockRepository();
     _naming = new DefaultNamingService();
     _source = new DefaultSourceGenerator();             // I found a more integration style of testing was better, I started off
     // mocking calls to ISourceGenerator, and that was just stupid, we want the classes and types and members.
     // and the assertions here ensure that.
     _logging   = new NullLogger();
     _generator =
         new ControllerPartialsGenerator(_logging, _source, _naming, "TargetNamespace", typeof(IServiceProvider).FullName);
 }
Ejemplo n.º 26
0
        public void CreateRelationName()
        {
            INamingService service = (INamingService)Kernel[typeof(INamingService)];

            Assert.AreEqual("Posts", service.CreateRelationName("Post"));
            Assert.AreEqual("Children", service.CreateRelationName("child"));
            Assert.AreEqual("Posts", service.CreateRelationName("posts"));
            Assert.AreEqual("Posts", service.CreateRelationName("post"));
            Assert.AreEqual("Orders", service.CreateRelationName("order"));
            Assert.AreEqual("Facilities", service.CreateRelationName("facility"));
        }
Ejemplo n.º 27
0
        public void CreatePropertyName()
        {
            INamingService service = (INamingService)Kernel[typeof(INamingService)];

            Assert.AreEqual("OrderName", service.CreatePropertyName("order_name"));
            Assert.AreEqual("Name", service.CreatePropertyName("name"));
            Assert.AreEqual("CustomerName", service.CreatePropertyName("customerName"));
            Assert.AreEqual("CustomerName", service.CreatePropertyName("customer_Name"));
            Assert.AreEqual("CustomerName", service.CreatePropertyName("Customer_name"));
            Assert.AreEqual("Name", service.CreatePropertyName("_name"));
        }
		public virtual void Setup()
		{
			_mocks = new MockRepository();
			_naming = new DefaultNamingService();
			_source = new DefaultSourceGenerator(); // I found a more integration style of testing was better, I started off
			// mocking calls to ISourceGenerator, and that was just stupid, we want the classes and types and members.
			// and the assertions here ensure that.
			_logging = new NullLogger();
			_generator =
				new ControllerPartialsGenerator(_logging, _source, _naming, "TargetNamespace", typeof (IServiceProvider).FullName);
		}
Ejemplo n.º 29
0
 public GenerateMonoRailSiteTreeTask()
 {
     _logger              = new MsBuildLogger(this.Log);
     _naming              = new DefaultNamingService();
     _treeService         = new DefaultTreeCreationService();
     _source              = new DefaultSourceGenerator();
     _viewSourceMapper    = new ViewSourceMapper(_logger, _treeService, _naming);
     _sourceStorage       = new DefaultSourceStorageService();
     _typeResolver        = new TypeResolver();
     _service             = new SiteTreeGeneratorService(_logger, _typeResolver, _sourceStorage, new NRefactoryParserFactory());
     this.ServiceTypeName = typeof(ICodeGeneratorServices).FullName;
 }
Ejemplo n.º 30
0
        public override void Activated(System.Collections.IDictionary context)
        {
            TableDefinition table = context["selectedtable"] as TableDefinition;

            if (table != _oldTable)
            {
                _oldTable = table;

                INamingService naming = ServiceRegistry.Instance[typeof(INamingService)] as INamingService;

                className.Text = naming.CreateClassName(table.Name);
            }
        }
Ejemplo n.º 31
0
        public void CreateClassName()
        {
            INamingService service = (INamingService)Kernel[typeof(INamingService)];

            Assert.AreEqual("Author", service.CreateClassName("authors"));
            Assert.AreEqual("Tax", service.CreateClassName("Taxes"));
            Assert.AreEqual("Child", service.CreateClassName("children"));
            Assert.AreEqual("Order", service.CreateClassName("Orders"));
            Assert.AreEqual("Order", service.CreateClassName("Order"));
            Assert.AreEqual("Order", service.CreateClassName("_Order"));
            Assert.AreEqual("Order", service.CreateClassName("tb_Order"));
            Assert.AreEqual("Order", service.CreateClassName("tb_Orders"));
        }
Ejemplo n.º 32
0
 public GenerateMonoRailSiteTreeTask(ILogger logger, ISiteTreeGeneratorService service, INamingService naming, ISourceGenerator source, IParsedSourceStorageService sourceStorage, ITypeResolver typeResolver, ITreeCreationService treeService, IViewSourceMapper viewSourceMapper, IGenerator generator)
 {
     _service          = service;
     _logger           = logger;
     _naming           = naming;
     _source           = source;
     _sourceStorage    = sourceStorage;
     _typeResolver     = typeResolver;
     _treeService      = treeService;
     _viewSourceMapper = viewSourceMapper;
     _generators.Add(generator);
     this.ServiceTypeName = typeof(ICodeGeneratorServices).FullName;
 }
		public GenerateMonoRailSiteTreeTask()
		{
			logger = new MsBuildLogger(Log);
			naming = new DefaultNamingService();
			treeService = new DefaultTreeCreationService();
			source = new DefaultSourceGenerator();
			viewSourceMapper = new ViewSourceMapper(logger, treeService);
			sourceStorage = new DefaultSourceStorageService();
			typeResolver = new TypeResolver();
			service = new SiteTreeGeneratorService(logger, typeResolver, sourceStorage, new NRefactoryParserFactory());
			ServiceTypeName = typeof(ICodeGeneratorServices).FullName;
			ViewComponentSources = new ITaskItem[0];
			AssemblyReferences = new ITaskItem[0];
		}
Ejemplo n.º 34
0
 public GenerateMonoRailSiteTreeTask()
 {
     logger               = new MsBuildLogger(Log);
     naming               = new DefaultNamingService();
     treeService          = new DefaultTreeCreationService();
     source               = new DefaultSourceGenerator();
     viewSourceMapper     = new ViewSourceMapper(logger, treeService);
     sourceStorage        = new DefaultSourceStorageService();
     typeResolver         = new TypeResolver();
     service              = new SiteTreeGeneratorService(logger, typeResolver, sourceStorage, new NRefactoryParserFactory());
     ServiceTypeName      = typeof(ICodeGeneratorServices).FullName;
     ViewComponentSources = new ITaskItem[0];
     AssemblyReferences   = new ITaskItem[0];
 }
 internal CodeGenerationServiceProvider(
     ITypeMappingService typeMappingService
     , ICodeGenerationService codeGenerationService
     , ICodeWriterFilterService codeFilterService
     , IMetadataProviderService metadataProviderService
     , INamingService namingService
     )
 {
     this.TypeMappingService      = typeMappingService;
     this.CodeGenerationService   = codeGenerationService;
     this.CodeWriterFilterService = codeFilterService;
     this.MetadataProviderService = metadataProviderService;
     this.NamingService           = namingService;
 }
Ejemplo n.º 36
0
        public void TestInitialise()
        {
            metadataProviderService = Substitute.For <IMetadataProviderService>();
            organizationMetadata    = Substitute.For <IOrganizationMetadata>();
            metadataProviderService.LoadMetadata().Returns(organizationMetadata);
            serviceProvider.GetService(typeof(IMetadataProviderService)).Returns(metadataProviderService);

            namingService = Substitute.For <INamingService>();
            parameters    = new Dictionary <string, string> {
                { "UseDisplayNames", true.ToString() }
            };

            testMetadata = new TestMetadata(filterService);

            organizationMetadata.Entities.Returns(testMetadata.ToArray());

            sut = new CodeNamingService(namingService, parameters);
        }
		public GenerateMonoRailSiteTreeTask(ILogger logger, ISiteTreeGeneratorService service, INamingService naming,
											ISourceGenerator source, IParsedSourceStorageService sourceStorage,
											ITypeResolver typeResolver, ITreeCreationService treeService,
											IViewSourceMapper viewSourceMapper, IGenerator generator)
		{
			this.service = service;
			this.logger = logger;
			this.naming = naming;
			this.source = source;
			this.sourceStorage = sourceStorage;
			this.typeResolver = typeResolver;
			this.treeService = treeService;
			this.viewSourceMapper = viewSourceMapper;
			generators.Add(generator);
			ServiceTypeName = typeof(ICodeGeneratorServices).FullName;
			ViewComponentSources = new ITaskItem[0];
			AssemblyReferences = new ITaskItem[0];
		}
Ejemplo n.º 38
0
 public GenerateMonoRailSiteTreeTask(ILogger logger, ISiteTreeGeneratorService service, INamingService naming,
                                     ISourceGenerator source, IParsedSourceStorageService sourceStorage,
                                     ITypeResolver typeResolver, ITreeCreationService treeService,
                                     IViewSourceMapper viewSourceMapper, IGenerator generator)
 {
     this.service          = service;
     this.logger           = logger;
     this.naming           = naming;
     this.source           = source;
     this.sourceStorage    = sourceStorage;
     this.typeResolver     = typeResolver;
     this.treeService      = treeService;
     this.viewSourceMapper = viewSourceMapper;
     generators.Add(generator);
     ServiceTypeName      = typeof(ICodeGeneratorServices).FullName;
     ViewComponentSources = new ITaskItem[0];
     AssemblyReferences   = new ITaskItem[0];
 }
Ejemplo n.º 39
0
        public void Setup()
        {
            _ccu            = new CodeCompileUnit();
            _mocks          = new MockRepository();
            _engine         = Engine.GlobalEngine;
            _engine.BinPath = @"C:\Program Files (x86)\MSBuild";
            _project        = new Project();
            _buildEngine    = _mocks.DynamicMock <MockBuildEngine>(_project);

            _logger           = new NullLogger();
            _parserService    = _mocks.DynamicMock <ISiteTreeGeneratorService>();
            _naming           = _mocks.DynamicMock <INamingService>();
            _sourceStorage    = _mocks.DynamicMock <IParsedSourceStorageService>();
            _source           = _mocks.DynamicMock <ISourceGenerator>();
            _typeResolver     = _mocks.DynamicMock <ITypeResolver>();
            _treeService      = _mocks.DynamicMock <ITreeCreationService>();
            _viewSourceMapper = _mocks.DynamicMock <IViewSourceMapper>();
            _generator        = _mocks.DynamicMock <IGenerator>();

            _task = new GenerateMonoRailSiteTreeTask(_logger, _parserService, _naming, _source, _sourceStorage, _typeResolver, _treeService, _viewSourceMapper, _generator);

            _item         = _mocks.DynamicMock <ITaskItem>();
            _parsedSource = _mocks.DynamicMock <IParser>();
        }
Ejemplo n.º 40
0
		public RouteMapGenerator(ILogger logger, ISourceGenerator source, INamingService naming, string targetNamespace,
		                         string serviceType) : base(logger, source, naming, targetNamespace, serviceType)
		{
		}
Ejemplo n.º 41
0
 public ViewSourceMapper(ILogger logger, ITreeCreationService treeService, INamingService naming)
 {
   _logger = logger;
   _treeService = treeService;
   _naming = naming;
 }
Ejemplo n.º 42
0
 public ControllerMapGenerator(ILogger logger, ISourceGenerator source, INamingService naming, string targetNamespace,
                               string serviceType)
     : base(logger, source, naming, targetNamespace, serviceType)
 {
 }
Ejemplo n.º 43
0
 public Naming(INamingService defaulService)
 {
     DefaultService = defaulService;
 }
Ejemplo n.º 44
0
		public RelationshipBuilder(INamingService namingService)
		{
			_namingService = namingService;
		}
    public void Setup()
    {
      _ccu = new CodeCompileUnit();
      _mocks = new MockRepository();
      _engine = Engine.GlobalEngine;
      _engine.BinPath = @"C:\Program Files (x86)\MSBuild";
      _project = new Project();
      _buildEngine = _mocks.DynamicMock<MockBuildEngine>(_project);

      _logger = new NullLogger();
      _parserService = _mocks.DynamicMock<ISiteTreeGeneratorService>();
      _naming = _mocks.DynamicMock<INamingService>();
      _sourceStorage = _mocks.DynamicMock<IParsedSourceStorageService>();
      _source = _mocks.DynamicMock<ISourceGenerator>();
      _typeResolver = _mocks.DynamicMock<ITypeResolver>();
      _treeService = _mocks.DynamicMock<ITreeCreationService>();
      _viewSourceMapper = _mocks.DynamicMock<IViewSourceMapper>();
      _generator = _mocks.DynamicMock<IGenerator>();

      _task = new GenerateMonoRailSiteTreeTask(_logger, _parserService, _naming, _source, _sourceStorage, _typeResolver, _treeService, _viewSourceMapper, _generator);

      _item = _mocks.DynamicMock<ITaskItem>();
      _parsedSource = _mocks.DynamicMock<IParser>();
    }
Ejemplo n.º 46
0
		public RelationshipInferenceService(INamingService namingService)
		{
			_namingService = namingService;
		}
 public SingleEntityNamingService(INamingService namingService)
 {
     this.namingService = namingService;
 }
Ejemplo n.º 48
0
		public PlainFieldInferenceService(INamingService namingService, ITypeInferenceService typeInfService)
		{
			_namingService = namingService;
			_typeInfService = typeInfService;
		}
 public GenerateMonoRailSiteTreeTask()
 {
     _logger = new MsBuildLogger(this.Log);
     _naming = new DefaultNamingService();
     _treeService = new DefaultTreeCreationService();
     _source = new DefaultSourceGenerator();
     _viewSourceMapper = new ViewSourceMapper(_logger, _treeService, _naming);
     _sourceStorage = new DefaultSourceStorageService();
     _typeResolver = new TypeResolver();
     _service = new SiteTreeGeneratorService(_logger, _typeResolver, _sourceStorage, new NRefactoryParserFactory());
     this.ServiceTypeName = typeof(ICodeGeneratorServices).FullName;
 }
Ejemplo n.º 50
0
 public CompositeNamingService(INamingService defaultService, IServiceExtensionsConfiguration configuration) : base(defaultService, configuration)
 {
     InitalizeNamers();
 }
Ejemplo n.º 51
0
 public NamingService(INamingService namingService)
 {
     DefaultNamingService = namingService;
     OptionNames = new Dictionary<OptionSetMetadataBase,
         Dictionary<String, int>>();
 }
		public ControllerPartialsGenerator(ILogger logger, ISourceGenerator source, INamingService naming,
		                                   string targetNamespace, string serviceType)
			: base(logger, source, naming, targetNamespace, serviceType)
		{
		}
 public GenerateMonoRailSiteTreeTask(ILogger logger, ISiteTreeGeneratorService service, INamingService naming, ISourceGenerator source, IParsedSourceStorageService sourceStorage, ITypeResolver typeResolver, ITreeCreationService treeService, IViewSourceMapper viewSourceMapper, IGenerator generator)
 {
     _service = service;
     _logger = logger;
     _naming = naming;
     _source = source;
     _sourceStorage = sourceStorage;
     _typeResolver = typeResolver;
     _treeService = treeService;
     _viewSourceMapper = viewSourceMapper;
     _generators.Add(generator);
     this.ServiceTypeName = typeof(ICodeGeneratorServices).FullName;
 }
Ejemplo n.º 54
0
		public CodeDomGenerator(INamingService namingService)
		{
			_namingService = namingService;
		}
        private CodeTypeDeclaration GenerateEnum(EntityMetadata entityMetadata, MultiSelectPicklistAttributeMetadata metadata, IServiceProvider services, INamingService service)
        {
            var name = service.GetNameForOptionSet(entityMetadata, metadata.OptionSet, services);
            var type = new CodeTypeDeclaration(name)
            {
                IsEnum = true
            };

            type.CustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(DataContractAttribute))));

            var version = System.Diagnostics.FileVersionInfo.GetVersionInfo(typeof(INamingService).Assembly.Location).ProductVersion;

            type.CustomAttributes.Add(new CodeAttributeDeclaration(
                                          new CodeTypeReference(typeof(GeneratedCodeAttribute)),
                                          new CodeAttributeArgument(new CodePrimitiveExpression("CrmSvcUtil")),
                                          new CodeAttributeArgument(new CodePrimitiveExpression(version))));

            foreach (var option in metadata.OptionSet.Options)
            {
                // Creates the enum member
                CodeMemberField value = new CodeMemberField
                {
                    Name           = service.GetNameForOption(metadata.OptionSet, option, services),
                    InitExpression = new CodePrimitiveExpression(option.Value.GetValueOrDefault())
                };
                value.CustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(EnumMemberAttribute))));

                type.Members.Add(value);
            }

            return(type);
        }
 public OverridePropertyNames(INamingService defaultService)
 {
     DefaultService = defaultService;
     EntityAttributeSpecifiedNames = ConfigHelper.GetDictionaryList(ConfigurationManager.AppSettings["EntityAttributeSpecifiedNames"], false);
 }