コード例 #1
0
ファイル: ServiceFile.cs プロジェクト: MiniverCheevy/Spawn
		public ServiceFile(ProjectFacade project, TypeFacade type, Resource resource) 
			: base(project, type, resource)
		{
			Template = new ServiceTemplate { File = this };
			Name = resource.Name;			
			Name = $"{Name}Service";
		}
コード例 #2
0
		public RestResourcesFile(ProjectFacade project)
			: base(project)
		{
			Template = new RestResourcesTemplate {File = this};
			Name = "RestResources";
			OverwriteExistingFile = true;
		}
コード例 #3
0
ファイル: MessageFile.cs プロジェクト: MiniverCheevy/Spawn
		public MessageFile(ProjectFacade project, TypeFacade type)
			: base(project, type)
		{
			Template = new MessageTemplate {File = this};
			Name = string.Format("{0}Message", Name);
			HasDetail = type.HasDetailFlag;
		}
コード例 #4
0
		public ListsRequestFile(ProjectFacade project)
			: base(project, null)
		{
			Template = new ListsRequestTemplate {File = this};
			Name = "ListsRequest";
			PageSpecificUsingStatements.Add("System.Collections.Generic");
		}
コード例 #5
0
ファイル: ConstantsFile.cs プロジェクト: MiniverCheevy/Spawn
		public ConstantsFile(ProjectFacade project)
			: base(project)
		{
			Template = new ConstantsTemplate {File = this};
			Name = "Constants";
			OverwriteExistingFile = true;
		}
コード例 #6
0
		public CustomAuhtorizeAttributeFile(ProjectFacade project)
			: base(project)
		{
			Template = new CustomAuhtorizeAttributeTemplate { File = this };
			Name = "CustomAuhtorizeAttribute";
			OverwriteExistingFile = false;
		}
コード例 #7
0
ファイル: IocFile.cs プロジェクト: MiniverCheevy/Spawn
		public IocFile(ProjectFacade project)
			: base(project)
		{
			Template = new IocTemplate {File = this};
			Name = "Ioc";
			PageSpecificUsingStatements.Add(ContextNamespace);
		}
コード例 #8
0
		public ApiControllerBaseFile(ProjectFacade project)
			: base(project)
		{
			Template = new ApiControllerBaseTemplate {File = this};
			Name = "ApiControllerBase";
			OverwriteExistingFile = false;
		}
コード例 #9
0
		public MappingTestsFile(ProjectFacade project, TypeFacade type, ProjectFacade logic)
			: base(project, type)
		{
			Template = new MappingTestsTemplate {File = this};
			Name = string.Format("{0}MappingTests", Name);
			PageSpecificUsingStatements.Add(logic.RootNamespace + ".Operations." + PluralName);
			PageSpecificUsingStatements.Add(Type.Namespace);
		}
コード例 #10
0
		public DetailQueryFile(ProjectFacade project, TypeFacade type)
			: base(project, type)
		{
			Template = new DetailQueryTemplate {File = this};
			Name = string.Format("{0}DetailQuery", Name);
			if (HasContext)
				PageSpecificUsingStatements.Add(ContextNamespace);
		}
コード例 #11
0
ファイル: TypedCodeFile.cs プロジェクト: MiniverCheevy/Spawn
		protected TypedTestFile(ProjectFacade project, TypeFacade type)
			: base(project, type)
		{
			Tests = Vs.Helper.TestingFramework;
			Tests.RequiredNamespaces.AsEnumerable()
				.ForEach(c => PageSpecificUsingStatements.Add(c));
			PageSpecificUsingStatements.Add("FluentAssertions");
		}
コード例 #12
0
ファイル: ListsEnumFile.cs プロジェクト: MiniverCheevy/Spawn
		public ListsEnumFile(ProjectFacade project, TypeInformation[] types)
			: base(project, null)
		{
			Template = new ListsEnumTemplate {File = this};
			Names = types.Select(c => c.Name).ToArray();
			Name = "Lists";
			OverwriteExistingFile = true;
		}
コード例 #13
0
		public AddCommandTestsFile(ProjectFacade project, TypeFacade type, ProjectFacade logic)
			: base(project, type)
		{
			Template = new AddCommandTestsTemplate {File = this};
			Name = string.Format("{0}AddCommandTests", Name);
			PageSpecificUsingStatements.Add(logic.RootNamespace + ".Operations." + PluralName);
			PageSpecificUsingStatements.Add("Voodoo.TestData");
		}
コード例 #14
0
ファイル: SampleFile.cs プロジェクト: MiniverCheevy/Spawn
		public SampleFile(ProjectFacade project, TypeFacade type)
			: base(project, type)
		{
			Template = new SampleTemplate {File = this};
			Name = string.Format("{0}Sample", Name);
			PageSpecificUsingStatements.Add(ContextNamespace);
			PageSpecificUsingStatements.Add(type.Namespace);
			PageSpecificUsingStatements.Add("Voodoo.Infrastructure");
		}
