├── DemoPageProxyGenerator ├── ProxyGeneratorNgDemoPage │ ├── Web │ │ ├── src │ │ │ ├── assets │ │ │ │ └── .gitkeep │ │ │ ├── app │ │ │ │ ├── app.component.scss │ │ │ │ ├── app.component.html │ │ │ │ └── app.module.ts │ │ │ ├── environments │ │ │ │ ├── environment.prod.ts │ │ │ │ └── environment.ts │ │ │ ├── styles.scss │ │ │ ├── favicon.ico │ │ │ ├── tsconfig.app.json │ │ │ ├── tsconfig.spec.json │ │ │ ├── tslint.json │ │ │ ├── main.ts │ │ │ ├── browserslist │ │ │ ├── test.ts │ │ │ ├── index.html │ │ │ ├── karma.conf.js │ │ │ └── polyfills.ts │ │ ├── wwwroot │ │ │ ├── favicon.ico │ │ │ └── index.html │ │ ├── e2e │ │ │ ├── src │ │ │ │ ├── app.po.ts │ │ │ │ └── app.e2e-spec.ts │ │ │ ├── tsconfig.e2e.json │ │ │ └── protractor.conf.js │ │ ├── .editorconfig │ │ ├── tsconfig.json │ │ ├── .gitignore │ │ ├── README.md │ │ ├── package.json │ │ └── tslint.json │ ├── Content │ │ └── sxpStyles.scss │ ├── Global.asax │ ├── favicon.ico │ ├── Models │ │ ├── ClientAccess.cs │ │ ├── Auto.cs │ │ ├── Company.cs │ │ ├── Person.cs │ │ └── GenericsTestklasse.cs │ ├── App_Start │ │ ├── FilterConfig.cs │ │ ├── BundleConfig.cs │ │ └── RouteConfig.cs │ ├── Controllers │ │ └── HomeController.cs │ ├── Global.asax.cs │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── package-lock.json ├── ProxyGeneratorDemoPage │ ├── Scripts │ │ ├── Enums.js │ │ ├── Enums.js.map │ │ ├── Enums.ts │ │ ├── _references.js │ │ ├── TypeLite.Net4.d.ts │ │ ├── TypeLite.Net4.tt │ │ ├── systemjs.config.js │ │ └── typings │ │ │ └── angularjs │ │ │ ├── angular-sanitize.d.ts │ │ │ └── angular-cookies.d.ts │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Proxy │ │ │ ├── TestView.cshtml │ │ │ ├── JQueryCalls.cshtml │ │ │ └── AngularCalls.cshtml │ │ └── Web.config │ ├── wwwroot │ │ ├── app.map │ │ ├── vendors.map │ │ ├── app.bundle.js │ │ └── vendors.bundle.js │ ├── Global.asax │ ├── typings.json │ ├── favicon.ico │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── ScriptsApp │ │ ├── Classes │ │ │ ├── Company.ts │ │ │ ├── Auto.ts │ │ │ ├── Person.ts │ │ │ ├── Auto.js.map │ │ │ ├── Auto.js │ │ │ ├── Company.js │ │ │ ├── Company.js.map │ │ │ ├── Person.js.map │ │ │ └── Person.js │ │ ├── Views │ │ │ ├── mainApp.js.map │ │ │ ├── mainApp.ts │ │ │ └── mainApp.js │ │ ├── Directives │ │ │ ├── fileUpload.js.map │ │ │ ├── fileUpload.js │ │ │ └── fileUpload.ts │ │ └── Services │ │ │ ├── homeAngularJsSrv.js │ │ │ ├── homePService.js.map │ │ │ ├── homePService.ts │ │ │ ├── homePService.js │ │ │ └── proxyAngularJsSrv.js │ ├── Helper │ │ ├── ClientAccess.cs │ │ ├── Company.cs │ │ ├── Auto.cs │ │ ├── Person.cs │ │ ├── GenericsTestklasse.cs │ │ └── CustomErrorHandlerAttribute.cs │ ├── App_Start │ │ ├── FilterConfig.cs │ │ ├── RouteConfig.cs │ │ ├── WebApiConfig.cs │ │ ├── BundleConfig.cs │ │ └── NinjectWebCommon.cs │ ├── Startup.cs │ ├── Content │ │ └── Site.css │ ├── Config │ │ ├── types │ │ │ └── json │ │ │ │ └── index.d.ts │ │ ├── helpers.js │ │ ├── karma.entry.js │ │ ├── karma.conf.js │ │ └── webpack.test.js │ ├── Global.asax.cs │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Controllers │ │ └── HomeController.cs │ └── packages.config ├── NuGet.Packager │ ├── NuGet.exe │ ├── lib │ │ ├── ProxyGenerator.dll │ │ └── ProxyGenerator.pdb │ ├── TypeScriptAngularJsProxyGenerator.1.0.8.nupkg.bak │ ├── TypeScriptAngularJsProxyGenerator.1.0.9.nupkg.bak │ ├── TypeScriptAngularJsProxyGenerator.1.1.0.nupkg.bak │ ├── TypeScriptAngularJsProxyGenerator.1.2.0.nupkg.bak │ ├── TypeScriptAngularJsProxyGenerator.1.2.1.nupkg.bak │ ├── TypeScriptAngularJsProxyGenerator.2.0.0.nupkg.bak │ ├── TypeScriptAngularJsProxyGenerator.2.0.2.nupkg.bak │ ├── TypeScriptAngularJsProxyGenerator.2.1.0.nupkg.bak │ ├── TypeScriptAngularJsProxyGenerator.2.1.1.nupkg.bak │ ├── TypeScriptAngularJsProxyGenerator.2.1.2.nupkg.bak │ ├── TypeScriptAngularJsProxyGenerator.1.0.10.nupkg.bak │ ├── TypeScriptAngularJsProxyGenerator.1.0.11.nupkg.bak │ ├── NuGet.config │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Package.nuspec ├── DomainModels │ ├── packages.config │ ├── ClientAccess.cs │ ├── Auto.cs │ ├── Company.cs │ ├── Person.cs │ ├── GenericsTestklasse.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── DomainModels.csproj ├── ProxyGenerator │ ├── Interfaces │ │ ├── IFileHelper.cs │ │ ├── IProxyBuilderHttpCall.cs │ │ ├── IProxyBuilderDataTypeHelper.cs │ │ ├── ILogManager.cs │ │ ├── IAssemblyManager.cs │ │ ├── IProxyBuilder.cs │ │ ├── IMethodManager.cs │ │ ├── IMethodParameterManager.cs │ │ ├── ISettingsManager.cs │ │ ├── IControllerManager.cs │ │ ├── IProxyGeneratorFactoryManager.cs │ │ └── IProxyBuilderHelper.cs │ ├── Container │ │ ├── LogEntry.cs │ │ ├── GeneratedProxyEntry.cs │ │ ├── ProxyControllerInfo.cs │ │ ├── TemplateEntry.cs │ │ ├── ProxyMethodParameterInfo.cs │ │ ├── ProxyMethodInfo.cs │ │ └── ProxySettings.cs │ ├── Enums │ │ ├── ProxyBuilder.cs │ │ └── TemplateTypes.cs │ ├── packages.config │ ├── ConstValues.cs │ ├── ProxyTypeAttributes │ │ ├── CreateJQueryTsProxyAttribute.cs │ │ ├── CreateAngularJsProxyAttribute.cs │ │ ├── CreateAngularTsProxyAttribute.cs │ │ ├── CreateJQueryJsProxyAttribute.cs │ │ ├── CreateAngular2TsProxyAttribute.cs │ │ ├── CreateAngularTsImplementsForServiceAttribute.cs │ │ └── CreateProxyBaseAttribute.cs │ ├── ConstValuesTemplates.cs │ ├── Manager │ │ ├── LogManager.cs │ │ ├── ProxyGeneratorFactoryManager.cs │ │ └── MethodParameterManager.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Builder │ │ └── Helper │ │ │ └── ReflectionHelper.cs │ └── FileHelper.cs ├── UnitTests │ ├── TestHelper │ │ ├── TestClasses │ │ │ ├── TestEnum.cs │ │ │ ├── Person.cs │ │ │ └── GenericsTestClasses.cs │ │ ├── AccessPrivateProperties.cs │ │ └── ProxyControllerInfoGenerator.cs │ ├── packages.config │ ├── app.config │ ├── FileHelperTests │ │ ├── GetParentDirectory.cs │ │ └── GetProxyFileOutputPath.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Builder │ │ └── Helper │ │ ├── ProxyBuilderHelperTests │ │ ├── GetClearControllerName.cs │ │ ├── BuildUrlParameterId.cs │ │ ├── GetProxyFunctionName.cs │ │ ├── GetProxyFileName.cs │ │ ├── HasAttribute.cs │ │ └── GetServiceName.cs │ │ └── ProxyBuilderDataTypeHelperTests │ │ ├── HasReturnType.cs │ │ └── AddInterfacePrefixToFullName.cs ├── Readme - NuGetPackager.txt └── ProxyGenerator.sln └── .gitattributes /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "lockfileVersion": 1 3 | } 4 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Scripts/Enums.js: -------------------------------------------------------------------------------- 1 | //# sourceMappingURL=Enums.js.map -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Content/sxpStyles.scss: -------------------------------------------------------------------------------- 1 | //Boostrap laden 2 | @import '~bootstrap/scss/bootstrap.scss'; 3 | 4 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/wwwroot/app.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"app.bundle.js","sourceRoot":""} -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/wwwroot/vendors.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"vendors.bundle.js","sourceRoot":""} -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Scripts/Enums.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Enums.js","sourceRoot":"","sources":["Enums.ts"],"names":[],"mappings":"AAMC"} -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/NuGet.exe -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ProxyGeneratorDemoPage.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "es6-shim": "registry:dt/es6-shim#0.31.2+20160602141504" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ProxyGeneratorNgDemoPage.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/DomainModels/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGeneratorDemoPage/favicon.ico -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/lib/ProxyGenerator.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/lib/ProxyGenerator.dll -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/lib/ProxyGenerator.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/lib/ProxyGenerator.pdb -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/favicon.ico -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Interfaces/IFileHelper.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGenerator/Interfaces/IFileHelper.cs -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Scripts/Enums.ts: -------------------------------------------------------------------------------- 1 | module ProxyGeneratorDemoPage.Helper { 2 | export const enum ClientAccess { 3 | All = 0, 4 | None = 1, 5 | Admin = 2 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/favicon.ico -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Scripts/_references.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGeneratorDemoPage/Scripts/_references.js -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/TestHelper/TestClasses/TestEnum.cs: -------------------------------------------------------------------------------- 1 | namespace UnitTests.TestHelper.TestClasses 2 | { 3 | public enum TestEnum 4 | { 5 | TestWert1, 6 | TestWert2 7 | } 8 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/wwwroot/favicon.ico -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Interfaces/IProxyBuilderHttpCall.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGenerator/Interfaces/IProxyBuilderHttpCall.cs -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Interfaces/IProxyBuilderDataTypeHelper.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGenerator/Interfaces/IProxyBuilderDataTypeHelper.cs -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/app/app.component.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/app/app.component.html -------------------------------------------------------------------------------- /DemoPageProxyGenerator/DomainModels/ClientAccess.cs: -------------------------------------------------------------------------------- 1 | using TypeLite; 2 | 3 | namespace DomainModels 4 | { 5 | [TsEnum] 6 | public enum ClientAccess 7 | { 8 | All, 9 | None, 10 | Admin 11 | } 12 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGeneratorDemoPage/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGeneratorDemoPage/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGeneratorDemoPage/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.0.8.nupkg.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.0.8.nupkg.bak -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.0.9.nupkg.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.0.9.nupkg.bak -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.1.0.nupkg.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.1.0.nupkg.bak -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.2.0.nupkg.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.2.0.nupkg.bak -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.2.1.nupkg.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.2.1.nupkg.bak -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.2.0.0.nupkg.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.2.0.0.nupkg.bak -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.2.0.2.nupkg.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.2.0.2.nupkg.bak -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.2.1.0.nupkg.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.2.1.0.nupkg.bak -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.2.1.1.nupkg.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.2.1.1.nupkg.bak -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.2.1.2.nupkg.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.2.1.2.nupkg.bak -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/ProxyGeneratorDemoPage/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.0.10.nupkg.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.0.10.nupkg.bak -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.0.11.nupkg.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/squadwuschel/MvcControllerToProxyGenerator/HEAD/DemoPageProxyGenerator/NuGet.Packager/TypeScriptAngularJsProxyGenerator.1.0.11.nupkg.bak -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Classes/Company.ts: -------------------------------------------------------------------------------- 1 | class Company implements ProxyGeneratorDemoPage.Helper.ICompany { 2 | constructor(public Name: string, public Age: number, public ClientAccess: ProxyGeneratorDemoPage.Helper.ClientAccess) { } 3 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Helper/ClientAccess.cs: -------------------------------------------------------------------------------- 1 | using TypeLite; 2 | 3 | namespace ProxyGeneratorDemoPage.Helper 4 | { 5 | [TsEnum] 6 | public enum ClientAccess 7 | { 8 | All, 9 | None, 10 | Admin 11 | } 12 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Models/ClientAccess.cs: -------------------------------------------------------------------------------- 1 | using TypeLite; 2 | 3 | namespace ProxyGeneratorNgDemoPage.Models 4 | { 5 | [TsEnum] 6 | public enum ClientAccess 7 | { 8 | All, 9 | None, 10 | Admin 11 | } 12 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Classes/Auto.ts: -------------------------------------------------------------------------------- 1 | class Auto implements ProxyGeneratorDemoPage.Models.Person.Models.IAuto { 2 | constructor(public Marke: string, public Alter: number, public Eigentuemer: ProxyGeneratorDemoPage.Models.Person.Models.IPerson) { } 3 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Classes/Person.ts: -------------------------------------------------------------------------------- 1 | class Person implements ProxyGeneratorDemoPage.Models.Person.Models.IPerson { 2 | constructor(public Id: number, public Name: string, public Passwort: string, public IsAktiv: boolean, public CounterValues: number[]) { } 3 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model System.Web.Mvc.HandleErrorInfo 2 | 3 | @{ 4 | ViewBag.Title = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/Readme - NuGetPackager.txt: -------------------------------------------------------------------------------- 1 | If you want to use the NuGet.Packager Project you need to Install the VS Extension: 2 | 3 | https://visualstudiogallery.msdn.microsoft.com/daf5c6db-386b-4994-bdd7-b6cd52f11b72 4 | 5 | (The Extension creates a NuGet Package and can publish it to NuGet, if you want) -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Interfaces/ILogManager.cs: -------------------------------------------------------------------------------- 1 | namespace ProxyGenerator.Interfaces 2 | { 3 | public interface ILogManager 4 | { 5 | void AddMessage(string name, string message); 6 | string GetCompleteLogAsString(bool writelog); 7 | bool WriteLog { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Classes/Auto.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Auto.js","sourceRoot":"","sources":["Auto.ts"],"names":[],"mappings":"AAAA;IACI,cAAmB,KAAa,EAAS,KAAa,EAAS,WAAgE;QAA5G,UAAK,GAAL,KAAK,CAAQ;QAAS,UAAK,GAAL,KAAK,CAAQ;QAAS,gBAAW,GAAX,WAAW,CAAqD;IAAK,CAAC;IACzI,WAAC;AAAD,CAAC,AAFD,IAEC"} -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Classes/Auto.js: -------------------------------------------------------------------------------- 1 | var Auto = (function () { 2 | function Auto(Marke, Alter, Eigentuemer) { 3 | this.Marke = Marke; 4 | this.Alter = Alter; 5 | this.Eigentuemer = Eigentuemer; 6 | } 7 | return Auto; 8 | }()); 9 | //# sourceMappingURL=Auto.js.map -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Classes/Company.js: -------------------------------------------------------------------------------- 1 | var Company = (function () { 2 | function Company(Name, Age, ClientAccess) { 3 | this.Name = Name; 4 | this.Age = Age; 5 | this.ClientAccess = ClientAccess; 6 | } 7 | return Company; 8 | }()); 9 | //# sourceMappingURL=Company.js.map -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Classes/Company.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Company.js","sourceRoot":"","sources":["Company.ts"],"names":[],"mappings":"AAAA;IACI,iBAAmB,IAAY,EAAS,GAAW,EAAS,YAAwD;QAAjG,SAAI,GAAJ,IAAI,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;QAAS,iBAAY,GAAZ,YAAY,CAA4C;IAAI,CAAC;IAC7H,cAAC;AAAD,CAAC,AAFD,IAEC"} -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Interfaces/IAssemblyManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection; 3 | 4 | namespace ProxyGenerator.Interfaces 5 | { 6 | public interface IAssemblyManager 7 | { 8 | List LoadAssemblies(string webprojectName, string fullPathToTheWebProject); 9 | } 10 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Interfaces/IProxyBuilder.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using ProxyGenerator.Container; 3 | 4 | namespace ProxyGenerator.Interfaces 5 | { 6 | public interface IProxyBuilder 7 | { 8 | List BuildProxy(List proxyControllerInfos); 9 | } 10 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Interfaces/IMethodManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using ProxyGenerator.Container; 4 | 5 | namespace ProxyGenerator.Interfaces 6 | { 7 | public interface IMethodManager 8 | { 9 | List LoadMethodInfos(Type controller, Type proxyTypeAttribute); 10 | } 11 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace ProxyGeneratorDemoPage 4 | { 5 | public class FilterConfig 6 | { 7 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 8 | { 9 | filters.Add(new HandleErrorAttribute()); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin; 2 | using Owin; 3 | using ProxyGeneratorDemoPage; 4 | 5 | [assembly: OwinStartup(typeof(Startup))] 6 | namespace ProxyGeneratorDemoPage 7 | { 8 | public partial class Startup 9 | { 10 | public void Configuration(IAppBuilder app) 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Interfaces/IMethodParameterManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection; 3 | using ProxyGenerator.Container; 4 | 5 | namespace ProxyGenerator.Interfaces 6 | { 7 | public interface IMethodParameterManager 8 | { 9 | List LoadParameterInfos(MethodInfo methodInfo); 10 | } 11 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Classes/Person.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"Person.js","sourceRoot":"","sources":["Person.ts"],"names":[],"mappings":"AAAA;IACI,gBAAmB,EAAU,EAAS,IAAY,EAAS,QAAgB,EAAS,OAAgB,EAAS,aAAuB;QAAjH,OAAE,GAAF,EAAE,CAAQ;QAAS,SAAI,GAAJ,IAAI,CAAQ;QAAS,aAAQ,GAAR,QAAQ,CAAQ;QAAS,YAAO,GAAP,OAAO,CAAS;QAAS,kBAAa,GAAb,aAAa,CAAU;IAAK,CAAC;IAC9I,aAAC;AAAD,CAAC,AAFD,IAEC"} -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Container/LogEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ProxyGenerator.Container 7 | { 8 | public class LogEntry 9 | { 10 | public string Name { get; set; } = String.Empty; 11 | public string Message { get; set; } = String.Empty; 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace ProxyGeneratorNgDemoPage 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Enums/ProxyBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace ProxyGenerator.Enums 2 | { 3 | /// 4 | /// Die Proxybuilder Typen für die Proxies erstellt werden können. 5 | /// 6 | public enum ProxyBuilder 7 | { 8 | AngularJavaScript, 9 | AngularTypeScript, 10 | jQueryJavaScript, 11 | jQueryTypeScript, 12 | Angular2TypeScript 13 | } 14 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Classes/Person.js: -------------------------------------------------------------------------------- 1 | var Person = (function () { 2 | function Person(Id, Name, Passwort, IsAktiv, CounterValues) { 3 | this.Id = Id; 4 | this.Name = Name; 5 | this.Passwort = Passwort; 6 | this.IsAktiv = IsAktiv; 7 | this.CounterValues = CounterValues; 8 | } 9 | return Person; 10 | }()); 11 | //# sourceMappingURL=Person.js.map -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getTitleText()).toEqual('Welcome to Web!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/wwwroot/app.bundle.js: -------------------------------------------------------------------------------- 1 | var ac_app = 2 | webpackJsonpac__name_([1],{ 3 | 4 | /***/ 702: 5 | /***/ (function(module, exports) { 6 | 7 | throw new Error("Module build failed: Error: ENOENT: no such file or directory, open 'C:\\TFSPrivat\\GitHub\\ProxyGenerator\\DemoPageProxyGenerator\\ProxyGeneratorDemoPage\\App\\AppShared\\Build\\boot.ts'"); 8 | 9 | /***/ }) 10 | 11 | },[702]); 12 | //# sourceMappingURL=app.map -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace ProxyGeneratorNgDemoPage 5 | { 6 | public class BundleConfig 7 | { 8 | // Weitere Informationen zur Bündelung finden Sie unter https://go.microsoft.com/fwlink/?LinkId=301862. 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/wwwroot/vendors.bundle.js: -------------------------------------------------------------------------------- 1 | var ac_vendors = 2 | webpackJsonpac__name_([0],{ 3 | 4 | /***/ 419: 5 | /***/ (function(module, exports) { 6 | 7 | throw new Error("Module build failed: Error: ENOENT: no such file or directory, open 'C:\\TFSPrivat\\GitHub\\ProxyGenerator\\DemoPageProxyGenerator\\ProxyGeneratorDemoPage\\App\\AppShared\\Build\\vendors.ts'"); 8 | 9 | /***/ }) 10 | 11 | },[419]); 12 | //# sourceMappingURL=vendors.map -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/DomainModels/Auto.cs: -------------------------------------------------------------------------------- 1 | using TypeLite; 2 | 3 | namespace DomainModels 4 | { 5 | [TsClass] 6 | public class Auto 7 | { 8 | public string Marke { get; set; } 9 | 10 | public int Alter { get; set; } 11 | 12 | public Person Eigentuemer { get; set; } 13 | 14 | public Auto() 15 | { 16 | Marke = "BMW"; 17 | Alter = 5; 18 | Eigentuemer = new Person(); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/ConstValues.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ProxyGenerator 7 | { 8 | static class ConstValues 9 | { 10 | /// 11 | /// Hinter jedem Controller steht als Suffix immer noch einmal "Controller" z.B.: HomeController 12 | /// 13 | public const string ControllerNameSuffix = "Controller"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/DomainModels/Company.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using TypeLite; 3 | 4 | namespace DomainModels 5 | { 6 | [TsClass] 7 | public class Company 8 | { 9 | public Company() 10 | { 11 | Name = String.Empty; 12 | Age = 0; 13 | ClientAccess = ClientAccess.All; 14 | } 15 | 16 | public string Name { get; set; } 17 | public int Age { get; set; } 18 | public ClientAccess ClientAccess { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Models/Auto.cs: -------------------------------------------------------------------------------- 1 | using TypeLite; 2 | 3 | namespace ProxyGeneratorNgDemoPage.Models 4 | { 5 | [TsClass] 6 | public class Auto 7 | { 8 | public string Marke { get; set; } 9 | 10 | public int Alter { get; set; } 11 | 12 | public Person Eigentuemer { get; set; } 13 | 14 | public Auto() 15 | { 16 | Marke = "BMW"; 17 | Alter = 5; 18 | Eigentuemer = new Person(); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Interfaces/ISettingsManager.cs: -------------------------------------------------------------------------------- 1 | using ProxyGenerator.Enums; 2 | 3 | namespace ProxyGenerator.Interfaces 4 | { 5 | public interface ISettingsManager 6 | { 7 | void LoadSettingsFromWebConfig(); 8 | 9 | /// 10 | /// Setzt den alternativen Ausgabepfad für die Templates im passenden Template 11 | /// 12 | /// 13 | string GetAlternateOutputpath(TemplateTypes templateType); 14 | } 15 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { HttpClientModule } from '@angular/common/http'; 3 | import { NgModule } from '@angular/core'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | declarations: [ 9 | AppComponent 10 | ], 11 | imports: [ 12 | BrowserModule, 13 | HttpClientModule 14 | ], 15 | providers: [], 16 | bootstrap: [AppComponent] 17 | }) 18 | export class AppModule { } 19 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Models/Company.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using TypeLite; 3 | 4 | namespace ProxyGeneratorNgDemoPage.Models 5 | { 6 | [TsClass] 7 | public class Company 8 | { 9 | public Company() 10 | { 11 | Name = String.Empty; 12 | Age = 0; 13 | ClientAccess = ClientAccess.All; 14 | } 15 | 16 | public string Name { get; set; } 17 | public int Age { get; set; } 18 | public ClientAccess ClientAccess { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/TestHelper/TestClasses/Person.cs: -------------------------------------------------------------------------------- 1 | namespace UnitTests.TestHelper.TestClasses 2 | { 3 | public class Person 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public string Passwort { get; set; } 10 | 11 | public bool IsAktiv { get; set; } 12 | 13 | public Person() 14 | { 15 | Id = 0; 16 | Name = "TEST Name"; 17 | Passwort = "P@ssw0rd"; 18 | IsAktiv = true; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/ProxyTypeAttributes/CreateJQueryTsProxyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ProxyGenerator.ProxyTypeAttributes 4 | { 5 | /// 6 | /// Dieses Attribut dient aktuell nur dem Markieren von Funktionen die in 7 | /// eine TypeScript Proxy Funktion umgewandelt werden sollen für jQuery 8 | /// 9 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] 10 | public class CreateJQueryTsProxyAttribute : CreateProxyBaseAttribute 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/ProxyTypeAttributes/CreateAngularJsProxyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ProxyGenerator.ProxyTypeAttributes 4 | { 5 | /// 6 | /// Dieses Attribut dient aktuell nur dem Markieren von Funktionen die in 7 | /// eine JavaScript Proxy Funktion umgewandelt werden sollen für AngularJs 8 | /// 9 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] 10 | public class CreateAngularJsProxyAttribute : CreateProxyBaseAttribute 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/ProxyTypeAttributes/CreateAngularTsProxyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ProxyGenerator.ProxyTypeAttributes 4 | { 5 | /// 6 | /// Dieses Attribut dient aktuell nur dem Markieren von Funktionen die in 7 | /// eine TypeScript Proxy Funktion umgewandelt werden sollen für AngularJs 8 | /// 9 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] 10 | public class CreateAngularTsProxyAttribute : CreateProxyBaseAttribute 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/ProxyTypeAttributes/CreateJQueryJsProxyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ProxyGenerator.ProxyTypeAttributes 4 | { 5 | /// 6 | /// Dieses Attribut dient aktuell nur dem Markieren von Funktionen die in 7 | /// einen JavaScript Proxy Funktion umgewandelt werden sollen für für jQuery 8 | /// 9 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] 10 | public class CreateJQueryJsProxyAttribute : CreateProxyBaseAttribute 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "importHelpers": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Helper/Company.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using TypeLite; 6 | 7 | namespace ProxyGeneratorDemoPage.Helper 8 | { 9 | [TsClass] 10 | public class Company 11 | { 12 | public Company() 13 | { 14 | Name = String.Empty; 15 | Age = 0; 16 | ClientAccess = ClientAccess.All; 17 | } 18 | 19 | public string Name { get; set; } 20 | public int Age { get; set; } 21 | public ClientAccess ClientAccess { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Helper/Auto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using TypeLite; 6 | 7 | namespace ProxyGeneratorDemoPage.Models.Person.Models 8 | { 9 | [TsClass] 10 | public class Auto 11 | { 12 | public string Marke { get; set; } 13 | 14 | public int Alter { get; set; } 15 | 16 | public Person Eigentuemer { get; set; } 17 | 18 | public Auto() 19 | { 20 | Marke = "BMW"; 21 | Alter = 5; 22 | Eigentuemer = new Person(); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Container/GeneratedProxyEntry.cs: -------------------------------------------------------------------------------- 1 | namespace ProxyGenerator.Container 2 | { 3 | /// 4 | /// Die generierten Proxyeigenschaften für einen Controller 5 | /// 6 | public class GeneratedProxyEntry 7 | { 8 | public GeneratedProxyEntry() 9 | { 10 | FilePath = string.Empty; 11 | FileContent = string.Empty; 12 | FileName = string.Empty; 13 | } 14 | 15 | public string FileName { get; set; } 16 | public string FileContent { get; set; } 17 | public string FilePath { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/ProxyTypeAttributes/CreateAngular2TsProxyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ProxyGenerator.ProxyTypeAttributes 7 | { 8 | /// 9 | /// Dieses Attribut dient aktuell nur dem Markieren von Funktionen die in 10 | /// eine TypeScript Proxy Funktion umgewandelt werden sollen für AngularJs 11 | /// 12 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] 13 | public class CreateAngular2TsProxyAttribute : CreateProxyBaseAttribute 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Routing; 3 | 4 | namespace ProxyGeneratorDemoPage 5 | { 6 | public class RouteConfig 7 | { 8 | public static void RegisterRoutes(RouteCollection routes) 9 | { 10 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 11 | 12 | routes.MapRoute( 13 | name: "Default", 14 | url: "{controller}/{action}/{id}", 15 | defaults: new { controller = "Proxy", action = "AngularCalls", id = UrlParameter.Optional } 16 | ); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web.Http; 5 | 6 | namespace ProxyGeneratorDemoPage 7 | { 8 | public static class WebApiConfig 9 | { 10 | public static void Register(HttpConfiguration config) 11 | { 12 | config.MapHttpAttributeRoutes(); 13 | 14 | config.Routes.MapHttpRoute( 15 | name: "DefaultApi", 16 | routeTemplate: "api/{controller}/{id}", 17 | defaults: new { id = RouteParameter.Optional } 18 | ); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | /* Set width on the form input elements since they're 100% wide by default */ 20 | input, 21 | select, 22 | textarea { 23 | max-width: 280px; 24 | } 25 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace ProxyGeneratorNgDemoPage.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | [AllowAnonymous] 12 | public ActionResult Index() 13 | { 14 | //die Index.html wird von WebPack in das Verzeichnis kopiert und die Standardroute 15 | //lädt dann automatisch die index.html 16 | return new FilePathResult("~/Web/wwwroot/index.html", "text/html"); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Config/types/json/index.d.ts: -------------------------------------------------------------------------------- 1 | ///Damit wir für Kendo Ui die passenden JSON Dateien laden für die Internationalisierung laden können 2 | ///müssen wir dem TypeScript Compiller erst noch sagen das er auch die JSON Dateien laden soll. 3 | ///Dafür muss die tsconfig.json angepasst werden in den Bereichen 4 | /// "typeRoots": ["./Config/types"], 5 | /// "types": ["node", "json"] 6 | /// Jetzt erkennt auch der Compiller die JSON Dateien und kann diese entsprechend laden. 7 | ///http://stackoverflow.com/questions/39826848/typescript-2-0-types-field-in-tsconfig-json 8 | 9 | declare module "*.json" { 10 | const value: any; 11 | export default value; 12 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/ProxyTypeAttributes/CreateAngularTsImplementsForServiceAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ProxyGenerator.ProxyTypeAttributes 4 | { 5 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] 6 | public class CreateAngularTsImplementsForServiceAttribute : Attribute 7 | { 8 | public Type Implements { get; set; } 9 | 10 | public CreateAngularTsImplementsForServiceAttribute() 11 | { 12 | Implements = null; 13 | } 14 | 15 | public CreateAngularTsImplementsForServiceAttribute(Type implements) 16 | { 17 | this.Implements = implements; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Views/mainApp.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"mainApp.js","sourceRoot":"","sources":["mainApp.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAgBT;AAhBD,WAAO,GAAG,EAAC,CAAC;IACR;QAAA;QAcA,CAAC;QAbU,iBAAS,GAAhB,UAAiB,OAA0B;YACvC,2CAA2C;YAC3C,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;gBACvB,yBAAyB;gBACzB,kBAAkB;gBAClB,mBAAmB;gBACnB,YAAY;gBACZ,wDAAwD;gBACxD,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;gBACrC,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI;gBACrC,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI;aACzC,CAAC,CAAC;QACP,CAAC;QACL,cAAC;IAAD,CAAC,AAdD,IAcC;IAdY,WAAO,UAcnB,CAAA;AACL,CAAC,EAhBM,GAAG,KAAH,GAAG,QAgBT;AAED,0CAA0C;AAC1C,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC"} -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using System.Web.Mvc; 3 | using System.Web.Optimization; 4 | using System.Web.Routing; 5 | 6 | namespace ProxyGeneratorDemoPage 7 | { 8 | public class MvcApplication : System.Web.HttpApplication 9 | { 10 | protected void Application_Start() 11 | { 12 | AreaRegistration.RegisterAllAreas(); 13 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 14 | RouteConfig.RegisterRoutes(RouteTable.Routes); 15 | BundleConfig.RegisterBundles(BundleTable.Bundles); 16 | GlobalConfiguration.Configure(WebApiConfig.Register); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/DomainModels/Person.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using TypeLite; 3 | 4 | namespace DomainModels 5 | { 6 | [TsClass] 7 | public class Person 8 | { 9 | public int Id { get; set; } 10 | 11 | public string Name { get; set; } 12 | 13 | public string Passwort { get; set; } 14 | 15 | public bool IsAktiv { get; set; } 16 | 17 | public List CounterValues { get; set; } 18 | 19 | public Person() 20 | { 21 | Id = 0; 22 | Name = "TEST Name"; 23 | Passwort = "P@ssw0rd"; 24 | IsAktiv = true; 25 | CounterValues = new List() {1, 2, 3, 4, 5}; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Scripts/TypeLite.Net4.d.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | /// 8 | 9 | declare module ProxyGeneratorDemoPage.Models.Person.Models { 10 | interface IAuto { 11 | Marke: string; 12 | Alter: number; 13 | Eigentuemer: ProxyGeneratorDemoPage.Models.Person.Models.IPerson; 14 | } 15 | interface IPerson { 16 | Id: number; 17 | Name: string; 18 | Passwort: string; 19 | IsAktiv: boolean; 20 | CounterValues: number[]; 21 | } 22 | } 23 | declare module ProxyGeneratorDemoPage.Helper { 24 | interface ICompany { 25 | Name: string; 26 | Age: number; 27 | ClientAccess: ProxyGeneratorDemoPage.Helper.ClientAccess; 28 | } 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Optimization; 7 | using System.Web.Routing; 8 | 9 | namespace ProxyGeneratorNgDemoPage 10 | { 11 | public class MvcApplication : System.Web.HttpApplication 12 | { 13 | protected void Application_Start() 14 | { 15 | AreaRegistration.RegisterAllAreas(); 16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 17 | RouteConfig.RegisterRoutes(RouteTable.Routes); 18 | BundleConfig.RegisterBundles(BundleTable.Bundles); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace ProxyGeneratorNgDemoPage 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Models/Person.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using TypeLite; 3 | 4 | namespace ProxyGeneratorNgDemoPage.Models 5 | { 6 | [TsClass] 7 | public class Person 8 | { 9 | public int Id { get; set; } 10 | 11 | public string Name { get; set; } 12 | 13 | public string Passwort { get; set; } 14 | 15 | public bool IsAktiv { get; set; } 16 | 17 | public List CounterValues { get; set; } 18 | 19 | public Person() 20 | { 21 | Id = 0; 22 | Name = "TEST Name"; 23 | Passwort = "P@ssw0rd"; 24 | IsAktiv = true; 25 | CounterValues = new List() {1, 2, 3, 4, 5}; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Helper/Person.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using TypeLite; 4 | 5 | namespace ProxyGeneratorDemoPage.Models.Person.Models 6 | { 7 | [TsClass] 8 | public class Person 9 | { 10 | public int Id { get; set; } 11 | 12 | public string Name { get; set; } 13 | 14 | public string Passwort { get; set; } 15 | 16 | public bool IsAktiv { get; set; } 17 | 18 | public List CounterValues { get; set; } 19 | 20 | public Person() 21 | { 22 | Id = 0; 23 | Name = "TEST Name"; 24 | Passwort = "P@ssw0rd"; 25 | IsAktiv = true; 26 | CounterValues = new List() {1, 2, 3, 4, 5}; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Config/helpers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author: @AngularClass 3 | */ 4 | var path = require('path'); 5 | 6 | // Helper functions 7 | var ROOT = path.resolve(__dirname, '../'); 8 | 9 | function hasProcessFlag(flag) { 10 | return process.argv.join('').indexOf(flag) > -1; 11 | } 12 | 13 | function isWebpackDevServer() { 14 | return process.argv[1] && !!(/webpack-dev-server/.exec(process.argv[1])); 15 | } 16 | 17 | function root(args) { 18 | args = Array.prototype.slice.call(arguments, 0); 19 | return path.join.apply(path, [ROOT].concat(args)); 20 | } 21 | 22 | function rootPath() { 23 | return ROOT; 24 | } 25 | 26 | exports.hasProcessFlag = hasProcessFlag; 27 | exports.isWebpackDevServer = isWebpackDevServer; 28 | exports.root = root; 29 | exports.rootPath = rootPath; 30 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Views/mainApp.ts: -------------------------------------------------------------------------------- 1 | module App { 2 | export class MainApp { 3 | static createApp(angular: ng.IAngularStatic) { 4 | //Alle Module definieren die wir verwenden. 5 | angular.module("app.main", [ 6 | //Eigene Module einbinden 7 | "homeAngularJsSrv", 8 | "proxyAngularJsSrv", 9 | "fileUpload", 10 | //Module die mit TypeScript geschrieben wurden einbinden 11 | App.Views.Proxy.ProxyCtrl.module.name, 12 | App.Services.HomePService.module.name, 13 | App.Services.ProxyPService.module.name, 14 | ]); 15 | } 16 | } 17 | } 18 | 19 | //Unsere Anwendung intial aufrufen/starten 20 | App.MainApp.createApp(angular); -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # profiling files 12 | chrome-profiler-events.json 13 | speed-measure-plugin.json 14 | 15 | # IDEs and editors 16 | /.idea 17 | .project 18 | .classpath 19 | .c9/ 20 | *.launch 21 | .settings/ 22 | *.sublime-workspace 23 | 24 | # IDE - VSCode 25 | .vscode/* 26 | !.vscode/settings.json 27 | !.vscode/tasks.json 28 | !.vscode/launch.json 29 | !.vscode/extensions.json 30 | 31 | # misc 32 | /.sass-cache 33 | /connect.lock 34 | /coverage 35 | /libpeerconnection.log 36 | npm-debug.log 37 | yarn-error.log 38 | testem.log 39 | /typings 40 | 41 | # System Files 42 | .DS_Store 43 | Thumbs.db 44 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Enums/TemplateTypes.cs: -------------------------------------------------------------------------------- 1 | namespace ProxyGenerator.Enums 2 | { 3 | public enum TemplateTypes 4 | { 5 | jQueryTsModule, 6 | jQueryTsAjaxCallWithReturnType, 7 | jQueryTsAjaxCallNoReturnType, 8 | jQueryTsWindowLocationHref, 9 | jQueryJsModule, 10 | jQueryJsPrototype, 11 | jQueryJsWindowLocationHref, 12 | AngularJsModule, 13 | AngularJsPrototype, 14 | AngularJsWindowLocationHref, 15 | AngularTsModule, 16 | AngularTsAjaxCallWithReturnType, 17 | AngularTsAjaxCallNoReturnType, 18 | AngularTsWindowLocationHref, 19 | Angular2TsModule, 20 | Angular2TsModuleObservableWithReturnType, 21 | Angular2TsModuleObservableNoReturnType, 22 | Angular2TsWindowLocationHref 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Web 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |
16 |
17 |
18 |