コード例 #15
0
ファイル: HelperFile.cs プロジェクト: MiniverCheevy/Spawn
		public HelperFile(ProjectFacade project, TypeFacade type)
			: base(project, type)
		{
			FriendlyName = Name.ToFriendlyString();
			Template = new HelperTemplate {File = this};
			Name = string.Format("{0}Helper", Name);
			PageSpecificUsingStatements.Add(Type.Namespace);
			Errors = type.Properties.SelectMany(c => c.ErrorMessages).Select(c => c.Text).ToArray();
		}
コード例 #16
0
		public ListsResponseFile(ProjectFacade project, TypeInformation[] types)
			: base(project, null)
		{
			Template = new ListsResponseTemplate {File = this};
			Name = "ListsResponse";
			OverwriteExistingFile = true;
			TypeNames = types.Select(c => c.PluralName).ToArray();
			PageSpecificUsingStatements.Add("Voodoo.Messages");
			PageSpecificUsingStatements.Add("System.Collections.Generic");
		}
コード例 #17
0
		public MappingTestHelperFile(ProjectFacade project)
			: base(project)
		{
			Tests = Vs.Helper.TestingFramework;
			Tests.RequiredNamespaces.AsEnumerable()
				.ForEach(c => PageSpecificUsingStatements.Add(c));
			PageSpecificUsingStatements.Add("FluentAssertions");
			Template = new MappingTestHelperTemplate {File = this};
			Name = "MappingTestHelper";
		}
コード例 #18
0
		public EditCommandFile(ProjectFacade project, TypeFacade type)
			: base(project, type)
		{
			Template = new EditCommandTemplate {File = this};
			Name = string.Format("{0}EditCommand", Name);
			PageSpecificUsingStatements.Add(ContextNamespace);
			PageSpecificUsingStatements.Add(type.Namespace);
			PageSpecificUsingStatements.Add("Voodoo.Infrastructure");
			UseSoftEdit = type.HasActiveFlag;
		}
コード例 #19
0
ファイル: TestHelperFile.cs プロジェクト: MiniverCheevy/Spawn
		public TestHelperFile(ProjectFacade project, TypeFacade type, ProjectFacade logic)
			: base(project, type)
		{			
			Template = new TestHelperTemplate {File = this};
			Name = string.Format("{0}TestHelper", Name);
			PageSpecificUsingStatements.Add(logic.RootNamespace + ".Operations." + PluralName);
			PageSpecificUsingStatements.Add("Voodoo.TestData");
			PageSpecificUsingStatements.Add(ContextNamespace);
			PageSpecificUsingStatements.Add(logic.RootNamespace);			
		}
コード例 #20
0
ファイル: ListQueryFile.cs プロジェクト: MiniverCheevy/Spawn
		public ListQueryFile(ProjectFacade project, TypeFacade type)
			: base(project, type)
		{
			Template = new ListQueryTemplate {File = this};
			Name = string.Format("{0}ListQuery", Name);
			if (HasContext)
			{
				PageSpecificUsingStatements.Add(ContextNamespace);
				PageSpecificUsingStatements.Add("Voodoo");
			}
		}
コード例 #21
0
ファイル: TSServiceFile.cs プロジェクト: MiniverCheevy/Spawn
		protected TsServiceFileBase(ProjectFacade project, TypeFacade type, Resource resource)
			: base(project, type)
		{
			Name = resource.Name;
			TsName = firstLetterLower(Name);
			Name = $"{Name}Factory";
			Resource = resource;
			OverwriteExistingFile = true;
			
			Builder = new TypeScriptGraphBuilder();
		}
コード例 #22
0
ファイル: JsServiceFile.cs プロジェクト: MiniverCheevy/Spawn
		public JsServiceFile(ProjectFacade project, TypeFacade type, Resource resource)
			: base(project, type)
		{
			Name = resource.Name;
			Template = new JsServiceTemplate {File = this};
			JsName = firstLetterLower(Name);
			Name = string.Format("{0}Factory", Name);
			Resource = resource;
			OverwriteExistingFile = true;

			Template = new JsServiceTemplate {File = this};
		}
コード例 #23
0
		public ListsHelperFile(ProjectFacade project, TypeInformation[] types)
			: base(project, null)
		{
			Template = new ListsHelperTemplate {File = this};
			Name = "ListsHelper";
			Types = types;
			OverwriteExistingFile = true;
			PageSpecificUsingStatements.Add("Voodoo.Messages");
			PageSpecificUsingStatements.Add("System.Collections.Generic");
			PageSpecificUsingStatements.Add("System.Linq");
			PageSpecificUsingStatements.Add(ContextNamespace);
		}