App is Loading .... please wait ....

19 |
20 |
21 |

22 | 23 |

24 |
25 |
26 |
27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Container/ProxyControllerInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ProxyGenerator.Container 5 | { 6 | public class ProxyControllerInfo 7 | { 8 | #region Member 9 | /// 10 | /// Der Name des Controllers OHNE den Controller Suffix 11 | /// 12 | public string ControllerNameWithoutSuffix { get; set; } 13 | 14 | /// 15 | /// Reflexion Type für den Aktuellen Controller 16 | /// 17 | public Type Controller { get; set; } 18 | 19 | public List ProxyMethodInfos { get; set; } 20 | #endregion 21 | 22 | #region Konstruktor 23 | public ProxyControllerInfo() 24 | { 25 | ProxyMethodInfos = new List(); 26 | } 27 | #endregion 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Views/Proxy/TestView.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | Layout = null; 4 | } 5 | 6 | 7 |
8 |
9 |

TestView

10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
IdName
1Squad
2Wuschel
35 |
36 |
37 | 38 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Config/karma.entry.js: -------------------------------------------------------------------------------- 1 | require('core-js/es6'); 2 | require('core-js/es7/reflect'); 3 | require('zone.js/dist/zone'); 4 | require('zone.js/dist/long-stack-trace-zone'); 5 | require('zone.js/dist/proxy'); 6 | require('zone.js/dist/sync-test'); 7 | require('zone.js/dist/jasmine-patch'); 8 | require('zone.js/dist/async-test'); 9 | require('zone.js/dist/fake-async-test'); 10 | require('rxjs/Rx'); 11 | 12 | Error.stackTraceLimit = Infinity; 13 | jasmine.DEFAULT_TIMEOUT_INTERVAL = 2000; 14 | 15 | var testing = require('@angular/core/testing'); 16 | var browser = require('@angular/platform-browser-dynamic/testing'); 17 | testing.TestBed.resetTestEnvironment(); 18 | testing.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting()); 19 | 20 | var appContext = require.context('../App/', true, /\.spec\.ts/); 21 | appContext.keys().forEach(appContext); 22 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Config/karma.conf.js: -------------------------------------------------------------------------------- 1 | var webpackConfig = require('./webpack.test.js'); 2 | 3 | module.exports = function (config) { 4 | config.set({ 5 | basePath: '', 6 | frameworks: ['jasmine'], 7 | 8 | files: [ 'karma.entry.js' ], 9 | 10 | preprocessors: { 11 | 'karma.entry.js': ['webpack', 'sourcemap'] 12 | }, 13 | phantomJsLauncher: { 14 | exitOnResourceError: false 15 | }, 16 | webpack: webpackConfig, 17 | 18 | webpackMiddleware: { 19 | stats: 'errors-only' 20 | }, 21 | 22 | webpackServer: { 23 | noInfo: true 24 | }, 25 | 26 | reporters: ['progress'], 27 | port: 9876, 28 | colors: true, 29 | logLevel: config.LOG_INFO, 30 | autoWatch: true, 31 | browsers: ['PhantomJS'], 32 | singleRun: true 33 | }); 34 | }; -------------------------------------------------------------------------------- /DemoPageProxyGenerator/DomainModels/GenericsTestklasse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DomainModels 4 | { 5 | //Durch einen Bug im TypeLite aktuell auskommentiert! 6 | 7 | // [TsClass] 8 | public class Oberklasse where T : class 9 | { 10 | public List DatenklassenListe { get; set; } 11 | public ICollection Test { get; set; } 12 | public IDictionary Dict {get; set; } 13 | public string Abc { get; set; } 14 | public Infoklasse Info { get; set; } 15 | } 16 | 17 | // [TsClass] 18 | public class Datenklasse 19 | { 20 | public int Id { get; set; } 21 | public string Textdaten { get; set; } 22 | public Infoklasse Info { get; set; } 23 | } 24 | 25 | // [TsClass] 26 | public class Infoklasse 27 | { 28 | public int InfoNr { get; set; } 29 | public string Bemerkungen { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Scripts/TypeLite.Net4.tt: -------------------------------------------------------------------------------- 1 | <#@ template debug="false" hostspecific="True" language="C#" #> 2 | <#@ assembly name="$(TargetDir)TypeLite.dll" #> 3 | <#@ assembly name="$(TargetDir)TypeLite.Net4.dll" #> 4 | <#@ assembly name="$(TargetDir)$(TargetFileName)" #> 5 | 6 | <#@ import namespace="TypeLite" #> 7 | <#@ import namespace="TypeLite.Net4" #> 8 | <#@output extension=".d.ts"#> 9 | 10 | <#@include file="Manager.ttinclude"#> 11 | <# var manager = Manager.Create(Host, GenerationEnvironment); #> 12 | 13 | <# var ts = TypeScript.Definitions() 14 | .WithReference("Enums.ts") 15 | .WithFormatter((type, f) => "I" + ((TypeLite.TsModels.TsClass)type).Name) 16 | .ForLoadedAssemblies(); 17 | #> 18 | 19 | <#= ts.Generate(TsGeneratorOutput.Properties) #> 20 | 21 | <# manager.StartNewFile("Enums.ts"); #> 22 | <#= ts.Generate(TsGeneratorOutput.Enums) #> 23 | <# manager.EndBlock(); #> 24 | <# manager.Process(true); #> -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Models/GenericsTestklasse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ProxyGeneratorNgDemoPage.Models 4 | { 5 | //Durch einen Bug im TypeLite aktuell auskommentiert! 6 | 7 | // [TsClass] 8 | public class Oberklasse where T : class 9 | { 10 | public List DatenklassenListe { get; set; } 11 | public ICollection Test { get; set; } 12 | public IDictionary Dict {get; set; } 13 | public string Abc { get; set; } 14 | public Infoklasse Info { get; set; } 15 | } 16 | 17 | // [TsClass] 18 | public class Datenklasse 19 | { 20 | public int Id { get; set; } 21 | public string Textdaten { get; set; } 22 | public Infoklasse Info { get; set; } 23 | } 24 | 25 | // [TsClass] 26 | public class Infoklasse 27 | { 28 | public int InfoNr { get; set; } 29 | public string Bemerkungen { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Views/mainApp.js: -------------------------------------------------------------------------------- 1 | var App; 2 | (function (App) { 3 | var MainApp = (function () { 4 | function MainApp() { 5 | } 6 | MainApp.createApp = function (angular) { 7 | //Alle Module definieren die wir verwenden. 8 | angular.module("app.main", [ 9 | //Eigene Module einbinden 10 | "homeAngularJsSrv", 11 | "proxyAngularJsSrv", 12 | "fileUpload", 13 | //Module die mit TypeScript geschrieben wurden einbinden 14 | App.Views.Proxy.ProxyCtrl.module.name, 15 | App.Services.HomePService.module.name, 16 | App.Services.ProxyPService.module.name, 17 | ]); 18 | }; 19 | return MainApp; 20 | }()); 21 | App.MainApp = MainApp; 22 | })(App || (App = {})); 23 | //Unsere Anwendung intial aufrufen/starten 24 | App.MainApp.createApp(angular); 25 | //# sourceMappingURL=mainApp.js.map -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Helper/GenericsTestklasse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using TypeLite; 6 | 7 | namespace ProxyGeneratorDemoPage.Helper 8 | { 9 | //Durch einen Bug im TypeLite aktuell auskommentiert! 10 | 11 | // [TsClass] 12 | public class Oberklasse where T : class 13 | { 14 | public List DatenklassenListe { get; set; } 15 | public ICollection Test { get; set; } 16 | public IDictionary Dict {get; set; } 17 | public string Abc { get; set; } 18 | public Infoklasse Info { get; set; } 19 | } 20 | 21 | // [TsClass] 22 | public class Datenklasse 23 | { 24 | public int Id { get; set; } 25 | public string Textdaten { get; set; } 26 | public Infoklasse Info { get; set; } 27 | } 28 | 29 | // [TsClass] 30 | public class Infoklasse 31 | { 32 | public int InfoNr { get; set; } 33 | public string Bemerkungen { get; set; } 34 | } 35 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Directives/fileUpload.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"fileUpload.js","sourceRoot":"","sources":["fileUpload.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,CAAC;KAU3B,SAAS,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,UAAU,MAAM;QACjD,MAAM,CAAC;YACH,QAAQ,EAAE,GAAG;YACb,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE;gBACH,WAAW,EAAE,GAAG;aACnB;YACD,IAAI,EAAE,UAAU,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;gBACnC,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACrC,IAAI,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC;gBAC/B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;oBAChB,KAAK,CAAC,MAAM,CAAC;wBACT,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;wBACrC,6BAA6B;wBAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;wBACrC,IAAI,CAAC,OAAO,EAAE,CAAC;oBACnB,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;gBAEH,uDAAuD;gBACvD,IAAI,SAAS,GAAG,UAAU,IAAI;oBAC1B,MAAM,CAAC,IAAI,CAAC;gBAChB,CAAC,CAAA;gBAED,oDAAoD;gBACpD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,yBAAyB;gBAC3D,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,yBAAyB;YAClE,CAAC;SACJ,CAAC;IACN,CAAC,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Services/homeAngularJsSrv.js: -------------------------------------------------------------------------------- 1 | //Warning this file was dynamicly created. 2 | //Please don't change any code it will be overwritten next time the template is executed. 3 | //Created on 24.10.2017 time 09:04 from jrenatus. 4 | 5 | 6 | 7 | function homeAngularJsSrv($http) { this.http = $http; } 8 | 9 | 10 | homeAngularJsSrv.prototype.addOrUpdatePerson = function (person) { 11 | return this.http.post('Home/AddOrUpdatePerson',person).then(function (result) { 12 | return result.data; 13 | }); 14 | } 15 | 16 | homeAngularJsSrv.prototype.getAllPersons = function () { 17 | return this.http.get('Home/GetAllPersons').then(function (result) { 18 | return result.data; 19 | }); 20 | } 21 | 22 | homeAngularJsSrv.prototype.searchPerson = function (name) { 23 | return this.http.get('Home/SearchPerson'+ '?name='+encodeURIComponent(name)).then(function (result) { 24 | return result.data; 25 | }); 26 | } 27 | 28 | 29 | angular.module('homeAngularJsSrv', []) .service('homeAngularJsSrv', ['$http', homeAngularJsSrv]); 30 | 31 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/TestHelper/TestClasses/GenericsTestClasses.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace UnitTests.TestHelper.TestClasses 7 | { 8 | public class Oberklasse where T : class 9 | { 10 | public List DatenklassenListe { get; set; } 11 | public string Abc { get; set; } 12 | public Infoklasse Info { get; set; } 13 | } 14 | 15 | public class Oberklasse2 where T : class 16 | { 17 | public List DatenklassenListe { get; set; } 18 | public List InfoKlasse { get; set; } 19 | public string Abc { get; set; } 20 | public Infoklasse Info { get; set; } 21 | } 22 | 23 | public class Datenklasse 24 | { 25 | public int Id { get; set; } 26 | public string Textdaten { get; set; } 27 | public Infoklasse Info { get; set; } 28 | } 29 | 30 | public class Infoklasse 31 | { 32 | public int InfoNr { get; set; } 33 | public string Bemerkungen { get; set; } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Interfaces/IControllerManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | using ProxyGenerator.Container; 5 | 6 | namespace ProxyGenerator.Interfaces 7 | { 8 | public interface IControllerManager 9 | { 10 | /// 11 | /// Alle Controller ermitteln die für das Projekt befunden werden können. 12 | /// 13 | List GetAllProjectProxyController(ProxySettings proxySettings); 14 | 15 | /// 16 | /// Die Liste an Controllern ermitteln in denen das übergebene ProxyTypeAttribute gesetzt wurde. 17 | /// 18 | List GetProxyControllerByProxyTypeAttribute(Type proxyTypeAttribute, List allController); 19 | 20 | /// 21 | /// Laden aller Methoden und Parameterinformationen in allen Controllerm in denen das übergebene ProxyType Attribut verwendet wird. 22 | /// 23 | List LoadProxyControllerInfos(Type proxyTypeAttribute, List allController); 24 | } 25 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/README.md: -------------------------------------------------------------------------------- 1 | # Web 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.1.0. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Interfaces/IProxyGeneratorFactoryManager.cs: -------------------------------------------------------------------------------- 1 | using ProxyGenerator.Builder; 2 | using ProxyGenerator.Container; 3 | using ProxyGenerator.Manager; 4 | 5 | namespace ProxyGenerator.Interfaces 6 | { 7 | public interface IProxyGeneratorFactoryManager 8 | { 9 | IAssemblyManager CreateAssemblyManager(); 10 | IFileHelper FileHelper(); 11 | IControllerManager CreateControllerManager(); 12 | IMethodManager CreateMethodManager(); 13 | IMethodParameterManager CreateMethodParameterManager(); 14 | IProxyBuilderHelper CreateProxyBuilderHelper(); 15 | IProxyBuilderHttpCall CreateProxyBuilderHttpCall(); 16 | IProxyBuilderDataTypeHelper CreateBuilderTypeHelper(); 17 | ProxySettings GetProxySettings(); 18 | IProxyBuilder CreateAngularJsProxyBuilder(); 19 | IProxyBuilder CreateAngularTsProxyBuilder(); 20 | IProxyBuilder CreateJQueryTsProxyBuilder(); 21 | IProxyBuilder CreateJQueryJsProxyBuilder(); 22 | ISettingsManager CreateSettingsManager(); 23 | IProxyBuilder CreateAngular2TsProxyBuilder(); 24 | ILogManager GetLogManager(); 25 | } 26 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/ProxyTypeAttributes/CreateProxyBaseAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ProxyGenerator.ProxyTypeAttributes 4 | { 5 | /// 6 | /// Dieses Attribut dient aktuell nur dem Markieren von Funktionen die in 7 | /// eine JavaScript Proxy Funktion umgewandelt werden sollen. 8 | /// 9 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] 10 | public abstract class CreateProxyBaseAttribute : Attribute 11 | { 12 | public Type ReturnType { get; set; } 13 | 14 | /// 15 | /// Tells the Proxy Generator to jsut create a window.location.href Link for this Proxy Function. 16 | /// 17 | public bool CreateWindowLocationHrefLink { get; set; } 18 | 19 | public CreateProxyBaseAttribute() 20 | { 21 | ReturnType = null; 22 | CreateWindowLocationHrefLink = false; 23 | } 24 | 25 | public CreateProxyBaseAttribute(Type returnType) 26 | { 27 | this.ReturnType = returnType; 28 | CreateWindowLocationHrefLink = false; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Helper/CustomErrorHandlerAttribute.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace ProxyGeneratorDemoPage.Helper 4 | { 5 | /// 6 | /// Custom Error Handler der über der passenden Controller Funktion verwendet wird um unbehandelte Ausnahmen abzufangen. 7 | /// 8 | public class CustomErrorHandlerAttribute : HandleErrorAttribute 9 | { 10 | public bool IsAjaxCall { get; set; } 11 | 12 | public override void OnException(ExceptionContext context) 13 | { 14 | if (IsAjaxCall) 15 | { 16 | context.ExceptionHandled = true; 17 | var jsonResult = new JsonResult(); 18 | jsonResult.Data = new {Message = context.Exception.Message , MessageType = "Error"}; 19 | jsonResult.JsonRequestBehavior = JsonRequestBehavior.AllowGet; 20 | jsonResult.ExecuteResult(context); 21 | } 22 | else 23 | { 24 | // if not an ajax request, continue with logic implemented by MVC -> html error page 25 | base.OnException(context); 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Web 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |
16 |
17 |
18 |

App is Loading .... please wait ....

19 |
20 |
21 |

22 | 23 |

24 |
25 |
26 |
27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Services/homePService.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"homePService.js","sourceRoot":"","sources":["homePService.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,yFAAyF;AACzF,iDAAiD;AAI/C,IAAO,GAAG,CAmCV;AAnCA,WAAO,GAAG;IAAC,IAAA,QAAQ,CAmCnB;IAnCW,WAAA,QAAQ,EAAC,CAAC;QAQvB;YAEG,sBAAoB,KAAsB;gBAAtB,UAAK,GAAL,KAAK,CAAiB;YAAI,CAAC;YAEvC,kCAAW,GAAlB,UAAmB,QAAgB,EAAC,MAA2D;gBAC/F,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,kBAAkB,GAAE,YAAY,GAAC,QAAQ,GAAC,GAAG,GAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC7F,CAAC;YAES,gCAAS,GAAhB,UAAiB,EAAU;gBAC3B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,gBAAgB,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC;YAC/C,CAAC;YAEK,kCAAW,GAAlB;gBACK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,UAAC,QAA2F,IAA+D,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YACxO,CAAC;YAIC,sBAAkB,sBAAM;qBAAxB;oBACI,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;wBAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;oBAAC,CAAC;oBAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;oBAClD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;oBACnD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;gBACvB,CAAC;;;eAAA;YAtBO,oBAAO,GAAG,CAAC,OAAO,CAAC,CAAC;YAyB5B,mBAAC;QAAD,CAAC,AA1BJ,IA0BI;QA1BS,qBAAY,eA0BrB,CAAA;IACH,CAAC,EAnCW,QAAQ,GAAR,YAAQ,KAAR,YAAQ,QAmCnB;AAAD,CAAC,EAnCO,GAAG,KAAH,GAAG,QAmCV"} -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Container/TemplateEntry.cs: -------------------------------------------------------------------------------- 1 | using ProxyGenerator.Enums; 2 | 3 | namespace ProxyGenerator.Container 4 | { 5 | public class TemplateEntry 6 | { 7 | #region Member 8 | /// 9 | /// Das Template für die Ausgabe 10 | /// 11 | public string Template { get; set; } 12 | 13 | /// 14 | /// Der Template typ wie jQueryJs oder AngularJs oder AngularTs 15 | /// 16 | public TemplateTypes TemplateType { get; set; } 17 | 18 | /// 19 | /// Der Suffix der an den Namen des Controllers für den Service gehängt wird z.b. HomeSrv oder HomeService 20 | /// 21 | public string TemplateSuffix { get; set; } 22 | 23 | /// 24 | /// Es kann ein Globaler Ausgabepfad verwendet werden, oder der Pfad kann für jeden Templatetypen einzeln festgelegt werden. 25 | /// 26 | public string OutputPath { get; set; } 27 | #endregion 28 | 29 | #region Konstruktor 30 | public TemplateEntry() 31 | { 32 | Template = string.Empty; 33 | TemplateType = TemplateTypes.AngularJsModule; 34 | TemplateSuffix = string.Empty; 35 | OutputPath = string.Empty; 36 | } 37 | #endregion 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Directives/fileUpload.js: -------------------------------------------------------------------------------- 1 | angular.module("fileUpload", []) 2 | .directive('sqFileModel', ['$parse', function ($parse) { 3 | return { 4 | restrict: 'A', 5 | require: 'ngModel', 6 | scope: { 7 | sqFileModel: "=" 8 | }, 9 | link: function (scope, elem, attr, ctrl) { 10 | var model = $parse(attr.sqFileModel); 11 | var modelSetter = model.assign; 12 | elem.bind('change', function () { 13 | scope.$apply(function () { 14 | modelSetter(scope, elem[0].files[0]); 15 | //Auslösen unseres Validators 16 | ctrl.$setViewValue(elem[0].files[0]); 17 | ctrl.$render(); 18 | }); 19 | }); 20 | //Custom Validation einbinden für Required und FileType 21 | var validator = function (file) { 22 | return file; 23 | }; 24 | //Unseren Validator den passenden Listen hinzufügen. 25 | ctrl.$parsers.unshift(validator); //view-to-model direction 26 | ctrl.$formatters.unshift(validator); //model-to-view direction 27 | } 28 | }; 29 | }]); 30 | //# sourceMappingURL=fileUpload.js.map -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/ConstValuesTemplates.cs: -------------------------------------------------------------------------------- 1 | namespace ProxyGenerator 2 | { 3 | /// 4 | /// Die verwendeten Const Values in den Templates 5 | /// 6 | static class ConstValuesTemplates 7 | { 8 | public const string ServiceName = "#ServiceName#"; 9 | 10 | public const string PrototypeServiceCalls = "#PrototypeServiceCalls#"; 11 | 12 | public const string ServiceParamters = "#ServiceParamters#"; 13 | 14 | public const string ControllerFunctionName = "#ControllerFunctionName#"; 15 | 16 | public const string ServiceCallAndParameters = "#ServiceCallAndParameters#"; 17 | 18 | public const string InterfaceDefinitions = "#InterfaceDefinitions#"; 19 | 20 | public const string ServiceFunctions = "#ServiceFunctions#"; 21 | 22 | /// 23 | /// Hier können Zusatzinformationen untergebracht werden die für den FileUplaod wichtig sind. 24 | /// 25 | public const string FunctionContent = "#FunctionContent#"; 26 | 27 | /// 28 | /// Achtung hier muss wird "{#" bzw. "#}" zum Maskieren verwendet, da wir im Template ein größer bzw. kleinerzeichen davor haben und es hier sonst Probleme mit dem T4 Template gibt. 29 | /// 30 | public const string ControllerFunctionReturnType = "{#ControllerFunctionReturnType#}"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Config/webpack.test.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | var helpers = require('./helpers'); 3 | 4 | module.exports = { 5 | devtool: 'inline-source-map', 6 | 7 | resolve: { 8 | extensions: ['.ts', '.js'] 9 | }, 10 | 11 | module: { 12 | rules: [ 13 | { 14 | test: /\.ts$/, 15 | loaders: ['awesome-typescript-loader', 'angular2-template-loader'] 16 | }, 17 | { 18 | test: /\.html$/, 19 | loader: 'html-loader' 20 | 21 | }, 22 | { 23 | test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/, 24 | loader: 'null-loader' 25 | }, 26 | { 27 | test: /\.scss$/, 28 | exclude: helpers.root('App'), 29 | loader: 'null-loader' 30 | }, 31 | { 32 | test: /\.scss$/, 33 | include: helpers.root('App'), 34 | loader: 'raw-loader' 35 | } 36 | ] 37 | }, 38 | 39 | plugins: [ 40 | new webpack.ContextReplacementPlugin( 41 | // The (\\|\/) piece accounts for path separators in *nix and Windows 42 | /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, 43 | helpers.root('./App'), // location of your src 44 | {} // a map of your routes 45 | ) 46 | ] 47 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/FileHelperTests/GetParentDirectory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | using ProxyGenerator; 4 | using ProxyGenerator.Container; 5 | using ProxyGenerator.Manager; 6 | 7 | namespace UnitTests.FileHelperTests 8 | { 9 | [TestFixture] 10 | public class GetParentDirectory 11 | { 12 | [Test] 13 | public void Path_Found() 14 | { 15 | //Arrange 16 | var fileHelper = new FileHelper(new ProxyGeneratorFactoryManager(new ProxySettings())); 17 | var basePath = @"C:\Temp\Files\MyProjectDirectory\OtherDirectory\Bin\Debug\Test"; 18 | 19 | //Act 20 | var path = fileHelper.GetParentDirectory(basePath, "MyProjectDirectory"); 21 | 22 | //Assert 23 | Assert.AreEqual(path, @"C:\Temp\Files\MyProjectDirectory"); 24 | } 25 | 26 | [Test] 27 | [ExpectedException(typeof(Exception), ExpectedMessage = "The 'WebProjectPath' was not found, because the 'WebProjectName' was wrong.")] 28 | public void Path_Not_Found() 29 | { 30 | //Arrange 31 | var fileHelper = new FileHelper(new ProxyGeneratorFactoryManager(new ProxySettings())); 32 | var basePath = @"C:\Temp\Files\MyProjectDirectory\OtherDirectory\Bin\Debug\Test"; 33 | 34 | //Act 35 | var path = fileHelper.GetParentDirectory(basePath, "MyProjectDir"); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~7.1.0", 15 | "@angular/common": "~7.1.0", 16 | "@angular/compiler": "~7.1.0", 17 | "@angular/core": "~7.1.0", 18 | "@angular/forms": "~7.1.0", 19 | "@angular/platform-browser": "~7.1.0", 20 | "@angular/platform-browser-dynamic": "~7.1.0", 21 | "@angular/router": "~7.1.0", 22 | "core-js": "^2.5.4", 23 | "rxjs": "~6.3.3", 24 | "tslib": "^1.9.0", 25 | "zone.js": "~0.8.26" 26 | }, 27 | "devDependencies": { 28 | "@angular-devkit/build-angular": "~0.11.0", 29 | "@angular/cli": "~7.1.0", 30 | "@angular/compiler-cli": "~7.1.0", 31 | "@angular/language-service": "~7.1.0", 32 | "@types/node": "~8.9.4", 33 | "@types/jasmine": "~2.8.8", 34 | "@types/jasminewd2": "~2.0.3", 35 | "codelyzer": "~4.5.0", 36 | "jasmine-core": "~2.99.1", 37 | "jasmine-spec-reporter": "~4.2.1", 38 | "karma": "~3.1.1", 39 | "karma-chrome-launcher": "~2.2.0", 40 | "karma-coverage-istanbul-reporter": "~2.0.1", 41 | "karma-jasmine": "~1.1.2", 42 | "karma-jasmine-html-reporter": "^0.2.2", 43 | "protractor": "~5.4.0", 44 | "ts-node": "~7.0.0", 45 | "tslint": "~5.11.0", 46 | "typescript": "~3.1.6" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ProxyGeneratorDemoPage")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ProxyGeneratorDemoPage")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("32361224-2c71-42b4-a285-022e129da37f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("UnitTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("UnitTests")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e25b9094-40dc-4828-818e-c6ea45739dfe")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Manager/LogManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using ProxyGenerator.Container; 6 | using ProxyGenerator.Interfaces; 7 | 8 | namespace ProxyGenerator.Manager 9 | { 10 | public class LogManager : ILogManager 11 | { 12 | #region Member 13 | private List LogEntries { get; set; } = new List(); 14 | 15 | public static string LogfilePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "proxyGeneratorLog.txt"); 16 | 17 | public bool WriteLog { get; set; } = false; 18 | #endregion 19 | 20 | #region Public functions 21 | public void AddMessage(string name, string message) 22 | { 23 | LogEntries.Add(new LogEntry() { Name = name, Message = message}); 24 | } 25 | 26 | public string GetCompleteLogAsString(bool writelog) 27 | { 28 | WriteLog = writelog; 29 | 30 | if (WriteLog) 31 | { 32 | var log = string.Join("\n\n", LogEntries.Select(p => $"{p.Name}: \n {p.Message}")); 33 | return $"/** {log} **/"; 34 | } 35 | 36 | return String.Empty; 37 | } 38 | 39 | public static void Log(bool writeLog, params string[] txt) 40 | { 41 | if (writeLog) 42 | { 43 | System.IO.File.AppendAllText(LogfilePath, string.Join(": ", txt) + Environment.NewLine); 44 | } 45 | } 46 | #endregion 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ProxyGenerator")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ProxyGenerator")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b88cfe60-d1f3-43ff-a1fb-b84b4714e0af")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Optimization; 2 | 3 | namespace ProxyGeneratorDemoPage 4 | { 5 | public class BundleConfig 6 | { 7 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 8 | public static void RegisterBundles(BundleCollection bundles) 9 | { 10 | bundles.Add(new ScriptBundle("~/bundles/myScripts").Include( 11 | "~/Scripts/jquery-{version}.js", 12 | "~/Scripts/bootstrap.js", 13 | "~/Scripts/angular.js" 14 | )); 15 | 16 | bundles.Add(new ScriptBundle("~/bundles/angularApp") 17 | .IncludeDirectory("~/ScriptsApp/Services/", "*.js", false) 18 | .IncludeDirectory("~/ScriptsApp/ServicesJQuery/", "*.js", false) 19 | .IncludeDirectory("~/ScriptsApp/Classes/", "*.js", false) 20 | .Include( 21 | "~/ScriptsApp/jQueryJsCalls.js", 22 | "~/ScriptsApp/jQueryCalls.js", 23 | "~/ScriptsApp/Directives/fileUpload.js", 24 | "~/ScriptsApp/Views/Proxy/proxyCtrl.js", 25 | "~/ScriptsApp/Views/mainApp.js", 26 | "~/Scripts/Enums.js" //Generated Enums from TypeLite 27 | )); 28 | 29 | bundles.Add(new StyleBundle("~/Content/css").Include( 30 | "~/Content/bootstrap.css", 31 | "~/Content/site.css")); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/Builder/Helper/ProxyBuilderHelperTests/GetClearControllerName.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Reflection; 3 | using NUnit.Framework; 4 | using ProxyGenerator.Builder.Helper; 5 | using ProxyGenerator.Container; 6 | 7 | namespace UnitTests.Builder.Helper.ProxyBuilderHelperTests 8 | { 9 | [TestFixture] 10 | public class GetClearControllerName 11 | { 12 | [Test] 13 | public void With_Controller_Suffix() 14 | { 15 | //Arrange 16 | var testClassType = Assembly.GetExecutingAssembly().GetTypes().First(type => type.Name.Contains("MeinTestController")); 17 | var proxyBuildHelper = new ProxyBuilderHelper(new ProxySettings()); 18 | 19 | //Act 20 | var clearName = proxyBuildHelper.GetClearControllerName(testClassType); 21 | 22 | //Assert 23 | Assert.AreEqual(clearName, "MeinTest"); 24 | } 25 | 26 | [Test] 27 | public void No_Controller_Suffix() 28 | { 29 | //Arrange 30 | var testClassType = Assembly.GetExecutingAssembly().GetTypes().First(type => type.Name.Contains("MeinTestOhneCtrl")); 31 | var proxyBuildHelper = new ProxyBuilderHelper(new ProxySettings()); 32 | 33 | //Act 34 | var clearName = proxyBuildHelper.GetClearControllerName(testClassType); 35 | 36 | //Assert 37 | Assert.AreEqual(clearName, "MeinTestOhneCtrl"); 38 | } 39 | 40 | private class MeinTestController { } 41 | private class MeinTestOhneCtrl { } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @ViewBag.Title - My ASP.NET Application 7 | 8 | @Styles.Render("~/Content/css") 9 | 10 | 11 | 12 | 30 |
31 | @RenderBody() 32 |
33 | 34 | @Scripts.Render("~/bundles/myScripts") 35 | @Scripts.Render("~/bundles/angularApp") 36 | 37 | 38 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NuGet.Packager")] 9 | [assembly: AssemblyDescription("Project template made by EyeCatch (http://www.eyecatch.no/)")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("NuGet.Packager")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5b586874-8d3e-4137-9ba8-e982413416d5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Allgemeine Informationen zu einer Assembly werden über die folgenden 6 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, 7 | // die mit einer Assembly verknüpft sind. 8 | [assembly: AssemblyTitle("ProxyGeneratorNgDemoPage")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ProxyGeneratorNgDemoPage")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Durch Festlegen von "ComVisible" auf "false" werden die Typen in dieser Assembly unsichtbar 18 | // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly aus 19 | // COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. 20 | [assembly: ComVisible(false)] 21 | 22 | // Die folgende GUID bestimmt die ID der "typelib", wenn dieses Projekt für COM verfügbar gemacht wird. 23 | [assembly: Guid("5aa0a875-cf9e-4a3e-9913-da6752bc3679")] 24 | 25 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: 26 | // 27 | // Hauptversion 28 | //Nebenversion 29 | // Buildnummer 30 | // Revision 31 | // 32 | // Sie können alle Werte angeben oder die standardmäßigen Revisions- und Buildnummern 33 | // übernehmen, indem Sie "*" eingeben: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/DomainModels/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Allgemeine Informationen über eine Assembly werden über die folgenden 6 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, 7 | // die einer Assembly zugeordnet sind. 8 | [assembly: AssemblyTitle("DomainModels")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DomainModels")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly 18 | // für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von 19 | // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. 20 | [assembly: ComVisible(false)] 21 | 22 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird 23 | [assembly: Guid("ea1a5802-9139-4bf3-b623-684c278c8088")] 24 | 25 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: 26 | // 27 | // Hauptversion 28 | // Nebenversion 29 | // Buildnummer 30 | // Revision 31 | // 32 | // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, 33 | // indem Sie "*" wie unten gezeigt eingeben: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/Builder/Helper/ProxyBuilderDataTypeHelperTests/HasReturnType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using NUnit.Framework; 6 | using ProxyGenerator.Builder.Helper; 7 | using ProxyGenerator.Container; 8 | 9 | namespace UnitTests.Builder.Helper.ProxyBuilderDataTypeHelperTests 10 | { 11 | [TestFixture] 12 | public class HasReturnType 13 | { 14 | [Test] 15 | public void HasReturnType_True() 16 | { 17 | //Arrange 18 | var proxyBuilderDataTypeHelper = new ProxyBuilderDataTypeHelper(new ProxySettings()); 19 | 20 | //Act 21 | var result = proxyBuilderDataTypeHelper.HasReturnType(typeof (string)); 22 | 23 | //Assert 24 | Assert.IsTrue(result); 25 | } 26 | 27 | [Test] 28 | public void HasReturnType_False_Null() 29 | { 30 | //Arrange 31 | var proxyBuilderDataTypeHelper = new ProxyBuilderDataTypeHelper(new ProxySettings()); 32 | 33 | //Act 34 | var result = proxyBuilderDataTypeHelper.HasReturnType(null); 35 | 36 | //Assert 37 | Assert.IsFalse(result); 38 | } 39 | 40 | [Test] 41 | public void HasReturnType_False_Void() 42 | { 43 | //Arrange 44 | var proxyBuilderDataTypeHelper = new ProxyBuilderDataTypeHelper(new ProxySettings()); 45 | 46 | //Act 47 | var result = proxyBuilderDataTypeHelper.HasReturnType(typeof(void)); 48 | 49 | //Assert 50 | Assert.IsFalse(result); 51 | } 52 | 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/Builder/Helper/ProxyBuilderHelperTests/BuildUrlParameterId.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using NUnit.Framework; 3 | using ProxyGenerator.Builder.Helper; 4 | using ProxyGenerator.Container; 5 | 6 | namespace UnitTests.Builder.Helper.ProxyBuilderHelperTests 7 | { 8 | [TestFixture] 9 | public class BuildUrlParameterId 10 | { 11 | private ProxyBuilderHelper ProxyBuildHelper { get; set; } 12 | 13 | [SetUp] 14 | public void Setup() 15 | { 16 | ProxyBuildHelper = new ProxyBuilderHelper(new ProxySettings()); 17 | } 18 | 19 | [Test] 20 | public void UrlParam_Id() 21 | { 22 | //Arrange 23 | var methodParameterInfos = new List(); 24 | methodParameterInfos.Add(new ProxyMethodParameterInfo() { IsComplexeType = false, IsString = false, ParameterName = "laenge" }); 25 | methodParameterInfos.Add(new ProxyMethodParameterInfo() { IsComplexeType = false, IsString = false, ParameterName = "id" }); 26 | 27 | //Act 28 | var paramInfos = ProxyBuildHelper.BuildUrlParameterId(methodParameterInfos); 29 | 30 | //Assert 31 | Assert.AreEqual(paramInfos, " + '/' + id"); 32 | } 33 | 34 | [Test] 35 | public void NoParams() 36 | { 37 | //Arrange 38 | var methodParameterInfos = new List(); 39 | 40 | //Act 41 | var paramInfos = ProxyBuildHelper.BuildUrlParameterId(methodParameterInfos); 42 | 43 | //Assert 44 | Assert.AreEqual(paramInfos, string.Empty); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Scripts/systemjs.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * System configuration for Angular 2 samples 3 | * Adjust as necessary for your application needs. 4 | */ 5 | (function (global) { 6 | // map tells the System loader where to look for things 7 | var map = { 8 | 'MyApp': 'ScriptsAppNg2', // 'dist', 9 | '@angular': 'node_modules/@angular', 10 | 'rxjs': 'node_modules/rxjs' 11 | }; 12 | // packages tells the System loader how to load when no filename and/or no extension 13 | var packages = { 14 | //Loading our App 15 | 'MyApp': { main: 'main.js', defaultExtension: 'js' }, 16 | 'rxjs': { defaultExtension: 'js' }, 17 | }; 18 | 19 | var ngPackageNames = [ 20 | 'common', 21 | 'compiler', 22 | 'core', 23 | 'forms', 24 | 'http', 25 | 'platform-browser', 26 | 'platform-browser-dynamic', 27 | 'router', 28 | 'upgrade', 29 | ]; 30 | 31 | // Individual files (~300 requests): 32 | function packIndex(pkgName) { 33 | packages['@angular/' + pkgName] = { main: 'index.js', defaultExtension: 'js' }; 34 | } 35 | // Bundled (~40 requests): 36 | function packUmd(pkgName) { 37 | packages['@angular/' + pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' }; 38 | } 39 | 40 | // Most environments should use UMD; some (Karma) need the individual index files 41 | var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; 42 | // Add package entries for angular packages 43 | ngPackageNames.forEach(setPackageConfig); 44 | 45 | System.config({ 46 | map: map, 47 | packages: packages 48 | }); 49 | })(this); 50 | 51 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Scripts/typings/angularjs/angular-sanitize.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for Angular JS 1.3 (ngSanitize module) 2 | // Project: http://angularjs.org 3 | // Definitions by: Diego Vilar 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | 7 | /// 8 | 9 | declare module "angular-sanitize" { 10 | var _: string; 11 | export = _; 12 | } 13 | 14 | /////////////////////////////////////////////////////////////////////////////// 15 | // ngSanitize module (angular-sanitize.js) 16 | /////////////////////////////////////////////////////////////////////////////// 17 | declare module angular.sanitize { 18 | 19 | /////////////////////////////////////////////////////////////////////////// 20 | // SanitizeService 21 | // see http://docs.angularjs.org/api/ngSanitize.$sanitize 22 | /////////////////////////////////////////////////////////////////////////// 23 | interface ISanitizeService { 24 | (html: string): string; 25 | } 26 | 27 | /////////////////////////////////////////////////////////////////////////// 28 | // Filters included with the ngSanitize 29 | // see https://github.com/angular/angular.js/tree/v1.2.0/src/ngSanitize/filter 30 | /////////////////////////////////////////////////////////////////////////// 31 | export module filter { 32 | 33 | // Finds links in text input and turns them into html links. 34 | // Supports http/https/ftp/mailto and plain email address links. 35 | // see http://code.angularjs.org/1.2.0/docs/api/ngSanitize.filter:linky 36 | interface ILinky { 37 | (text: string, target?: string): string; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Container/ProxyMethodParameterInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | 7 | namespace ProxyGenerator.Container 8 | { 9 | public class ProxyMethodParameterInfo 10 | { 11 | #region Member 12 | /// 13 | /// Reflexion Objekt für die Parameter Informationen 14 | /// 15 | public ParameterInfo ParameterInfo { get; set; } 16 | 17 | /// 18 | /// Der Name des Parameters 19 | /// 20 | public string ParameterName { get; set; } 21 | 22 | /// 23 | /// Gibt an ob es sich um einen komplexen Typen handelt. Es handelt sich dann nicht 24 | /// mehr um einen "einfachen" Typen wie z.B.: String, Int, Bool. Sondern um eine 25 | /// eigene Klasse wie Auto, Person, ... Diese Daten müssen dann per POST übergeben werden. 26 | /// 27 | public bool IsComplexeType { get; set; } 28 | 29 | /// 30 | /// Es handelt sich um FileUpload Element vom Typ "HttpPostedFileBase" 31 | /// 32 | public bool IsFileUpload { get; set; } 33 | 34 | /// 35 | /// Gibt an ob es sich um einen String handelt, denn dieser muss 36 | /// auf JavaScript Seite UrlEncoded werden. 37 | /// 38 | public bool IsString { get; set; } 39 | #endregion 40 | 41 | #region Konstruktor 42 | public ProxyMethodParameterInfo() 43 | { 44 | ParameterName = String.Empty; 45 | IsComplexeType = false; 46 | IsString = false; 47 | IsFileUpload = false; 48 | } 49 | #endregion 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Services/homePService.ts: -------------------------------------------------------------------------------- 1 | //Warning this file was dynamicly created. 2 | //Please don't change any code it will be overwritten next time the template is executed. 3 | //Created on 24.10.2017 time 09:04 from jrenatus. 4 | 5 | 6 | 7 | module App.Services { 8 | 9 | export interface IHomePService { 10 | getDownload(personId: number,person: ProxyGeneratorDemoPage.Models.Person.Models.IPerson): void; 11 | getPerson(id: number): void; 12 | getAllAutos() : ng.IPromise; 13 | } 14 | 15 | export class HomePService implements IHomePService { 16 | static $inject = ['$http']; 17 | constructor(private $http: ng.IHttpService) { } 18 | 19 | public getDownload(personId: number,person: ProxyGeneratorDemoPage.Models.Person.Models.IPerson) : void { 20 | window.location.href = 'Home/GetDownload'+ '?personId='+personId+'&'+jQuery.param(person); 21 | } 22 | 23 | public getPerson(id: number) : void { 24 | this.$http.get('Home/GetPerson' + '/' + id); 25 | } 26 | 27 | public getAllAutos() : ng.IPromise { 28 | return this.$http.get('Home/GetAllAutos').then((response: ng.IHttpPromiseCallbackArg) : ProxyGeneratorDemoPage.Models.Person.Models.IPerson[] => { return response.data; }); 29 | } 30 | 31 | //#region Angular Module Definition 32 | private static _module: ng.IModule; 33 | public static get module(): ng.IModule { 34 | if (this._module) { return this._module; } 35 | this._module = angular.module('HomePService', []); 36 | this._module.service('HomePService', HomePService); 37 | return this._module; 38 | } 39 | //#endregion 40 | 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text; 3 | using System.Web.Mvc; 4 | using Ninject; 5 | using ProxyGenerator.ProxyTypeAttributes; 6 | using ProxyGeneratorDemoPage.Models.Person.Models; 7 | 8 | namespace ProxyGeneratorDemoPage.Controllers 9 | { 10 | public class HomeController : Controller 11 | { 12 | [CreateAngularTsProxy(CreateWindowLocationHrefLink = true)] 13 | public FileResult GetDownload(int personId, Person person) 14 | { 15 | var fileContent = Encoding.ASCII.GetBytes("Das ist ein Test Download"); 16 | return File(fileContent, "text/text", "TestDL.txt"); 17 | } 18 | 19 | [CreateAngularTsProxy(ReturnType = typeof(void))] 20 | public ActionResult GetPerson(int id) 21 | { 22 | return Json(new Person() {Id = id}, JsonRequestBehavior.AllowGet); 23 | } 24 | 25 | [CreateAngularJsProxy()] 26 | public ActionResult AddOrUpdatePerson(Person person) 27 | { 28 | return Json(person, JsonRequestBehavior.AllowGet); 29 | } 30 | 31 | [CreateAngularJsProxy()] 32 | public ActionResult GetAllPersons() 33 | { 34 | return Json(new List() {new Person()}, JsonRequestBehavior.AllowGet); 35 | } 36 | 37 | [CreateAngularTsProxy(ReturnType = typeof(List))] 38 | public JsonResult GetAllAutos() 39 | { 40 | return Json(new List() { new Auto()}, JsonRequestBehavior.AllowGet); 41 | } 42 | 43 | [CreateAngularJsProxy()] 44 | public ActionResult SearchPerson(string name) 45 | { 46 | return Json(new Person() { Name = name}, JsonRequestBehavior.AllowGet); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/TestHelper/AccessPrivateProperties.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | 4 | namespace UnitTests.TestHelper 5 | { 6 | public class AccessPrivateProperties 7 | { 8 | /// 9 | /// Setzen von Properties für Private Member einer Klasse 10 | /// 11 | /// Das Objekt in dem das Property vorkommt 12 | /// Der Name des Properties 13 | /// Der Wert der gesetzt werden soll 14 | public static void SetPropertyValue(object target, string memberName, object newValue) 15 | { 16 | PropertyInfo prop = GetPropertyReference(target.GetType(), memberName); 17 | prop.SetValue(target, newValue, null); 18 | } 19 | 20 | private static PropertyInfo GetPropertyReference(Type targetType, string memberName) 21 | { 22 | PropertyInfo propInfo = targetType.GetProperty(memberName, 23 | BindingFlags.Public | 24 | BindingFlags.NonPublic | 25 | BindingFlags.Instance); 26 | 27 | if (propInfo == null && targetType.BaseType != null) 28 | { 29 | //if the member isn't actually on the type we're working on, rather it's 30 | //defined in a base class as private, it won't be returned in the above call, 31 | //so we have to walk the type hierarchy until we find it. 32 | // See: http://agsmith.wordpress.com/2007/12/13/where-are-my-fields/ 33 | return GetPropertyReference(targetType.BaseType, memberName); 34 | } 35 | return propInfo; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Services/homePService.js: -------------------------------------------------------------------------------- 1 | //Warning this file was dynamicly created. 2 | //Please don't change any code it will be overwritten next time the template is executed. 3 | //Created on 24.10.2017 time 09:04 from jrenatus. 4 | var App; 5 | (function (App) { 6 | var Services; 7 | (function (Services) { 8 | var HomePService = (function () { 9 | function HomePService($http) { 10 | this.$http = $http; 11 | } 12 | HomePService.prototype.getDownload = function (personId, person) { 13 | window.location.href = 'Home/GetDownload' + '?personId=' + personId + '&' + jQuery.param(person); 14 | }; 15 | HomePService.prototype.getPerson = function (id) { 16 | this.$http.get('Home/GetPerson' + '/' + id); 17 | }; 18 | HomePService.prototype.getAllAutos = function () { 19 | return this.$http.get('Home/GetAllAutos').then(function (response) { return response.data; }); 20 | }; 21 | Object.defineProperty(HomePService, "module", { 22 | get: function () { 23 | if (this._module) { 24 | return this._module; 25 | } 26 | this._module = angular.module('HomePService', []); 27 | this._module.service('HomePService', HomePService); 28 | return this._module; 29 | }, 30 | enumerable: true, 31 | configurable: true 32 | }); 33 | HomePService.$inject = ['$http']; 34 | return HomePService; 35 | }()); 36 | Services.HomePService = HomePService; 37 | })(Services = App.Services || (App.Services = {})); 38 | })(App || (App = {})); 39 | //# sourceMappingURL=homePService.js.map -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Directives/fileUpload.ts: -------------------------------------------------------------------------------- 1 | angular.module("fileUpload", []) 2 | /* 3 | Da man für file Inputs kein ng-model verwenden kann und angular hier keine integrierte Lösung mit sich bringt, 4 | gibt es diese direktive. Hier wird einfach an sq-file-model die Variable gebunden in der der Kontent geschrieben werden soll, wie ng-model. 5 | Beispiel: 6 | 7 | 10 | */ 11 | .directive('sqFileModel', ['$parse', function ($parse) { 12 | return { 13 | restrict: 'A', 14 | require: 'ngModel', //NgModel wird nur Pseudomäßig benötigt, damit wir später in der Link Funktion darauf zugreifen können 15 | scope: { 16 | sqFileModel: "=" 17 | }, 18 | link: function (scope, elem, attr, ctrl) { 19 | var model = $parse(attr.sqFileModel); 20 | var modelSetter = model.assign; 21 | elem.bind('change', function () { 22 | scope.$apply(function () { 23 | modelSetter(scope, elem[0].files[0]); 24 | //Auslösen unseres Validators 25 | ctrl.$setViewValue(elem[0].files[0]); 26 | ctrl.$render(); 27 | }); 28 | }); 29 | 30 | //Custom Validation einbinden für Required und FileType 31 | var validator = function (file) { 32 | return file; 33 | } 34 | 35 | //Unseren Validator den passenden Listen hinzufügen. 36 | ctrl.$parsers.unshift(validator); //view-to-model direction 37 | ctrl.$formatters.unshift(validator); //model-to-view direction 38 | } 39 | }; 40 | }]); -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Container/ProxyMethodInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | 5 | namespace ProxyGenerator.Container 6 | { 7 | public class ProxyMethodInfos 8 | { 9 | #region Member 10 | /// 11 | /// Der aktuelle Namespace der Methode 12 | /// 13 | public string Namespace { get; set; } 14 | 15 | /// 16 | /// Der Methodenname inkl. Namespace davor. 17 | /// 18 | public string MethodNameWithNamespace { get; set; } 19 | 20 | /// 21 | /// Dem Proxy Attribut kann man einen Returntype hinterlegen, dieser wird hier zurückgegeben 22 | /// 23 | public Type ReturnType { get; set; } 24 | 25 | /// 26 | /// Dem Proxy Attribut kann man auch sagen das nur ein Href Link erstellt werden soll. 27 | /// 28 | public bool CreateWindowLocationHrefLink { get; set; } 29 | 30 | /// 31 | /// Reflexion Type für die Methode 32 | /// 33 | public MethodInfo MethodInfo { get; set; } 34 | 35 | /// 36 | /// Der zugehörige Controller zur Methode 37 | /// 38 | public Type Controller { get; set; } 39 | 40 | /// 41 | /// Die Parameter der Methode die übergeben werden in der richtigen Reihenfolge. 42 | /// 43 | public List ProxyMethodParameterInfos { get; set; } 44 | #endregion 45 | 46 | #region Konstruktor 47 | public ProxyMethodInfos() 48 | { 49 | ProxyMethodParameterInfos = new List(); 50 | Namespace = String.Empty; 51 | MethodNameWithNamespace = String.Empty; 52 | CreateWindowLocationHrefLink = false; 53 | } 54 | #endregion 55 | 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Builder/Helper/ReflectionHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace ProxyGenerator.Builder.Helper 9 | { 10 | public static class ReflectionHelper 11 | { 12 | /// 13 | /// Da es in .NET 4.0 noch kein "AttributeType" und "GetAllBaseTypes()" Extension gibt, 14 | /// hier ein passender Helper der zu einem Typ alle Basistypen zurück gibt 15 | /// 16 | public static ICollection GetAllBaseTypes(Type type) 17 | { 18 | var types = new List(); 19 | //wenn der Type bei Object angekommen ist, dann ist type = null da der Type von Object == null ist! 20 | while (type != null) 21 | { 22 | types.Add(type); 23 | type = type.BaseType; 24 | } 25 | return types; 26 | } 27 | 28 | public static bool MyHasCustomAttributesData(this IList data, Type attribute) 29 | { 30 | return data.Any(atr => GetAllBaseTypes(atr.Constructor.DeclaringType).Select(_ => _.FullName).Contains(attribute.FullName)); 31 | } 32 | 33 | /// 34 | /// 35 | /// 36 | /// z.B. "CreateProxyBaseAttribute" 37 | /// z.B. "ReturnType" 38 | /// 39 | public static CustomAttributeNamedArgument? MyGetCustomAttributesData(this IList data, Type attribute, string propertyName) 40 | { 41 | var daten = data.Where(atr => GetAllBaseTypes(atr.Constructor.DeclaringType).Select(_ => _.FullName).Contains(attribute.FullName)).ToArray().FirstOrDefault(); 42 | return daten?.NamedArguments?.FirstOrDefault(_ => _.MemberInfo.Name == propertyName); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Scripts/typings/angularjs/angular-cookies.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for Angular JS 1.4 (ngCookies module) 2 | // Project: http://angularjs.org 3 | // Definitions by: Diego Vilar , Anthony Ciccarello 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | 7 | /// 8 | 9 | declare module "angular-cookies" { 10 | var _: string; 11 | export = _; 12 | } 13 | 14 | /** 15 | * ngCookies module (angular-cookies.js) 16 | */ 17 | declare module angular.cookies { 18 | 19 | /** 20 | * CookieService 21 | * see http://docs.angularjs.org/api/ngCookies.$cookies 22 | */ 23 | interface ICookiesService { 24 | [index: string]: any; 25 | } 26 | 27 | /** 28 | * CookieStoreService 29 | * see http://docs.angularjs.org/api/ngCookies.$cookieStore 30 | */ 31 | interface ICookiesService { 32 | get(key: string): string; 33 | getObject(key: string): any; 34 | getAll(): any; 35 | put(key: string, value: string, options?: any): void; 36 | putObject(key: string, value: any, options?: any): void; 37 | remove(key: string, options?: any): void; 38 | } 39 | 40 | /** 41 | * CookieStoreService DEPRECATED 42 | * see https://code.angularjs.org/1.2.26/docs/api/ngCookies/service/$cookieStore 43 | */ 44 | interface ICookieStoreService { 45 | /** 46 | * Returns the value of given cookie key 47 | * @param key Id to use for lookup 48 | */ 49 | get(key: string): any; 50 | /** 51 | * Sets a value for given cookie key 52 | * @param key Id for the value 53 | * @param value Value to be stored 54 | */ 55 | put(key: string, value: any): void; 56 | /** 57 | * Remove given cookie 58 | * @param key Id of the key-value pair to delete 59 | */ 60 | remove(key: string): void; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/Builder/Helper/ProxyBuilderHelperTests/GetProxyFunctionName.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using ProxyGenerator.Builder.Helper; 3 | using ProxyGenerator.Container; 4 | 5 | namespace UnitTests.Builder.Helper.ProxyBuilderHelperTests 6 | { 7 | [TestFixture] 8 | public class GetProxyFunctionName 9 | { 10 | [Test] 11 | public void LowerFirstChar_True() 12 | { 13 | //Arrange 14 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings() { LowerFirstCharInFunctionName = true}); 15 | 16 | //Act 17 | var name = proxyBuilder.GetProxyFunctionName("GetMember"); 18 | 19 | //Assert 20 | Assert.AreEqual(name, "getMember"); 21 | } 22 | 23 | [Test] 24 | public void LowerFirstChar_False() 25 | { 26 | //Arrange 27 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings() { LowerFirstCharInFunctionName = false }); 28 | 29 | //Act 30 | var name = proxyBuilder.GetProxyFunctionName("GetMember"); 31 | 32 | //Assert 33 | Assert.AreEqual(name, "GetMember"); 34 | } 35 | 36 | [Test] 37 | public void LowerFirstChar_True_Methodname_One_CharLength() 38 | { 39 | //Arrange 40 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings() { LowerFirstCharInFunctionName = true }); 41 | 42 | //Act 43 | var name = proxyBuilder.GetProxyFunctionName("G"); 44 | 45 | //Assert 46 | Assert.AreEqual(name, "g"); 47 | } 48 | 49 | [Test] 50 | public void LowerFirstChar_True_Methodname_Two_CharLength() 51 | { 52 | //Arrange 53 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings() { LowerFirstCharInFunctionName = true }); 54 | 55 | //Act 56 | var name = proxyBuilder.GetProxyFunctionName("Ge"); 57 | 58 | //Assert 59 | Assert.AreEqual(name, "ge"); 60 | } 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Views/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/App_Start/NinjectWebCommon.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Web; 3 | using Microsoft.Web.Infrastructure.DynamicModuleHelper; 4 | using Ninject; 5 | using Ninject.Web.Common; 6 | using ProxyGeneratorDemoPage; 7 | 8 | [assembly: WebActivatorEx.PreApplicationStartMethod(typeof(NinjectWebCommon), "Start")] 9 | [assembly: WebActivatorEx.ApplicationShutdownMethodAttribute(typeof(NinjectWebCommon), "Stop")] 10 | 11 | namespace ProxyGeneratorDemoPage 12 | { 13 | public static class NinjectWebCommon 14 | { 15 | private static readonly Bootstrapper bootstrapper = new Bootstrapper(); 16 | 17 | /// 18 | /// Starts the application 19 | /// 20 | public static void Start() 21 | { 22 | DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule)); 23 | DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule)); 24 | bootstrapper.Initialize(CreateKernel); 25 | } 26 | 27 | /// 28 | /// Stops the application. 29 | /// 30 | public static void Stop() 31 | { 32 | bootstrapper.ShutDown(); 33 | } 34 | 35 | /// 36 | /// Creates the kernel that will manage your application. 37 | /// 38 | /// The created kernel. 39 | private static IKernel CreateKernel() 40 | { 41 | var kernel = new StandardKernel(); 42 | try 43 | { 44 | kernel.Bind>().ToMethod(ctx => () => new Bootstrapper().Kernel); 45 | kernel.Bind().To(); 46 | 47 | RegisterServices(kernel); 48 | return kernel; 49 | } 50 | catch 51 | { 52 | kernel.Dispose(); 53 | throw; 54 | } 55 | } 56 | 57 | /// 58 | /// Load your modules or register your services here! 59 | /// 60 | /// The kernel. 61 | private static void RegisterServices(IKernel kernel) 62 | { 63 | //kernel.Bind().To().InSingletonScope(); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/TestHelper/ProxyControllerInfoGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using System.Web.Http; 7 | using ProxyGenerator.Container; 8 | using UnitTests.TestHelper.TestClasses; 9 | 10 | namespace UnitTests.TestHelper 11 | { 12 | /// 13 | /// Helper Klasse, welche für die ProxyBuilder Tests eine Liste mit passenden ProxyControllerInfos erstellt. 14 | /// Für jeden ProxyBuilder wird die gleiche Liste verwendet! 15 | /// 16 | public class ProxyControllerInfoGenerator 17 | { 18 | private List TestClassTypes { get; set; } 19 | 20 | public ProxyControllerInfoGenerator() 21 | { 22 | //Aus der Aktuellen Test DLL alle Typen ermitteln in denen der Name "ProxyControllerInfoGeneratorOneParam" vorkommt, sollte nur einen Typen geben! 23 | //Achtung Private "Sub" Klasse! 24 | TestClassTypes = Assembly.GetExecutingAssembly().GetTypes().Where(type => type.Name.Contains("ProxyControllerInfoGeneratorOneParam")).ToList(); 25 | } 26 | 27 | /// 28 | /// Eine Liste mit ControllerInfos zurückgeben. Achtung wenn hier Daten geändert werden, kann dies eine Menge Testfälle betreffen. 29 | /// 30 | public List GetControllerInfos() 31 | { 32 | var proxyMethodInfos = new List(); 33 | proxyMethodInfos.Add(new ProxyMethodInfos() { MethodInfo = TestClassTypes.Single().GetMethods().FirstOrDefault(p => p.Name == "OneParam") }); 34 | proxyMethodInfos.Add(new ProxyMethodInfos() { MethodInfo = TestClassTypes.Single().GetMethods().FirstOrDefault(p => p.Name == "OneComplexParam") }); 35 | 36 | var proxyControllerInfos = new List(); 37 | proxyControllerInfos.Add(new ProxyControllerInfo() 38 | { 39 | ProxyMethodInfos = proxyMethodInfos, 40 | ControllerNameWithoutSuffix = "Home" 41 | }); 42 | 43 | return proxyControllerInfos; 44 | } 45 | 46 | /// 47 | /// Die Klasse ist nur zum Testen gedacht, damit wir uns per Reflektion die passenden Methoden laden können. 48 | /// 49 | private class ProxyControllerInfoGeneratorOneParam 50 | { 51 | public void OneParam(string name) { } 52 | public void OneComplexParam(Person person) { } 53 | } 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Container/ProxySettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ProxyGenerator.Container 5 | { 6 | public class ProxySettings 7 | { 8 | #region Member 9 | /// 10 | /// Liste mit allen Templates zur Proxyerstellung 11 | /// 12 | public List Templates { get; set; } 13 | 14 | /// 15 | /// Der Name des WebProjektes in dem sich das T4 Template befindet bzw. der Name des Ordners muss 16 | /// stimmen und hierbei handelt es sich meist um den gleichen Namen wie das WebProjekt. 17 | /// 18 | public string WebProjectName { get; set; } 19 | 20 | /// 21 | /// Der Ausgabepfad relativ zum WebProjekt Rootpfad in dem die Proxies erstellt werden sollen. 22 | /// 23 | public string ProxyFileOutputPath { get; set; } 24 | 25 | /// 26 | /// Gibt an ob der Name der jeweiligen Proxy Funktion mit kleinem oder großem Buchstaben beginnt. 27 | /// 28 | public bool LowerFirstCharInFunctionName { get; set; } 29 | 30 | /// 31 | /// Der komplette Pfad bis zum WebProjekt bzw. auch Subpfade erlaubt z.B. bis zum T4 Template 32 | /// 33 | public string FullPathToTheWebProject { get; set; } 34 | 35 | /// 36 | /// Der Prefix der for den Klassennamen bei TypeLite gesetzt werden soll, wenn hier die TypeScript Interfaces zu den Klassen erstellt werden sollen 37 | /// Normalerweise wird hier direkt der Klassenname verwendet, ich habe aber gern ein "I" davor. 38 | /// 39 | public string TypeLiteInterfacePrefix { get; set; } 40 | 41 | /// 42 | /// Der ProxyPfad der vor jeden Service Call gestellt wird in der URL, z.B. "api" 43 | /// 44 | public string ServicePrefixUrl { get; set; } 45 | 46 | /// 47 | /// Pfad zur web.config 48 | /// 49 | public string WebConfigPath { get; set; } 50 | #endregion 51 | 52 | #region Konstruktor 53 | public ProxySettings() 54 | { 55 | Templates = new List(); 56 | WebProjectName = string.Empty; 57 | LowerFirstCharInFunctionName = true; 58 | FullPathToTheWebProject = String.Empty; 59 | WebConfigPath = string.Empty; 60 | ServicePrefixUrl = string.Empty; 61 | } 62 | #endregion 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/Builder/Helper/ProxyBuilderHelperTests/GetProxyFileName.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using ProxyGenerator.Builder.Helper; 3 | using ProxyGenerator.Container; 4 | 5 | namespace UnitTests.Builder.Helper.ProxyBuilderHelperTests 6 | { 7 | [TestFixture] 8 | public class GetProxyFileName 9 | { 10 | [Test] 11 | public void TypeScriptFile_Extensions() 12 | { 13 | //Arrange 14 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings()); 15 | 16 | //Act 17 | var name = proxyBuilder.GetProxyFileName("Home", "PSrv", "ts"); 18 | 19 | //Assert 20 | Assert.AreEqual(name, "homePSrv.ts"); 21 | } 22 | 23 | [Test] 24 | public void JavaScriptFile_Extensions() 25 | { 26 | //Arrange 27 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings()); 28 | 29 | //Act 30 | var name = proxyBuilder.GetProxyFileName("Home", "PSrv", "js"); 31 | 32 | //Assert 33 | Assert.AreEqual(name, "homePSrv.js"); 34 | } 35 | 36 | [Test] 37 | public void ControllerName_One_Letter() 38 | { 39 | //Arrange 40 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings()); 41 | 42 | //Act 43 | var name = proxyBuilder.GetProxyFileName("H", "PSrv", "js"); 44 | 45 | //Assert 46 | Assert.AreEqual(name, "hPSrv.js"); 47 | } 48 | 49 | [Test] 50 | public void ControllerName_Two_Letters() 51 | { 52 | //Arrange 53 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings()); 54 | 55 | //Act 56 | var name = proxyBuilder.GetProxyFileName("Ho", "PSrv", "js"); 57 | 58 | //Assert 59 | Assert.AreEqual(name, "hoPSrv.js"); 60 | } 61 | 62 | [Test] 63 | public void Suffix_IsNull() 64 | { 65 | //Arrange 66 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings()); 67 | 68 | //Act 69 | var name = proxyBuilder.GetProxyFileName("home", null, "js"); 70 | 71 | //Assert 72 | Assert.AreEqual(name, "home.js"); 73 | } 74 | 75 | [Test] 76 | public void Suffix_Empty() 77 | { 78 | //Arrange 79 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings()); 80 | 81 | //Act 82 | var name = proxyBuilder.GetProxyFileName("home", string.Empty, "js"); 83 | 84 | //Assert 85 | Assert.AreEqual(name, "home.js"); 86 | } 87 | 88 | } 89 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/FileHelperTests/GetProxyFileOutputPath.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using ProxyGenerator; 3 | using ProxyGenerator.Container; 4 | using ProxyGenerator.Manager; 5 | 6 | namespace UnitTests.FileHelperTests 7 | { 8 | [TestFixture] 9 | public class GetProxyFileOutputPath 10 | { 11 | 12 | [Test] 13 | public void GetProxyFileOutputPath_Success() 14 | { 15 | //Arrange 16 | var proxySettings = new ProxySettings() 17 | { 18 | FullPathToTheWebProject = @"C:\Temp\Files\MyProjectDirectory\OtherDirectory\Bin\Debug\Test", 19 | WebProjectName = "MyProjectDirectory", 20 | ProxyFileOutputPath = @"ScriptsApp\services" 21 | }; 22 | 23 | var fileHelper = new FileHelper(new ProxyGeneratorFactoryManager(proxySettings)); 24 | 25 | //Act 26 | var path = fileHelper.GetProxyFileOutputPath("homePSrv.js", null); 27 | 28 | //Assert 29 | Assert.AreEqual(path, @"C:\Temp\Files\MyProjectDirectory\ScriptsApp\services\homePSrv.js"); 30 | } 31 | 32 | [Test] 33 | public void GetProxyFileOutputPath_No_ProxyFileOutputPath() 34 | { 35 | //Arrange 36 | var proxySettings = new ProxySettings() 37 | { 38 | FullPathToTheWebProject = @"C:\Temp\Files\MyProjectDirectory\OtherDirectory\Bin\Debug\Test", 39 | WebProjectName = "MyProjectDirectory", 40 | ProxyFileOutputPath = string.Empty 41 | }; 42 | 43 | var fileHelper = new FileHelper(new ProxyGeneratorFactoryManager(proxySettings)); 44 | 45 | //Act 46 | var path = fileHelper.GetProxyFileOutputPath("homePSrv.js", null); 47 | 48 | //Assert 49 | Assert.AreEqual(path, "homePSrv.js"); 50 | } 51 | 52 | [Test] 53 | public void GetProxyFileOutputPath_AlternateOutputPath() 54 | { 55 | //Arrange 56 | var proxySettings = new ProxySettings() 57 | { 58 | FullPathToTheWebProject = @"C:\Temp\Files\MyProjectDirectory\OtherDirectory\Bin\Debug\Test", 59 | WebProjectName = "MyProjectDirectory", 60 | ProxyFileOutputPath = string.Empty 61 | }; 62 | 63 | var fileHelper = new FileHelper(new ProxyGeneratorFactoryManager(proxySettings)); 64 | 65 | //Act 66 | var path = fileHelper.GetProxyFileOutputPath("homePSrv.js", "alternatePath"); 67 | 68 | //Assert 69 | Assert.AreEqual(path, @"C:\Temp\Files\MyProjectDirectory\alternatePath\homePSrv.js"); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/FileHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ProxyGenerator.Interfaces; 3 | 4 | namespace ProxyGenerator 5 | { 6 | public class FileHelper : IFileHelper 7 | { 8 | #region Member 9 | IProxyGeneratorFactoryManager Factory { get; set; } 10 | #endregion 11 | 12 | #region Konstruktor 13 | public FileHelper(IProxyGeneratorFactoryManager proxyGeneratorFactory) 14 | { 15 | Factory = proxyGeneratorFactory; 16 | } 17 | #endregion 18 | 19 | /// 20 | /// Zum Ermitteln des Hauptpfades des Webprojektes 21 | /// 22 | public string GetParentDirectory(string path, string pathNameToFind) 23 | { 24 | if (!path.Contains(pathNameToFind)) 25 | { 26 | throw new Exception("The 'WebProjectPath' was not found, because the 'WebProjectName' was wrong."); 27 | } 28 | 29 | if (string.IsNullOrEmpty(path) || path.TrimEnd(System.IO.Path.DirectorySeparatorChar).EndsWith(pathNameToFind)) 30 | return path; 31 | 32 | string parent = System.IO.Path.GetDirectoryName(path); 33 | 34 | if (path.Contains(pathNameToFind)) 35 | return GetParentDirectory(parent, pathNameToFind); 36 | 37 | return parent; 38 | } 39 | 40 | /// 41 | /// Gibt zum übergebenen Dateinamen den Ausgabepfad zurück in dem die Proxy Dateien erstellt werden sollen. 42 | /// 43 | /// Der Dateiname der an den Pfad angehängt werden soll. 44 | /// Ein alternativer Ausgabepfad der übergeben werden kann 45 | public string GetProxyFileOutputPath(string fileName, string alternateOutputPath) 46 | { 47 | var proxySettings = Factory.GetProxySettings(); 48 | 49 | //Wenn ein alternativer Ausgabepfad übergeben wurde, dann die Datei hier ablegen und nicht bei der Standardausgabe 50 | if (!string.IsNullOrEmpty(alternateOutputPath)) 51 | { 52 | var localPath = GetParentDirectory(proxySettings.FullPathToTheWebProject, proxySettings.WebProjectName); 53 | return System.IO.Path.Combine(localPath, alternateOutputPath, fileName); 54 | } 55 | 56 | if (!string.IsNullOrEmpty(proxySettings.ProxyFileOutputPath)) 57 | { 58 | var localPath = GetParentDirectory(proxySettings.FullPathToTheWebProject, proxySettings.WebProjectName); 59 | return System.IO.Path.Combine(localPath, proxySettings.ProxyFileOutputPath, fileName); 60 | } 61 | 62 | return fileName; 63 | } 64 | 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/DomainModels/DomainModels.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {EA1A5802-9139-4BF3-B623-684C278C8088} 8 | Library 9 | Properties 10 | DomainModels 11 | DomainModels 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | ..\packages\TypeLite.1.8.0\lib\net4\TypeLite.dll 43 | 44 | 45 | ..\packages\TypeLite.1.8.0\lib\net4\TypeLite.Net4.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/Builder/Helper/ProxyBuilderHelperTests/HasAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Reflection; 4 | using NUnit.Framework; 5 | using ProxyGenerator.Builder.Helper; 6 | using ProxyGenerator.Container; 7 | using ProxyGenerator.ProxyTypeAttributes; 8 | 9 | namespace UnitTests.Builder.Helper.ProxyBuilderHelperTests 10 | { 11 | [TestFixture] 12 | public class HasAttribute 13 | { 14 | private Type TestClassType { get; set; } 15 | private ProxyBuilderHelper ProxyBuildHelper { get; set; } 16 | 17 | [SetUp] 18 | public void Setup() 19 | { 20 | //Aus der Aktuellen Test DLL DEN Typen ermitteln in dem der Name "GetFunctionParametersOneParam" vorkommt, sollte nur einen Typen geben! 21 | //Achtung Private "Sub" Klasse! 22 | TestClassType = Assembly.GetExecutingAssembly().GetTypes().First(type => type.Name.Contains("HasAttributeOneParam")); 23 | ProxyBuildHelper = new ProxyBuilderHelper(new ProxySettings()); 24 | } 25 | 26 | [Test] 27 | public void CreateAngularJsProxy_HasAttribute_True() 28 | { 29 | //Arrange 30 | var method = TestClassType.GetMethod("NoParam"); 31 | 32 | //Act 33 | var hasAttribute = ProxyBuildHelper.HasAttribute(typeof (CreateAngularJsProxyAttribute), method); 34 | 35 | //Assert 36 | Assert.IsTrue(hasAttribute); 37 | } 38 | 39 | [Test] 40 | public void CreateAngularJsProxy_HasAttribute_False() 41 | { 42 | //Arrange 43 | var method = TestClassType.GetMethod("NoParam"); 44 | 45 | //Act 46 | var hasAttribute = ProxyBuildHelper.HasAttribute(typeof(CreateJQueryTsProxyAttribute), method); 47 | 48 | //Assert 49 | Assert.IsFalse(hasAttribute); 50 | } 51 | 52 | [Test] 53 | public void CreateAngularTsProxy_HasAttribute_True() 54 | { 55 | //Arrange 56 | var method = TestClassType.GetMethod("OneParam"); 57 | 58 | //Act 59 | var hasAttribute = ProxyBuildHelper.HasAttribute(typeof(CreateAngularTsProxyAttribute), method); 60 | 61 | //Assert 62 | Assert.IsTrue(hasAttribute); 63 | } 64 | 65 | [Test] 66 | public void CreateAngularTsProxy_HasAttribute_False() 67 | { 68 | //Arrange 69 | var method = TestClassType.GetMethod("OneParam"); 70 | 71 | //Act 72 | var hasAttribute = ProxyBuildHelper.HasAttribute(typeof(CreateJQueryTsProxyAttribute), method); 73 | 74 | //Assert 75 | Assert.IsFalse(hasAttribute); 76 | } 77 | 78 | 79 | /// 80 | /// Die Klasse ist nur zum Testen gedacht, damit wir uns per Reflektion die passenden Methoden laden können. 81 | /// 82 | private class HasAttributeOneParam 83 | { 84 | [CreateAngularJsProxy] 85 | public void NoParam() { } 86 | 87 | [CreateAngularTsProxy] 88 | public void OneParam(string name) { } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/NuGet.Packager/Package.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TypeScriptAngularJsProxyGenerator 5 | 2.2.0 6 | TypeScript/JavaScript (Angular 5.x / AngularJs or jQuery) ProxyGenerator Template for Controllers/WebApi 7 | SquadWuschel 8 | SquadWuschel 9 | https://github.com/squadwuschel/MvcControllerToProxyGenerator 10 | false 11 | 12 | Create TypeScript or JavaScript Proxies for your ASP.NET MVC Controllers. The T4 template can create Angular 2, AngularJs or jQuery proxies for your .NET Controllers or WebApi Controller. 13 | 14 | How to use it: https://github.com/squadwuschel/MvcControllerToProxyGenerator 15 | 16 | 17 | 18 | TypeScript or JavaScript ProxyGenerator for ASP.NET MVC. To create AngularJs or jQuery proxies with T4 template for your .NET Controllers or WebApi Controller 19 | 20 | Version 1.0.2: Added support for alternative proxy creation path 21 | Version 1.0.3: ProxyGeneratorScript.tt Script moved to the "Scripts" Folder 22 | Version 1.0.4: Added FileUpload Support in all ProxyTypes with .NET Type "HttpPostedFileBase" 23 | Version 1.0.5: Removed the Dependency "Microsoft.VisualStudio.TextTemplating" for testing 24 | Version 1.0.6: Bugfix for COM Exception in ProxyFileManager 25 | Version 1.0.7: Removed unused NuGet Packages from ProxyGenerator.dll - minimum Requirement ist .NET 4.0 Project now. 26 | Version 1.0.8: Bugfix alternative filepath for proxycreation 27 | Version 1.0.10: BugFix jQuery "POST" data attribute added for post calls 28 | Version 1.0.11: Bugfix jQuery "POST" added "JSON.stringify(data)", added support to store the proxysettings in the web.config (ReadMe Updated) 29 | Version 1.1.0: Added Support for Generics 30 | Version 1.2.0: Added Support to create "window.location.href" function calls 31 | Version 1.2.1: Added Support to specify the outputpath for every ProxyType 32 | Version 2.0.0: Added Angular 2 Support with new Attribute 33 | Version 2.0.1: Assembly Loading Fix 34 | Version 2.0.2: Logging Possibility implemented for FileloadExceptions from the Assemblies 35 | Version 2.1.0: Loading 64Bit DLLs with T4 now Possible 36 | Version 2.1.1: Loading 64Bit DLLs with T4 now Possible - Bugfix 37 | Version 2.1.3: Fix Loading Assemblies 38 | Version 2.2.0: Angular 5 Support for httpClient - not working with Angular 2 any more. 39 | 40 | en-GB 41 | JavaScript TypeScript AngularJs jQuery Proxy Generator 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/Builder/Helper/ProxyBuilderDataTypeHelperTests/AddInterfacePrefixToFullName.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using ProxyGenerator.Builder.Helper; 3 | using ProxyGenerator.Container; 4 | 5 | namespace UnitTests.Builder.Helper.ProxyBuilderDataTypeHelperTests 6 | { 7 | [TestFixture] 8 | public class AddInterfacePrefixToFullName 9 | { 10 | [Test] 11 | public void AddInterfacePrefixToFullName_NoEnum_NoPrefix() 12 | { 13 | //Arrange 14 | var proxyBuilderDataType = new ProxyBuilderDataTypeHelper(new ProxySettings() { TypeLiteInterfacePrefix = ""}); 15 | 16 | //Act 17 | var result = proxyBuilderDataType.AddInterfacePrefixToFullName("Test.Common.Person", false); 18 | 19 | //Assert 20 | Assert.AreEqual("Test.Common.Person", result); 21 | } 22 | 23 | [Test] 24 | public void AddInterfacePrefixToFullName_NoEnum_I_Prefix() 25 | { 26 | //Arrange 27 | var proxyBuilderDataType = new ProxyBuilderDataTypeHelper(new ProxySettings() { TypeLiteInterfacePrefix = "I" }); 28 | 29 | //Act 30 | var result = proxyBuilderDataType.AddInterfacePrefixToFullName("Test.Common.Person", false); 31 | 32 | //Assert 33 | Assert.AreEqual("Test.Common.IPerson", result); 34 | } 35 | 36 | [Test] 37 | public void AddInterfacePrefixToFullName_NoEnum_I_Prefix_NoNs() 38 | { 39 | //Arrange 40 | var proxyBuilderDataType = new ProxyBuilderDataTypeHelper(new ProxySettings() { TypeLiteInterfacePrefix = "I" }); 41 | 42 | //Act 43 | var result = proxyBuilderDataType.AddInterfacePrefixToFullName("Person", false); 44 | 45 | //Assert 46 | Assert.AreEqual("IPerson", result); 47 | } 48 | 49 | [Test] 50 | public void AddInterfacePrefixToFullName_NoEnum_NoPrefix_NoNs() 51 | { 52 | //Arrange 53 | var proxyBuilderDataType = new ProxyBuilderDataTypeHelper(new ProxySettings() { TypeLiteInterfacePrefix = "" }); 54 | 55 | //Act 56 | var result = proxyBuilderDataType.AddInterfacePrefixToFullName("Person", false); 57 | 58 | //Assert 59 | Assert.AreEqual("Person", result); 60 | } 61 | 62 | [Test] 63 | public void AddInterfacePrefixToFullName_Enum_NoPrefix() 64 | { 65 | //Arrange 66 | var proxyBuilderDataType = new ProxyBuilderDataTypeHelper(new ProxySettings() { TypeLiteInterfacePrefix = "" }); 67 | 68 | //Act 69 | var result = proxyBuilderDataType.AddInterfacePrefixToFullName("Test.Common.TestEnum", true); 70 | 71 | //Assert 72 | Assert.AreEqual("Test.Common.TestEnum", result); 73 | } 74 | 75 | [Test] 76 | public void AddInterfacePrefixToFullName_Enum_I_Prefix() 77 | { 78 | //Arrange 79 | var proxyBuilderDataType = new ProxyBuilderDataTypeHelper(new ProxySettings() { TypeLiteInterfacePrefix = "I" }); 80 | 81 | //Act 82 | var result = proxyBuilderDataType.AddInterfacePrefixToFullName("Test.Common.TestEnum", true); 83 | 84 | //Assert 85 | Assert.AreEqual("Test.Common.TestEnum", result); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Manager/ProxyGeneratorFactoryManager.cs: -------------------------------------------------------------------------------- 1 | using ProxyGenerator.Builder; 2 | using ProxyGenerator.Builder.Helper; 3 | using ProxyGenerator.Container; 4 | using ProxyGenerator.Interfaces; 5 | 6 | namespace ProxyGenerator.Manager 7 | { 8 | public class ProxyGeneratorFactoryManager : IProxyGeneratorFactoryManager 9 | { 10 | #region Member 11 | private LogManager LogManager { get; set; } 12 | private ProxySettings ProxySettings { get; set; } 13 | #endregion 14 | 15 | #region Konstruktor 16 | public ProxyGeneratorFactoryManager(ProxySettings proxySettings) 17 | { 18 | ProxySettings = proxySettings; 19 | LogManager = new LogManager(); 20 | } 21 | #endregion 22 | 23 | #region Creator Functions 24 | public IAssemblyManager CreateAssemblyManager() 25 | { 26 | return new AssemblyManager(this); 27 | } 28 | 29 | public IFileHelper FileHelper() 30 | { 31 | return new FileHelper(this); 32 | } 33 | 34 | public IControllerManager CreateControllerManager() 35 | { 36 | return new ControllerManager(this); 37 | } 38 | 39 | public IMethodManager CreateMethodManager() 40 | { 41 | return new MethodManager(this); 42 | } 43 | 44 | public IMethodParameterManager CreateMethodParameterManager() 45 | { 46 | return new MethodParameterManager(); 47 | } 48 | 49 | public IProxyBuilderHelper CreateProxyBuilderHelper() 50 | { 51 | return new ProxyBuilderHelper(ProxySettings); 52 | } 53 | 54 | public IProxyBuilderHttpCall CreateProxyBuilderHttpCall() 55 | { 56 | return new ProxyBuilderHttpCall(this); 57 | } 58 | 59 | public IProxyBuilderDataTypeHelper CreateBuilderTypeHelper() 60 | { 61 | return new ProxyBuilderDataTypeHelper(ProxySettings); 62 | } 63 | 64 | public ISettingsManager CreateSettingsManager() 65 | { 66 | return new SettingsManager(ProxySettings); 67 | } 68 | #endregion 69 | 70 | #region Public Functions 71 | public ProxySettings GetProxySettings() 72 | { 73 | return ProxySettings; 74 | } 75 | 76 | public ILogManager GetLogManager() 77 | { 78 | return LogManager; 79 | } 80 | #endregion 81 | 82 | #region ProxyBuilder Creator 83 | public IProxyBuilder CreateAngularJsProxyBuilder() 84 | { 85 | return new AngularJsProxyBuilder(this); 86 | } 87 | 88 | public IProxyBuilder CreateAngularTsProxyBuilder() 89 | { 90 | return new AngularTsProxyBuilder(this); 91 | } 92 | 93 | public IProxyBuilder CreateAngular2TsProxyBuilder() 94 | { 95 | return new Angular2TsProxyBuilder(this); 96 | } 97 | 98 | public IProxyBuilder CreateJQueryTsProxyBuilder() 99 | { 100 | return new JQueryTsProxyBuilder(this); 101 | } 102 | 103 | public IProxyBuilder CreateJQueryJsProxyBuilder() 104 | { 105 | return new JQueryJsProxyBuilder(this); 106 | } 107 | #endregion 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Manager/MethodParameterManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Web; 6 | using ProxyGenerator.Container; 7 | using ProxyGenerator.Interfaces; 8 | 9 | namespace ProxyGenerator.Manager 10 | { 11 | public class MethodParameterManager : IMethodParameterManager 12 | { 13 | #region Public Functions 14 | /// 15 | /// Laden der Parameter Informationen für alle Parameter der übergebenen Methodeninformationen. 16 | /// Ob es sich um einfachte Datentypen oder ein "complex" Objekt handelt. 17 | /// 18 | public List LoadParameterInfos(MethodInfo methodInfo) 19 | { 20 | List methodParameterInfos = new List(); 21 | 22 | //Alle Parameter der Methode durchgehen und die Typen prüfen 23 | foreach (ParameterInfo parameterInfo in methodInfo.GetParameters()) 24 | { 25 | Type type = parameterInfo.ParameterType; 26 | if (type.IsPrimitive || type == typeof(decimal) || type == typeof(string) || type == typeof(long) || 27 | type == typeof(DateTime) || type == typeof(Int16) || type == typeof(Int32) || 28 | type == typeof(Int64) || type == typeof(bool) || type == typeof(Decimal?) || 29 | type == typeof(DateTime?) || type == typeof(Int16?) || type == typeof(Int32?) || 30 | type == typeof(Int64?) || type == typeof(bool?) || type == typeof(long?) || 31 | type== typeof(double) || type == typeof(double?) || type == typeof(Single) || 32 | type== typeof(Single?) || type == typeof(int) || type == typeof(int?) || 33 | type == typeof(byte) || type == typeof(byte?) || type.IsEnum) 34 | { 35 | methodParameterInfos.Add(new ProxyMethodParameterInfo() 36 | { 37 | IsComplexeType = false, 38 | ParameterName = parameterInfo.Name, 39 | ParameterInfo = parameterInfo, 40 | IsString = type.FullName == typeof(String).FullName, 41 | IsFileUpload = false 42 | }); 43 | } 44 | else 45 | { 46 | methodParameterInfos.Add(new ProxyMethodParameterInfo() 47 | { 48 | IsComplexeType = true, 49 | ParameterName = parameterInfo.Name, 50 | ParameterInfo = parameterInfo, 51 | IsString = false, 52 | //Prüfen ob es sich um einen FileUpload handelt - ist immer Complex Type 53 | IsFileUpload = typeof(HttpPostedFileBase).FullName == type.FullName 54 | }); 55 | } 56 | } 57 | 58 | //Es darf nur ein "komplexer" Parameter pro Controller "übergeben" werden. 59 | if (methodParameterInfos.Count(p => p.IsComplexeType) > 1) 60 | { 61 | throw new NotSupportedException("Warning a method with more than one 'complex' parameter was found, thats not supported by ProxyGenerator."); 62 | } 63 | 64 | return methodParameterInfos; 65 | } 66 | #endregion 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Views/Proxy/JQueryCalls.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewBag.Title = "JQueryCalls"; 4 | } 5 | 6 |
7 |
8 |
9 |

10 | JQuery Calls 11 |

12 |
13 |
14 |
15 |
16 |
17 |
18 | 21 | 24 |
25 |
26 |

27 | Please open the Chrome developer Console to see the service Calls and returned Objects. 28 |

29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |

Datei Upload Tests für jQuery

39 |

The IIS tries to store the uploaded files in the diretory: "C:\Temp\"

40 |
41 |
42 |
43 |
44 |
45 |
46 | 47 |
48 | 51 |
52 | 53 |
54 | 57 |
58 |
59 |

60 |
61 | 72 |
73 |

74 |
75 | 86 |
-------------------------------------------------------------------------------- /DemoPageProxyGenerator/UnitTests/Builder/Helper/ProxyBuilderHelperTests/GetServiceName.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using ProxyGenerator.Builder.Helper; 3 | using ProxyGenerator.Container; 4 | 5 | namespace UnitTests.Builder.Helper.ProxyBuilderHelperTests 6 | { 7 | [TestFixture] 8 | public class GetServiceName 9 | { 10 | [Test] 11 | public void LowerFirstChar_True() 12 | { 13 | //Arrange 14 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings() {LowerFirstCharInFunctionName = true}); 15 | 16 | //Act 17 | var name = proxyBuilder.GetServiceName("Home", "PSrv", true); 18 | 19 | //Assert 20 | Assert.AreEqual(name, "homePSrv"); 21 | } 22 | 23 | [Test] 24 | public void LowerFirstChar_False() 25 | { 26 | //Arrange 27 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings() { LowerFirstCharInFunctionName = false }); 28 | 29 | //Act 30 | var name = proxyBuilder.GetServiceName("Home", "PSrv", false); 31 | 32 | //Assert 33 | Assert.AreEqual(name, "HomePSrv"); 34 | } 35 | 36 | [Test] 37 | public void ControllerName_One_CharLength_LowerFirstChar_True() 38 | { 39 | //Arrange 40 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings() { LowerFirstCharInFunctionName = true }); 41 | 42 | //Act 43 | var name = proxyBuilder.GetServiceName("H", "PSrv",true); 44 | 45 | //Assert 46 | Assert.AreEqual(name, "hPSrv"); 47 | } 48 | 49 | [Test] 50 | public void ControllerName_One_CharLength_LowerFirstChar_False() 51 | { 52 | //Arrange 53 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings() { LowerFirstCharInFunctionName = false }); 54 | 55 | //Act 56 | var name = proxyBuilder.GetServiceName("H", "PSrv", false); 57 | 58 | //Assert 59 | Assert.AreEqual(name, "HPSrv"); 60 | } 61 | 62 | [Test] 63 | public void ControllerName_Two_CharLength() 64 | { 65 | //Arrange 66 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings() { LowerFirstCharInFunctionName = true }); 67 | 68 | //Act 69 | var name = proxyBuilder.GetServiceName("Ho", "PSrv",true); 70 | 71 | //Assert 72 | Assert.AreEqual(name, "hoPSrv"); 73 | } 74 | 75 | [Test] 76 | public void ControllerSuffix_Null_LowerFirstChar_True() 77 | { 78 | //Arrange 79 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings() { LowerFirstCharInFunctionName = true }); 80 | 81 | //Act 82 | var name = proxyBuilder.GetServiceName("Ho", null, true); 83 | 84 | //Assert 85 | Assert.AreEqual(name, "ho"); 86 | } 87 | 88 | [Test] 89 | public void ControllerSuffix_Null_LowerFirstChar_False() 90 | { 91 | //Arrange 92 | var proxyBuilder = new ProxyBuilderHelper(new ProxySettings() { LowerFirstCharInFunctionName = false }); 93 | 94 | //Act 95 | var name = proxyBuilder.GetServiceName("Ho", null, false); 96 | 97 | //Assert 98 | Assert.AreEqual(name, "Ho"); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-redundant-jsdoc": true, 69 | "no-shadowed-variable": true, 70 | "no-string-literal": false, 71 | "no-string-throw": true, 72 | "no-switch-case-fall-through": true, 73 | "no-trailing-whitespace": true, 74 | "no-unnecessary-initializer": true, 75 | "no-unused-expression": true, 76 | "no-use-before-declare": true, 77 | "no-var-keyword": true, 78 | "object-literal-sort-keys": false, 79 | "one-line": [ 80 | true, 81 | "check-open-brace", 82 | "check-catch", 83 | "check-else", 84 | "check-whitespace" 85 | ], 86 | "prefer-const": true, 87 | "quotemark": [ 88 | true, 89 | "single" 90 | ], 91 | "radix": true, 92 | "semicolon": [ 93 | true, 94 | "always" 95 | ], 96 | "triple-equals": [ 97 | true, 98 | "allow-null-check" 99 | ], 100 | "typedef-whitespace": [ 101 | true, 102 | { 103 | "call-signature": "nospace", 104 | "index-signature": "nospace", 105 | "parameter": "nospace", 106 | "property-declaration": "nospace", 107 | "variable-declaration": "nospace" 108 | } 109 | ], 110 | "unified-signatures": true, 111 | "variable-name": false, 112 | "whitespace": [ 113 | true, 114 | "check-branch", 115 | "check-decl", 116 | "check-operator", 117 | "check-separator", 118 | "check-type" 119 | ], 120 | "no-output-on-prefix": true, 121 | "use-input-property-decorator": true, 122 | "use-output-property-decorator": true, 123 | "use-host-property-decorator": true, 124 | "no-input-rename": true, 125 | "no-output-rename": true, 126 | "use-life-cycle-interface": true, 127 | "use-pipe-transform-interface": true, 128 | "component-class-suffix": true, 129 | "directive-class-suffix": true 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorNgDemoPage/Web/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** 38 | * If the application will be indexed by Google Search, the following is required. 39 | * Googlebot uses a renderer based on Chrome 41. 40 | * https://developers.google.com/search/docs/guides/rendering 41 | **/ 42 | // import 'core-js/es6/array'; 43 | 44 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 45 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 46 | 47 | /** IE10 and IE11 requires the following for the Reflect API. */ 48 | // import 'core-js/es6/reflect'; 49 | 50 | /** 51 | * Web Animations `@angular/platform-browser/animations` 52 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 53 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 54 | **/ 55 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 56 | 57 | /** 58 | * By default, zone.js will patch all possible macroTask and DomEvents 59 | * user can disable parts of macroTask/DomEvents patch by setting following flags 60 | */ 61 | 62 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 63 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 64 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 65 | 66 | /* 67 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 68 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 69 | */ 70 | // (window as any).__Zone_enable_cross_context_check = true; 71 | 72 | /*************************************************************************************************** 73 | * Zone JS is required by default for Angular itself. 74 | */ 75 | import 'zone.js/dist/zone'; // Included with Angular CLI. 76 | 77 | 78 | /*************************************************************************************************** 79 | * APPLICATION IMPORTS 80 | */ 81 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2006 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxyGenerator", "ProxyGenerator\ProxyGenerator.csproj", "{B88CFE60-D1F3-43FF-A1FB-B84B4714E0AF}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{E25B9094-40DC-4828-818E-C6EA45739DFE}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxyGeneratorDemoPage", "ProxyGeneratorDemoPage\ProxyGeneratorDemoPage.csproj", "{3B134D5E-39C2-4B0A-8212-C2DC1FFDD3BD}" 11 | EndProject 12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub", "GitHub", "{E77ADB04-9B0B-4D3E-9D59-814F48AE4567}" 13 | ProjectSection(SolutionItems) = preProject 14 | ..\README.md = ..\README.md 15 | EndProjectSection 16 | EndProject 17 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGetPackage", "NuGetPackage", "{9722EE42-4F8A-4A98-BECE-A91D1E4C1866}" 18 | ProjectSection(SolutionItems) = preProject 19 | Readme - NuGetPackager.txt = Readme - NuGetPackager.txt 20 | EndProjectSection 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Packager", "NuGet.Packager\NuGet.Packager.csproj", "{0451BAEF-DF2E-4B98-8644-94EE9415E389}" 23 | EndProject 24 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxyGeneratorNgDemoPage", "ProxyGeneratorNgDemoPage\ProxyGeneratorNgDemoPage.csproj", "{7F621A44-B99C-4FD1-A8C1-DF3C47910158}" 25 | EndProject 26 | Global 27 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 28 | Debug|Any CPU = Debug|Any CPU 29 | Release|Any CPU = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 32 | {B88CFE60-D1F3-43FF-A1FB-B84B4714E0AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {B88CFE60-D1F3-43FF-A1FB-B84B4714E0AF}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {B88CFE60-D1F3-43FF-A1FB-B84B4714E0AF}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {B88CFE60-D1F3-43FF-A1FB-B84B4714E0AF}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {E25B9094-40DC-4828-818E-C6EA45739DFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {E25B9094-40DC-4828-818E-C6EA45739DFE}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {E25B9094-40DC-4828-818E-C6EA45739DFE}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {E25B9094-40DC-4828-818E-C6EA45739DFE}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {3B134D5E-39C2-4B0A-8212-C2DC1FFDD3BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {3B134D5E-39C2-4B0A-8212-C2DC1FFDD3BD}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {3B134D5E-39C2-4B0A-8212-C2DC1FFDD3BD}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {3B134D5E-39C2-4B0A-8212-C2DC1FFDD3BD}.Release|Any CPU.Build.0 = Release|Any CPU 44 | {0451BAEF-DF2E-4B98-8644-94EE9415E389}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 45 | {0451BAEF-DF2E-4B98-8644-94EE9415E389}.Release|Any CPU.ActiveCfg = Release|Any CPU 46 | {0451BAEF-DF2E-4B98-8644-94EE9415E389}.Release|Any CPU.Build.0 = Release|Any CPU 47 | {7F621A44-B99C-4FD1-A8C1-DF3C47910158}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 48 | {7F621A44-B99C-4FD1-A8C1-DF3C47910158}.Debug|Any CPU.Build.0 = Debug|Any CPU 49 | {7F621A44-B99C-4FD1-A8C1-DF3C47910158}.Release|Any CPU.ActiveCfg = Release|Any CPU 50 | {7F621A44-B99C-4FD1-A8C1-DF3C47910158}.Release|Any CPU.Build.0 = Release|Any CPU 51 | EndGlobalSection 52 | GlobalSection(SolutionProperties) = preSolution 53 | HideSolutionNode = FALSE 54 | EndGlobalSection 55 | GlobalSection(NestedProjects) = preSolution 56 | {0451BAEF-DF2E-4B98-8644-94EE9415E389} = {9722EE42-4F8A-4A98-BECE-A91D1E4C1866} 57 | EndGlobalSection 58 | GlobalSection(ExtensibilityGlobals) = postSolution 59 | SolutionGuid = {487F1DE4-DDF3-4BD6-8BCF-D37BC61D4DB5} 60 | EndGlobalSection 61 | EndGlobal 62 | -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/Views/Proxy/AngularCalls.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "AngularJsCalls"; 3 | } 4 | 5 |
6 |
7 |
8 |

9 | AngularJs Proxy Calls 10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 | 20 | 23 |
24 |
25 |

Please open the Chrome developer Console to see the service Calls and returned Objects. 26 |

27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |

Datei Upload Tests für AngularJs

37 |

The IIS tries to store the uploaded files in the diretory: "C:\Temp\"

38 |
39 |
40 |
41 |
42 |
43 |
44 | 45 |
46 | 49 |
50 | 51 |
52 | 55 |
56 |
57 |

58 |
59 | 70 |
71 |

72 |
73 | 84 |
-------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGenerator/Interfaces/IProxyBuilderHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | using ProxyGenerator.Container; 5 | 6 | namespace ProxyGenerator.Interfaces 7 | { 8 | public interface IProxyBuilderHelper 9 | { 10 | /// 11 | /// Gibt den Dateinamen des Proxies zurück 12 | /// 13 | /// Der Name des Controllers ohne das "Controller" davor 14 | /// Der Suffix der an den namen des Controllers angehängt wird, z.b.: PSrv 15 | /// Die Dateienung z.B. js oder ts 16 | string GetProxyFileName(string controllerName, string controllerSuffix, string fileExtension); 17 | 18 | /// 19 | /// Den Namen des Services ermitteln anhand des Namens des Controllers 20 | /// 21 | /// Der Name des Controllers beginnt mit kleinem Buchstaben 22 | /// Der Suffix der an den namen des Controllers angehängt wird, z.b.: PSrv 23 | string GetServiceName(string controllerName, string controllerSuffix, bool lowerFirstCharInFunctionName); 24 | 25 | /// 26 | /// Den Namen der Methode ermitteln der gesetzt werden soll für den Funktionsaufruf. 27 | /// 28 | /// Der Name der Methode z.B. GetAllPersons 29 | string GetProxyFunctionName(string methodname); 30 | 31 | /// 32 | /// Sucht nur die Parameternamen der aktuell übergebenen Methode heraus und baut einen Kommaseperierten String mit den Parameternamen. 33 | /// 34 | string GetFunctionParameters(MethodInfo methodInfo); 35 | 36 | /// 37 | /// Prüfen ob die übergebnene Methode das übergenene Attribut besitzt. 38 | /// 39 | /// Der Typ des Attributs der überprüft werden soll 40 | /// Die Methode bei der das Attribut gesucht werden soll 41 | bool HasAttribute(Type attribute, MethodInfo method); 42 | 43 | /// 44 | /// Ermittelt den Namen des Controller ohne die Endung "Controller", 45 | /// da wir diese nie mit angeben müssen. 46 | /// 47 | string GetClearControllerName(Type controller); 48 | 49 | /// 50 | /// Zusammenbauen der passenden URL Parameter ACHTUNG der UrlParameterName entspricht 51 | /// auch dem gleichen Namen wie der Parameter der gesetzt wird. 52 | /// 53 | /// List mit den Typen die als URL Parameter angelegt werden sollen. 54 | string BuildUrlParameter(List infos); 55 | 56 | /// 57 | /// Prüfen ob eine Id enthalten ist, diese wird extra an die URL angehängt. 58 | /// 59 | string BuildUrlParameterId(List infos); 60 | 61 | /// 62 | /// Prüft ob ein FileUpload Parameter enthalten ist und wenn ja werden die passenden Formdaten erstellt 63 | /// Falls nicht wird einfach ein Leerstring zurückgegeben. 64 | /// 65 | string GetFileUploadFormData(ProxyMethodInfos methodInfo); 66 | 67 | /// 68 | /// Zusammenbauen der passenden URL Parameter ACHTUNG der UrlParameterName entspricht 69 | /// auch dem gleichen Namen wie der Parameter der gesetzt wird. 70 | /// Außerdem werden Komplexe Parameter mit Hilfe von jQuery in Parameter "übersetzt" 71 | /// 72 | /// List mit den Typen die als URL Parameter angelegt werden sollen. 73 | string BuildComplexUrlParameter(List infos); 74 | } 75 | } -------------------------------------------------------------------------------- /DemoPageProxyGenerator/ProxyGeneratorDemoPage/ScriptsApp/Services/proxyAngularJsSrv.js: -------------------------------------------------------------------------------- 1 | //Warning this file was dynamicly created. 2 | //Please don't change any code it will be overwritten next time the template is executed. 3 | //Created on 24.10.2017 time 09:04 from jrenatus. 4 | 5 | 6 | 7 | function proxyAngularJsSrv($http) { this.http = $http; } 8 | 9 | 10 | proxyAngularJsSrv.prototype.addFileToServer = function (datei,detailId) { 11 | var formData = new FormData(); 12 | formData.append('datei', datei); 13 | return this.http.post('Proxy/AddFileToServer'+ '?detailId='+detailId,formData, { transformRequest: angular.identity, headers: { 'Content-Type': undefined }}).then(function (result) { 14 | return result.data; 15 | }); 16 | } 17 | 18 | proxyAngularJsSrv.prototype.addFileToServerNoReturnType = function (datei,detailId) { 19 | var formData = new FormData(); 20 | formData.append('datei', datei); 21 | return this.http.post('Proxy/AddFileToServerNoReturnType'+ '?detailId='+detailId,formData, { transformRequest: angular.identity, headers: { 'Content-Type': undefined }}).then(function (result) { 22 | return result.data; 23 | }); 24 | } 25 | 26 | proxyAngularJsSrv.prototype.getDownloadPerson = function (personId,person) { 27 | window.location.href = 'Proxy/GetDownloadPerson'+ '?personId='+personId+'&'+jQuery.param(person) } 28 | 29 | proxyAngularJsSrv.prototype.getDownloadCompany = function (companyId,company) { 30 | window.location.href = 'Proxy/GetDownloadCompany'+ '?companyId='+companyId+'&'+jQuery.param(company) } 31 | 32 | proxyAngularJsSrv.prototype.getDownloadSimple = function (companyId,name) { 33 | window.location.href = 'Proxy/GetDownloadSimple'+ '?companyId='+companyId+'&name='+encodeURIComponent(name) } 34 | 35 | proxyAngularJsSrv.prototype.getDownloadNoParams = function () { 36 | window.location.href = 'Proxy/GetDownloadNoParams' } 37 | 38 | proxyAngularJsSrv.prototype.addJsEntryOnly = function (person) { 39 | return this.http.post('Proxy/AddJsEntryOnly',person).then(function (result) { 40 | return result.data; 41 | }); 42 | } 43 | 44 | proxyAngularJsSrv.prototype.addJsEntryAndName = function (person,name) { 45 | return this.http.post('Proxy/AddJsEntryAndName'+ '?name='+encodeURIComponent(name),person).then(function (result) { 46 | return result.data; 47 | }); 48 | } 49 | 50 | proxyAngularJsSrv.prototype.addJsEntryAndParams = function (person,name,vorname) { 51 | return this.http.post('Proxy/AddJsEntryAndParams'+ '?name='+encodeURIComponent(name)+'&vorname='+encodeURIComponent(vorname),person).then(function (result) { 52 | return result.data; 53 | }); 54 | } 55 | 56 | proxyAngularJsSrv.prototype.clearJsCall = function () { 57 | return this.http.get('Proxy/ClearJsCall').then(function (result) { 58 | return result.data; 59 | }); 60 | } 61 | 62 | proxyAngularJsSrv.prototype.loadJsCallById = function (id) { 63 | return this.http.get('Proxy/LoadJsCallById' + '/' + id).then(function (result) { 64 | return result.data; 65 | }); 66 | } 67 | 68 | proxyAngularJsSrv.prototype.loadJsCallByParams = function (name,vorname,alter) { 69 | return this.http.get('Proxy/LoadJsCallByParams'+ '?name='+encodeURIComponent(name)+'&vorname='+encodeURIComponent(vorname)+'&alter='+alter).then(function (result) { 70 | return result.data; 71 | }); 72 | } 73 | 74 | proxyAngularJsSrv.prototype.loadJsCallByParamsAndId = function (name,vorname,alter,id) { 75 | return this.http.get('Proxy/LoadJsCallByParamsAndId' + '/' + id+ '?name='+encodeURIComponent(name)+'&vorname='+encodeURIComponent(vorname)+'&alter='+alter).then(function (result) { 76 | return result.data; 77 | }); 78 | } 79 | 80 | proxyAngularJsSrv.prototype.loadJsCallByParamsWithEnum = function (name,vorname,alter,access) { 81 | return this.http.get('Proxy/LoadJsCallByParamsWithEnum'+ '?name='+encodeURIComponent(name)+'&vorname='+encodeURIComponent(vorname)+'&alter='+alter+'&access='+access).then(function (result) { 82 | return result.data; 83 | }); 84 | } 85 | 86 | 87 | angular.module('proxyAngularJsSrv', []) .service('proxyAngularJsSrv', ['$http', proxyAngularJsSrv]); 88 | 89 | --------------------------------------------------------------------------------