コード例 #24
0
		public static CodeFile GetJavaScriptFile(ProjectFacade web, TypeFacade type, Resource item)
		{
			if (Vs.Helper.Solution.WebFramework == WebFramework.Angular1)
			{
				var service = new Angular.JsServiceFile(web, type, item);
				return service;
			}
			else if (Vs.Helper.Solution.WebFramework == WebFramework.Aurelia)
			{
				var service = new Aurelia.JsServiceFile(web, type, item);
				return service;
			}
			throw new NotImplementedException();
		}
コード例 #25
0
		public static CodeFile GetTypeScriptModelsFile(ProjectFacade web, Type[] types)
		{
			if (Vs.Helper.Solution.WebFramework == WebFramework.Angular1)
			{
				var service = new Angular.TypeScriptModelsFile(web, types);
				return service;
			}
			else if (Vs.Helper.Solution.WebFramework == WebFramework.Aurelia)
			{
				var service = new Aurelia.TypeScriptModelsFile(web, types);
				return service;
			}
			throw new NotImplementedException();
		}
コード例 #26
0
		public ApiControllerFile(ProjectFacade project, TypeFacade type, Resource resource)
			: base(project, type)
		{
			Resource = resource;
			OverwriteExistingFile = true;
			Template = new ApiControllerTemplate {File = this};
			Name = resource.Name;
			PageSpecificUsingStatements.Add("Voodoo.Messages");
			foreach (var verb in resource.Verbs)
			{
				addNamespaces(verb.OperationType);
				addNamespaces(verb.RequestType);
				addNamespaces(verb.ResponseType);
			}
		}
コード例 #27
0
ファイル: TestFile.cs プロジェクト: MiniverCheevy/Spawn
		public TestFile(ProjectFacade project, TypeFacade type, ProjectFacade logic)
			: base(project, type)
		{
			this.Operation = Operation.DiscoverTypes(type.SystemType, new Operation());
			if (Operation != null)
			{ 
			
			this.PageSpecificUsingStatements.Add(Operation.RequestType.Namespace);
			}
			LogicProject = logic;
			Template = new TestTemplate { File = this };
			Name = string.Format("{0}Tests", Name);
			PageSpecificUsingStatements.Add(ContextNamespace);
			PageSpecificUsingStatements.Add(logic.RootNamespace);
			PageSpecificUsingStatements.Add(Type.Namespace);
		}
コード例 #28
0
ファイル: TypedCodeFile.cs プロジェクト: MiniverCheevy/Spawn
		protected CodeFile(ProjectFacade project)
		{
			if (project != null)
			{
				Project = project;
				PageSpecificUsingStatements = new List<string>();


				if (Vs.Helper.Solution.ContextType != null)
				{
					HasContext = true;
					ContextName = Vs.Helper.Solution.ContextType.Name;
					ContextNamespace = Vs.Helper.Solution.ContextType.Namespace;
				}
			}
		}
コード例 #29
0
		public static TsServiceFileBase GetTypeScriptFile(ProjectFacade web, TypeFacade type, Resource item)
		{
			//TODO:refactor
			if (Vs.Helper.Solution.WebFramework == WebFramework.Angular1)
			{
				var service = new Angular.TsServiceFile(web, type, item);
				service.Template = new Angular.TsServiceTemplate { File = service };
				return service;
			}
			else if (Vs.Helper.Solution.WebFramework == WebFramework.Aurelia)
			{
				var service = new Aurelia.TsServiceFile(web, type, item);
				service.Template = new Aurelia.TsServiceTemplate { File = service };
				return service;
			}
			throw new NotImplementedException();


		}
コード例 #30
0
ファイル: MapperFile.cs プロジェクト: MiniverCheevy/Spawn
		public MapperFile(ProjectFacade project, TypeFacade type)
			: base(project, type)
		{
			HasDetail = type.HasDetailFlag;
			Template = new MapperTemplate { File = this };
			Name = string.Format("{0}Mapper", Name);
			ModelName = string.Format("{0}", type.Name);
			PageSpecificUsingStatements.Add(Type.Namespace);

			OverwriteExistingFile = true;
			var modelType = type;

			var messageType = Vs.Helper.FindType(Type.MessageName);

			addMapping(messageType, Type.MessageProperties, $"Message");

			if (HasDetail)
			{
				messageType = Vs.Helper.FindType(Type.DetailName);
				addMapping(messageType, Type.DetailMessageProperties, $"Detail");
			}

			var mappings = project.MappingTypes.ToArray();

			foreach (var map in mappings)
			{
				var attribute = map.GetCustomAttribute<MapsToAttribute>();
				if (attribute.Type.FullName == type.SystemType.FullName)
				{					
						var facade = new TypeFacade(map);
						Mappings.Add(new Mapping(Type, facade));
						PageSpecificUsingStatements.Add(facade.SystemType.Namespace);

				}
			}
		}