├── .gitattributes
├── .gitignore
├── .nuget
├── NuGet.Config
├── NuGet.exe
└── packages.config
├── License.txt
├── ODataConnectedService
├── .nuget
│ ├── NuGet.Config
│ ├── NuGet.exe
│ └── packages.config
├── ODataConnectedService.Tests.sln
├── ODataConnectedService.msbuild
├── ODataConnectedService.sln
├── build.cmd
├── external
│ └── Binaries
│ │ ├── V3
│ │ ├── Microsoft.Data.Edm.dll
│ │ ├── Microsoft.Data.OData.dll
│ │ ├── Microsoft.Data.Services.Client.dll
│ │ ├── Microsoft.Data.Services.Design.dll
│ │ └── System.Spatial.dll
│ │ └── V4
│ │ └── Microsoft.OData.Edm.dll
├── src
│ ├── CodeGeneration
│ │ ├── BaseCodeGenDescriptor.cs
│ │ ├── CodeGenDescriptorFactory.cs
│ │ ├── ICodeGenDescriptorFactory.cs
│ │ ├── V3CodeGenDescriptor.cs
│ │ └── V4CodeGenDescriptor.cs
│ ├── Common
│ │ ├── CodeGeneratorUtils.cs
│ │ ├── Constants.cs
│ │ ├── ProjectHelper.cs
│ │ └── UserSettingsPersistenceHelper.cs
│ ├── GlobalSuppressions.cs
│ ├── License.txt
│ ├── Models
│ │ ├── ServiceConfiguration.cs
│ │ └── UserSettings.cs
│ ├── ODataConnectedService.csproj
│ ├── ODataConnectedService.csproj.bak
│ ├── ODataConnectedServiceHandler.cs
│ ├── ODataConnectedServiceInstance.cs
│ ├── ODataConnectedServiceProvider.cs
│ ├── ODataConnectedServiceWizard.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── ExtensionIcon.png
│ │ └── Icon.png
│ ├── Templates
│ │ ├── IODataT4CodeGeneratorFactory.cs
│ │ ├── ODataT4CodeGenerator.cs
│ │ ├── ODataT4CodeGenerator.tt
│ │ ├── ODataT4CodeGenerator.ttinclude
│ │ └── ODataT4CodeGeneratorFactory.cs
│ ├── ViewModels
│ │ ├── AdvancedSettingsViewModel.cs
│ │ └── ConfigODataEndpointViewModel.cs
│ ├── Views
│ │ ├── AdvancedSettings.xaml
│ │ ├── AdvancedSettings.xaml.cs
│ │ ├── ConfigODataEndpoint.xaml
│ │ └── ConfigODataEndpoint.xaml.cs
│ ├── app.config
│ ├── packages.config
│ └── source.extension.vsixmanifest
├── test
│ └── ODataConnectedService.Tests
│ │ ├── 35MSSharedLib1024.snk
│ │ ├── CodeGenReferences
│ │ ├── EntitiesEnumsFunctions.cs
│ │ ├── EntitiesEnumsFunctions.xml
│ │ ├── EntitiesEnumsFunctionsDSC.cs
│ │ ├── EntitiesEnumsFunctionsDSCWithInternalTypes.cs
│ │ └── EntitiesEnumsFunctionsWithInternalTypes.cs
│ │ ├── CodeGeneration
│ │ └── V4CodeGenDescriptorTest.cs
│ │ ├── ODataConnectedService.Tests.csproj
│ │ ├── ODataConnectedServiceHandlerTest.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── Templates
│ │ └── ODataT4CodeGeneratorTest.cs
│ │ └── TestHelpers
│ │ ├── TestConnectedServiceHandlerContext.cs
│ │ └── TestConnectedServiceHandlerHelper.cs
└── tools
│ ├── 35MSSharedLib1024.snk
│ ├── ConnectedService.tasks.targets
│ ├── SkipStrongNames.xml
│ └── src
│ └── Microsoft.Web.FxCop
│ ├── DoNotCallProblematicMethodsOnTaskRule.cs
│ ├── DoNotConstructTaskInstancesRule.cs
│ ├── DoNotUseFinalizersRule.cs
│ ├── DoNotUseProblematicTaskTypesRule.cs
│ ├── IntrospectionRule.cs
│ ├── Microsoft.Web.FxCop.csproj
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── Rules.xml
│ ├── TypeNodeExtensions.cs
│ └── UnusedResourceUsageRule.cs
├── OpenApi
├── OData2OpenApi
│ ├── OData2OpenApi.sln
│ └── OData2OpenApi
│ │ ├── Abstracts
│ │ ├── ICommandOptionManager.cs
│ │ ├── IConvertSettingProvider.cs
│ │ └── IEdmModelProvider.cs
│ │ ├── App.config
│ │ ├── CommandLineParser.cs
│ │ ├── CommandOptionAttribute.cs
│ │ ├── CommandOptionManager.cs
│ │ ├── Configuration.cs
│ │ ├── ConvertSettingProvider.cs
│ │ ├── EdmModelProvider.cs
│ │ ├── OData2OpenApi.csproj
│ │ ├── OpenApiGenerator.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ └── packages.config
└── README.md
├── README.md
├── RestierScaffolding
├── Scaffolding.msbuild
├── Scaffolding.sln
├── ScaffoldingVSix.sln
├── build.cmd
├── src
│ ├── Microsoft.Restier.Scaffolding.Extension
│ │ ├── License.txt
│ │ ├── Microsoft.Restier.Scaffolding.Extension.csproj
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── source.extension.vsixmanifest
│ └── Microsoft.Restier.Scaffolding
│ │ ├── AssemblyVersions.cs
│ │ ├── CodeTypeExtension.cs
│ │ ├── CoreScaffoldingUtil.cs
│ │ ├── GlobalSuppressions.cs
│ │ ├── Interop
│ │ ├── IProjectItemSelector.cs
│ │ ├── IProjectItemSelector_Class.cs
│ │ └── ProjectItemSelectorFlags.cs
│ │ ├── Microsoft.Restier.Scaffolding.csproj
│ │ ├── MvcProjectUtil.cs
│ │ ├── NativeMethods.cs
│ │ ├── NuGetPackages.cs
│ │ ├── OleServiceProviderExtensions.cs
│ │ ├── PackageVersions.cs
│ │ ├── ProjectItemExtensions.cs
│ │ ├── ProjectReferences.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── ReadMe
│ │ └── ODataReadMe.cs
│ │ ├── ReferencePackages
│ │ ├── entityframework.6.1.1.nupkg
│ │ ├── microsoft.aspnet.odata.5.7.0.nupkg
│ │ ├── microsoft.aspnet.webapi.5.2.2.nupkg
│ │ ├── microsoft.aspnet.webapi.client.5.2.2.nupkg
│ │ ├── microsoft.aspnet.webapi.core.5.2.2.nupkg
│ │ ├── microsoft.aspnet.webapi.webhost.5.2.2.nupkg
│ │ ├── microsoft.odata.core.6.13.0.nupkg
│ │ ├── microsoft.odata.edm.6.13.0.nupkg
│ │ ├── microsoft.restier.0.4.0-rc.nupkg
│ │ ├── microsoft.restier.core.0.4.0-rc.nupkg
│ │ ├── microsoft.restier.entityframework.0.4.0-rc.nupkg
│ │ ├── microsoft.restier.webapi.0.4.0-rc.nupkg
│ │ ├── microsoft.spatial.6.13.0.nupkg
│ │ └── newtonsoft.json.6.0.4.nupkg
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Resources
│ │ └── _TemplateIconSample.ico
│ │ ├── SavedSettingsKeys.cs
│ │ ├── Scaffolders
│ │ ├── AddDependencyUtil.cs
│ │ ├── CodeTypeFilter.cs
│ │ ├── CommonFilenames.cs
│ │ ├── CommonFolderNames.cs
│ │ ├── ConfigScaffolder.cs
│ │ ├── ConfigScaffolderModel.cs
│ │ ├── ContextKeys.cs
│ │ ├── DependencyInstaller.cs
│ │ ├── FrameworkDependencyStatus.cs
│ │ ├── IFrameworkDependency.cs
│ │ ├── IScaffoldingSettings.cs
│ │ ├── InteractiveScaffolder.cs
│ │ ├── Restier
│ │ │ ├── ODataDependencyInstaller.cs
│ │ │ ├── ODataFrameworkDependency.cs
│ │ │ ├── RestierConfigScaffolder.cs
│ │ │ └── RestierConfigScaffolderFactory.cs
│ │ ├── ScaffolderFactory.cs
│ │ ├── ScaffolderFilter.cs
│ │ ├── ScaffolderModel.cs
│ │ ├── ScaffolderVersions.cs
│ │ ├── ScaffoldingGestures.cs
│ │ ├── TemplateSearchDirectories.cs
│ │ └── ValidationUril.cs
│ │ ├── SemanticVersionParser.cs
│ │ ├── ServiceProviderExtensions.cs
│ │ ├── Telemetry
│ │ ├── CodeGenerationContextExtensions.cs
│ │ ├── DependencyScaffolderOptions.cs
│ │ └── TelemetrySharedKeys.cs
│ │ ├── Templates
│ │ ├── PackageVersions5.2.2.xml
│ │ └── PackageVersions5.2.3.xml
│ │ ├── UI
│ │ ├── ApplicationResources.xaml
│ │ ├── ChangeCancelButtonControl.xaml
│ │ ├── ChangeCancelButtonControl.xaml.cs
│ │ ├── ConfigScaffolderDialog.xaml
│ │ ├── ConfigScaffolderDialog.xaml.cs
│ │ ├── ConfigScaffolderViewModel.cs
│ │ ├── ContextControl.xaml
│ │ ├── ContextControl.xaml.cs
│ │ ├── DataContextModelTypeComparer.cs
│ │ ├── DefaultDialogSize.cs
│ │ ├── FocusFirstElementBehavior.cs
│ │ ├── IDialogHost.cs
│ │ ├── IDialogSettings.cs
│ │ ├── InverseBooleanConverter.cs
│ │ ├── InverseBooleanToVisibilityConverter.cs
│ │ ├── ModelType.cs
│ │ ├── MultiAndBooleanConverter.cs
│ │ ├── NotifyPropertyChanged.cs
│ │ ├── ProjectItemSelector.cs
│ │ ├── RelayCommand.cs
│ │ ├── SelectOnFocusBehavior.cs
│ │ ├── StyleResources.xaml
│ │ ├── VSPlatformDialogWindow.cs
│ │ ├── ValidatingDialogWindow.cs
│ │ ├── ValidatingViewModel.cs
│ │ ├── ViewModel.cs
│ │ ├── WebApiConfigNameControl.xaml
│ │ ├── WebApiConfigNameControl.xaml.cs
│ │ └── WindowAutoSizeBehavior.cs
│ │ ├── Versions
│ │ └── VersionFileReader.cs
│ │ ├── VisualStudio
│ │ ├── EditorIntegration.cs
│ │ ├── IEditorIntegration.cs
│ │ ├── IEditorInterfaces.cs
│ │ ├── INuGetRepository.cs
│ │ ├── IProjectSettings.cs
│ │ ├── IVisualStudioIntegration.cs
│ │ ├── NuGetRepository.cs
│ │ ├── ProjectSettings.cs
│ │ ├── ProjectSettingsExtensions.cs
│ │ └── VisualStudioIntegration.cs
│ │ └── packages.config
└── tools
│ ├── 35MSSharedLib1024.snk
│ ├── NuGet
│ ├── NuGet.Config
│ └── NuGet.targets
│ ├── Scaffolding.settings.targets
│ ├── Scaffolding.tasks.targets
│ ├── SkipStrongNames.xml
│ └── src
│ └── Microsoft.Web.FxCop
│ ├── DoNotCallProblematicMethodsOnTaskRule.cs
│ ├── DoNotConstructTaskInstancesRule.cs
│ ├── DoNotUseFinalizersRule.cs
│ ├── DoNotUseProblematicTaskTypesRule.cs
│ ├── IntrospectionRule.cs
│ ├── Microsoft.Web.FxCop.csproj
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── Rules.xml
│ ├── TypeNodeExtensions.cs
│ └── UnusedResourceUsageRule.cs
├── WebAPIODataV4Scaffolding
├── Scaffolding.msbuild
├── Scaffolding.sln
├── ScaffoldingVSix.sln
├── build.cmd
├── packages
│ └── Microsoft.ApplicationInsights.1.0.1-beta
│ │ ├── Microsoft.ApplicationInsights.1.0.1-beta.nupkg
│ │ └── lib
│ │ ├── dnxcore50
│ │ ├── Microsoft.ApplicationInsights.XML
│ │ └── Microsoft.ApplicationInsights.dll
│ │ ├── net40
│ │ ├── Microsoft.ApplicationInsights.XML
│ │ └── Microsoft.ApplicationInsights.dll
│ │ ├── net45
│ │ ├── Microsoft.ApplicationInsights.XML
│ │ └── Microsoft.ApplicationInsights.dll
│ │ ├── portable-win81+wpa81
│ │ ├── Microsoft.ApplicationInsights.XML
│ │ └── Microsoft.ApplicationInsights.dll
│ │ └── wp8
│ │ ├── Microsoft.ApplicationInsights.XML
│ │ └── Microsoft.ApplicationInsights.dll
├── src
│ ├── System.Web.OData.Design.Scaffolding.Extension
│ │ ├── License.txt
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── System.Web.OData.Design.Scaffolding.Extension.csproj
│ │ └── source.extension.vsixmanifest
│ └── System.Web.OData.Design.Scaffolding
│ │ ├── AssemblyVersions.cs
│ │ ├── CoreScaffoldingUtil.cs
│ │ ├── GlobalSuppressions.cs
│ │ ├── Interop
│ │ ├── IProjectItemSelector.cs
│ │ ├── IProjectItemSelector_Class.cs
│ │ └── ProjectItemSelectorFlags.cs
│ │ ├── Metadata
│ │ ├── CodeModelModelMetadata.cs
│ │ ├── CodeModelPropertyMetadata.cs
│ │ └── TypeNames.cs
│ │ ├── MvcProjectUtil.cs
│ │ ├── NativeMethods.cs
│ │ ├── NuGetPackages.cs
│ │ ├── OleServiceProviderExtensions.cs
│ │ ├── PackageVersions.cs
│ │ ├── ProjectItemExtensions.cs
│ │ ├── ProjectReferences.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── ReadMe
│ │ └── ODataReadMe.cs
│ │ ├── ReferencePackages
│ │ ├── Microsoft.AspNet.OData.5.2.1.nupkg
│ │ ├── Microsoft.AspNet.OData.5.5.1.nupkg
│ │ ├── Microsoft.AspNet.WebApi.5.2.2.nupkg
│ │ ├── Microsoft.AspNet.WebApi.Client.5.2.0.nupkg
│ │ ├── Microsoft.AspNet.WebApi.Client.5.2.2.nupkg
│ │ ├── Microsoft.AspNet.WebApi.Core.5.2.0.nupkg
│ │ ├── Microsoft.AspNet.WebApi.Core.5.2.2.nupkg
│ │ ├── Microsoft.AspNet.WebApi.WebHost.5.2.2.nupkg
│ │ ├── Microsoft.OData.Core.6.10.0.nupkg
│ │ ├── Microsoft.OData.Core.6.4.0.nupkg
│ │ ├── Microsoft.OData.Edm.6.10.0.nupkg
│ │ ├── Microsoft.OData.Edm.6.4.0.nupkg
│ │ ├── Microsoft.Spatial.6.10.0.nupkg
│ │ ├── Microsoft.Spatial.6.4.0.nupkg
│ │ ├── Newtonsoft.Json.4.5.11.nupkg
│ │ └── Newtonsoft.Json.6.0.4.nupkg
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Resources
│ │ └── _TemplateIconSample.ico
│ │ ├── SavedSettingsKeys.cs
│ │ ├── ScaffolderVersions.cs
│ │ ├── Scaffolders
│ │ ├── AddDependencyUtil.cs
│ │ ├── CodeTypeFilter.cs
│ │ ├── CommonFilenames.cs
│ │ ├── CommonFolderNames.cs
│ │ ├── ContextKeys.cs
│ │ ├── ControllerScaffolder.cs
│ │ ├── ControllerScaffolderModel.cs
│ │ ├── ControllerWithContextScaffolder.cs
│ │ ├── DependencyInstaller.cs
│ │ ├── FrameworkDependencyStatus.cs
│ │ ├── IFrameworkDependency.cs
│ │ ├── IScaffoldingSettings.cs
│ │ ├── InteractiveScaffolder.cs
│ │ ├── MvcViewScaffolderModel.cs
│ │ ├── OData
│ │ │ ├── ODataControllerWithActionsScaffolder.cs
│ │ │ ├── ODataControllerWithActionsScaffolderFactory.cs
│ │ │ ├── ODataControllerWithContextScaffolder.cs
│ │ │ ├── ODataControllerWithContextScaffolderFactory.cs
│ │ │ ├── ODataDependencyInstaller.cs
│ │ │ └── ODataFrameworkDependency.cs
│ │ ├── OverpostingProtection.cs
│ │ ├── ScaffolderFactory.cs
│ │ ├── ScaffolderFilter.cs
│ │ ├── ScaffolderModel.cs
│ │ ├── ScaffoldingGestures.cs
│ │ ├── StringUtil.cs
│ │ ├── TelemetryEventNames.cs
│ │ ├── TemplateSearchDirectories.cs
│ │ ├── ValidationUril.cs
│ │ └── ViewTemplate.cs
│ │ ├── SemanticVersionParser.cs
│ │ ├── ServiceProviderExtensions.cs
│ │ ├── System.Web.OData.Design.Scaffolding.csproj
│ │ ├── Telemetry
│ │ ├── CodeGenerationContextExtensions.cs
│ │ ├── DependencyScaffolderOptions.cs
│ │ ├── ScaffoldingTelemetry.cs
│ │ ├── TelemetrySharedKeys.cs
│ │ └── WebApiControllerScaffolderOptions.cs
│ │ ├── Templates
│ │ ├── ODataControllerWithActions
│ │ │ └── Controller.cs.t4
│ │ ├── ODataControllerWithContext
│ │ │ └── Controller.cs.t4
│ │ ├── PackageVersions5.2.0.xml
│ │ ├── PackageVersions5.2.2.xml
│ │ └── PackageVersions5.2.3.xml
│ │ ├── UI
│ │ ├── AddCancelButtonControl.xaml
│ │ ├── AddCancelButtonControl.xaml.cs
│ │ ├── ApplicationResources.xaml
│ │ ├── ControllerNameControl.xaml
│ │ ├── ControllerNameControl.xaml.cs
│ │ ├── ControllerScaffolderDialog.xaml
│ │ ├── ControllerScaffolderDialog.xaml.cs
│ │ ├── ControllerScaffolderViewModel.cs
│ │ ├── ControllerWithContextControl.xaml
│ │ ├── ControllerWithContextControl.xaml.cs
│ │ ├── CreateDataContextDialog.xaml
│ │ ├── CreateDataContextDialog.xaml.cs
│ │ ├── DataContextModelTypeComparer.cs
│ │ ├── DataContextViewModel.cs
│ │ ├── DefaultDialogSize.cs
│ │ ├── FocusFirstElementBehavior.cs
│ │ ├── IDialogHost.cs
│ │ ├── IDialogSettings.cs
│ │ ├── InverseBooleanConverter.cs
│ │ ├── InverseBooleanToVisibilityConverter.cs
│ │ ├── ModelType.cs
│ │ ├── MultiAndBooleanConverter.cs
│ │ ├── NotifyPropertyChanged.cs
│ │ ├── ProjectItemSelector.cs
│ │ ├── RelayCommand.cs
│ │ ├── SelectOnFocusBehavior.cs
│ │ ├── StyleResources.xaml
│ │ ├── VSPlatformDialogWindow.cs
│ │ ├── ValidatingDialogWindow.cs
│ │ ├── ValidatingViewModel.cs
│ │ ├── ViewModel.cs
│ │ └── WindowAutoSizeBehavior.cs
│ │ ├── Versions
│ │ └── VersionFileReader.cs
│ │ ├── VisualStudio
│ │ ├── EditorIntegration.cs
│ │ ├── IEditorIntegration.cs
│ │ ├── IEditorInterfaces.cs
│ │ ├── INuGetRepository.cs
│ │ ├── IProjectSettings.cs
│ │ ├── IVisualStudioIntegration.cs
│ │ ├── NuGetRepository.cs
│ │ ├── ProjectSettings.cs
│ │ ├── ProjectSettingsExtensions.cs
│ │ └── VisualStudioIntegration.cs
│ │ └── packages.config
└── tools
│ ├── 35MSSharedLib1024.snk
│ ├── NuGet
│ ├── NuGet.Config
│ └── NuGet.targets
│ ├── Scaffolding.settings.targets
│ ├── Scaffolding.tasks.targets
│ ├── SkipStrongNames.xml
│ └── src
│ └── Microsoft.Web.FxCop
│ ├── DoNotCallProblematicMethodsOnTaskRule.cs
│ ├── DoNotConstructTaskInstancesRule.cs
│ ├── DoNotUseFinalizersRule.cs
│ ├── DoNotUseProblematicTaskTypesRule.cs
│ ├── IntrospectionRule.cs
│ ├── Microsoft.Web.FxCop.csproj
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── Rules.xml
│ ├── TypeNodeExtensions.cs
│ └── UnusedResourceUsageRule.cs
├── azure-pipelines.yml
└── odata2swagger
├── OData2Swagger.csproj
├── OData2Swagger.sln
├── Program.cs
├── app.config
└── packages.config
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text
2 |
3 | *.bmp binary
4 | *.dll binary
5 | *.gif binary
6 | *.jpg binary
7 | *.png binary
8 | *.snk binary
9 | *.mdf binary
10 | *.ldf binary
11 | *.sql binary
12 | *.nupkg binary
13 | *.exe binary
14 |
15 | *.ascx text
16 | *.cd text
17 | *.cmd text
18 | *.coffee text
19 | *.config text
20 | *.cs text diff=csharp
21 | *.csproj text merge=union
22 | *.cshtml text
23 | *.css text
24 | *.dtd text
25 | *.edmx text
26 | *.htm text
27 | *.html text
28 | *.js text
29 | *.json text
30 | *.msbuild text
31 | *.nuspec text
32 | *.resx text
33 | *.ruleset text
34 | *.StyleCop text
35 | *.targets text
36 | *.tt text
37 | *.txt text
38 | *.vb text
39 | *.vbhtml text
40 | *.vbproj text merge=union
41 | *.vbs text
42 | *.wsf text
43 | *.xml text
44 | *.xunit text
45 |
46 | *.sln text eol=crlf merge=union
47 |
--------------------------------------------------------------------------------
/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.nuget/NuGet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/.nuget/NuGet.exe
--------------------------------------------------------------------------------
/.nuget/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/License.txt:
--------------------------------------------------------------------------------
1 | odata-lab
2 | Copyright (c) Microsoft Corporation
3 | All rights reserved.
4 | MIT License
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 |
24 |
--------------------------------------------------------------------------------
/ODataConnectedService/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/ODataConnectedService/.nuget/NuGet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/ODataConnectedService/.nuget/NuGet.exe
--------------------------------------------------------------------------------
/ODataConnectedService/.nuget/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ODataConnectedService/ODataConnectedService.Tests.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29613.14
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ODataConnectedService", "src\ODataConnectedService.csproj", "{A8BC5B8E-9AB7-4257-B8F1-E7C62169F9B5}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ODataConnectedService.Tests", "test\ODataConnectedService.Tests\ODataConnectedService.Tests.csproj", "{903B31D0-BE14-4D9E-BA76-186FA82B3A37}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {A8BC5B8E-9AB7-4257-B8F1-E7C62169F9B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {A8BC5B8E-9AB7-4257-B8F1-E7C62169F9B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {A8BC5B8E-9AB7-4257-B8F1-E7C62169F9B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {A8BC5B8E-9AB7-4257-B8F1-E7C62169F9B5}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {903B31D0-BE14-4D9E-BA76-186FA82B3A37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {903B31D0-BE14-4D9E-BA76-186FA82B3A37}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {903B31D0-BE14-4D9E-BA76-186FA82B3A37}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {903B31D0-BE14-4D9E-BA76-186FA82B3A37}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {FD696714-8F52-4A00-93F4-43C843F184DB}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/ODataConnectedService/ODataConnectedService.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26730.10
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ODataConnectedService", "src\ODataConnectedService.csproj", "{A8BC5B8E-9AB7-4257-B8F1-E7C62169F9B5}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {A8BC5B8E-9AB7-4257-B8F1-E7C62169F9B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {A8BC5B8E-9AB7-4257-B8F1-E7C62169F9B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {A8BC5B8E-9AB7-4257-B8F1-E7C62169F9B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {A8BC5B8E-9AB7-4257-B8F1-E7C62169F9B5}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {41B2D57F-50D1-4ADE-838D-F2CC7C0F6958}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/ODataConnectedService/build.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | pushd %~dp0
3 | setlocal
4 |
5 | if exist bin goto Build
6 | mkdir bin
7 |
8 | :Build
9 |
10 | REM Find one of the Visual Studio 2017 installations.
11 | REM Also handle x86 operating systems, where %ProgramFiles(x86)% is not defined. Always quote the
12 | REM %MSBuild% value when setting the variable and never quote %MSBuild% references.
13 | set MSBuild="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe"
14 | if not exist %MSBuild% @set MSBuild="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe"
15 | if not exist %MSBuild% @set MSBuild="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"
16 |
17 | if "%1" == "" goto BuildDefaults
18 |
19 | %MSBuild% ODataConnectedService.msbuild /m /nr:false /t:%* /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
20 | if %ERRORLEVEL% neq 0 goto BuildFail
21 | goto BuildSuccess
22 |
23 | :BuildDefaults
24 | %MSBuild% ODataConnectedService.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
25 | if %ERRORLEVEL% neq 0 goto BuildFail
26 | goto BuildSuccess
27 |
28 | :BuildFail
29 | echo.
30 | echo *** BUILD FAILED ***
31 | goto End
32 |
33 | :BuildSuccess
34 | echo.
35 | echo **** BUILD SUCCESSFUL ***
36 | goto End
37 |
38 | :End
39 | popd
40 | endlocal
41 |
--------------------------------------------------------------------------------
/ODataConnectedService/external/Binaries/V3/Microsoft.Data.Edm.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/ODataConnectedService/external/Binaries/V3/Microsoft.Data.Edm.dll
--------------------------------------------------------------------------------
/ODataConnectedService/external/Binaries/V3/Microsoft.Data.OData.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/ODataConnectedService/external/Binaries/V3/Microsoft.Data.OData.dll
--------------------------------------------------------------------------------
/ODataConnectedService/external/Binaries/V3/Microsoft.Data.Services.Client.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/ODataConnectedService/external/Binaries/V3/Microsoft.Data.Services.Client.dll
--------------------------------------------------------------------------------
/ODataConnectedService/external/Binaries/V3/Microsoft.Data.Services.Design.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/ODataConnectedService/external/Binaries/V3/Microsoft.Data.Services.Design.dll
--------------------------------------------------------------------------------
/ODataConnectedService/external/Binaries/V3/System.Spatial.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/ODataConnectedService/external/Binaries/V3/System.Spatial.dll
--------------------------------------------------------------------------------
/ODataConnectedService/external/Binaries/V4/Microsoft.OData.Edm.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/ODataConnectedService/external/Binaries/V4/Microsoft.OData.Edm.dll
--------------------------------------------------------------------------------
/ODataConnectedService/src/CodeGeneration/CodeGenDescriptorFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System;
5 | using System.Globalization;
6 | using EnvDTE;
7 | using Microsoft.VisualStudio.ConnectedServices;
8 | using Microsoft.OData.ConnectedService.Templates;
9 |
10 | namespace Microsoft.OData.ConnectedService.CodeGeneration
11 | {
12 | class CodeGenDescriptorFactory: ICodeGenDescriptorFactory
13 | {
14 | public BaseCodeGenDescriptor Create(Version edmxVersion, string metadataUri, ConnectedServiceHandlerContext context, Project project)
15 | {
16 | if (edmxVersion == Common.Constants.EdmxVersion1
17 | || edmxVersion == Common.Constants.EdmxVersion2
18 | || edmxVersion == Common.Constants.EdmxVersion3)
19 | {
20 | return CreateV3CodeGenDescriptor(metadataUri, context, project);
21 | }
22 | else if (edmxVersion == Common.Constants.EdmxVersion4)
23 | {
24 | return CreateV4CodeGenDescriptor(metadataUri, context, project);
25 | }
26 | throw new Exception(string.Format(CultureInfo.InvariantCulture, "Not supported Edmx Version {0}", edmxVersion.ToString()));
27 | }
28 |
29 | protected virtual BaseCodeGenDescriptor CreateV3CodeGenDescriptor(string metadataUri, ConnectedServiceHandlerContext context, Project project)
30 | {
31 | return new V3CodeGenDescriptor(metadataUri, context, project);
32 | }
33 |
34 | protected virtual BaseCodeGenDescriptor CreateV4CodeGenDescriptor(string metadataUri, ConnectedServiceHandlerContext context, Project project)
35 | {
36 | return new V4CodeGenDescriptor(metadataUri, context, project, new ODataT4CodeGeneratorFactory());
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/ODataConnectedService/src/CodeGeneration/ICodeGenDescriptorFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System;
5 | using EnvDTE;
6 | using Microsoft.VisualStudio.ConnectedServices;
7 |
8 | namespace Microsoft.OData.ConnectedService.CodeGeneration
9 | {
10 | interface ICodeGenDescriptorFactory
11 | {
12 | BaseCodeGenDescriptor Create(Version edmxVersion, string metadataUri, ConnectedServiceHandlerContext context, Project project);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ODataConnectedService/src/Common/CodeGeneratorUtils.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System;
5 | using Microsoft.Win32;
6 |
7 | namespace Microsoft.OData.ConnectedService.Common
8 | {
9 | internal static class CodeGeneratorUtils
10 | {
11 | public const string InstallLocationSubKeyName = "InstallLocation";
12 |
13 | ///
14 | /// Try to get the location of the installed WCF Data Service.
15 | ///
16 | /// Returns the location of the installed WCF Data Service if it exists, else returns empty string.
17 | public static string GetWCFDSInstallLocation()
18 | {
19 | string dataFxRegistryPath = 8 == IntPtr.Size
20 | ? @"SOFTWARE\Wow6432Node\Microsoft\Microsoft WCF Data Services\VS 2014 Tooling\"
21 | : @"SOFTWARE\Microsoft\Microsoft WCF Data Services\VS 2014 Tooling\";
22 | using (RegistryKey dataFxKey = Registry.LocalMachine.OpenSubKey(dataFxRegistryPath))
23 | {
24 | if (dataFxKey != null)
25 | {
26 | string runtimePath = (string)dataFxKey.GetValue(InstallLocationSubKeyName);
27 | if (!string.IsNullOrEmpty(runtimePath))
28 | {
29 | return runtimePath;
30 | }
31 | }
32 | }
33 |
34 | return String.Empty;
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/ODataConnectedService/src/Common/ProjectHelper.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System;
5 | using EnvDTE;
6 | using Microsoft.VisualStudio.Shell.Interop;
7 |
8 | namespace Microsoft.OData.ConnectedService.Common
9 | {
10 | ///
11 | /// A utility class for working with VS projects (e.g. retrieving settings from).
12 | ///
13 | internal static class ProjectHelper
14 | {
15 | public const uint VSConstants_VSITEMID_ROOT = 4294967294;
16 | public const int __VSHPROPID_VSHPROPID_ExtObject = -2027;
17 | public const int VSConstans_S_OK = 0;
18 |
19 | public static Project GetProjectFromHierarchy(IVsHierarchy projectHierarchy)
20 | {
21 | object projectObject;
22 | int result = projectHierarchy.GetProperty(
23 | VSConstants_VSITEMID_ROOT /* VSConstants.VSITEMID_ROOT */,
24 | __VSHPROPID_VSHPROPID_ExtObject /* (int)__VSHPROPID.VSHPROPID_ExtObject */,
25 | out projectObject);
26 | if (result != VSConstans_S_OK)
27 | {
28 | throw new InvalidOperationException("Cannot find the project from VsHierarchy");
29 | }
30 |
31 | return (Project)projectObject;
32 | }
33 |
34 | public static string GetProjectFullPath(Project project)
35 | {
36 | return project.Properties.Item("FullPath").Value.ToString();
37 | }
38 | }
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/ODataConnectedService/src/License.txt:
--------------------------------------------------------------------------------
1 | OData Connected Service ver. 0.3.0
2 |
3 | Copyright (c) Microsoft Corporation
4 |
5 | All rights reserved.
6 |
7 | MIT License
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/ODataConnectedService/src/Models/ServiceConfiguration.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System;
5 |
6 | namespace Microsoft.OData.ConnectedService.Models
7 | {
8 | internal class ServiceConfiguration
9 | {
10 | public string ServiceName { get; set; }
11 | public string Endpoint { get; set; }
12 | public Version EdmxVersion { get; set; }
13 | public string GeneratedFileNamePrefix { get; set; }
14 | public bool UseNameSpacePrefix { get; set; }
15 | public string NamespacePrefix { get; set; }
16 | public bool UseDataServiceCollection { get; set; }
17 | public bool MakeTypesInternal { get; set; }
18 | }
19 |
20 | internal class ServiceConfigurationV4 : ServiceConfiguration
21 | {
22 | public bool EnableNamingAlias { get; set; }
23 | public bool IgnoreUnexpectedElementsAndAttributes { get; set; }
24 | public bool IncludeT4File { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ODataConnectedService/src/ODataConnectedServiceInstance.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using Microsoft.OData.ConnectedService.Models;
5 | using Microsoft.VisualStudio.ConnectedServices;
6 |
7 | namespace Microsoft.OData.ConnectedService
8 | {
9 | internal class ODataConnectedServiceInstance : ConnectedServiceInstance
10 | {
11 | public ServiceConfiguration ServiceConfig { get; set; }
12 | public string MetadataTempFilePath { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ODataConnectedService/src/ODataConnectedServiceProvider.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Threading.Tasks;
7 | using System.Windows.Media.Imaging;
8 | using Microsoft.OData.ConnectedService.Common;
9 | using Microsoft.VisualStudio.ConnectedServices;
10 |
11 | namespace Microsoft.OData.ConnectedService
12 | {
13 | [ConnectedServiceProviderExport(Constants.ProviderId, SupportsUpdate = true)]
14 | internal class ODataConnectedServiceProvider : ConnectedServiceProvider
15 | {
16 | public ODataConnectedServiceProvider()
17 | {
18 | Name = "OData Connected Service";
19 | Category = "OData";
20 | Description = "OData Connected Service for V1-V4";
21 | Icon = new BitmapImage(new Uri("pack://application:,,/" + this.GetType().Assembly.ToString() + ";component/Resources/Icon.png"));
22 | CreatedBy = "OData";
23 | Version = new Version(0, 4, 0);
24 | MoreInfoUri = new Uri("https://github.com/odata/lab");
25 | }
26 |
27 | public override Task CreateConfiguratorAsync(ConnectedServiceProviderContext context)
28 | {
29 | var wizard = new ODataConnectedServiceWizard(context);
30 | return Task.FromResult(wizard);
31 | }
32 |
33 | public override IEnumerable> GetSupportedTechnologyLinks()
34 | {
35 | yield return new Tuple("OData Website", new Uri("http://www.odata.org/"));
36 | yield return new Tuple("OData Docs and Samples", new Uri("http://odata.github.io/odata.net/"));
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/ODataConnectedService/src/Resources/ExtensionIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/ODataConnectedService/src/Resources/ExtensionIcon.png
--------------------------------------------------------------------------------
/ODataConnectedService/src/Resources/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/ODataConnectedService/src/Resources/Icon.png
--------------------------------------------------------------------------------
/ODataConnectedService/src/Templates/IODataT4CodeGeneratorFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.OData.ConnectedService.Templates
5 | {
6 | interface IODataT4CodeGeneratorFactory
7 | {
8 | ODataT4CodeGenerator Create();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ODataConnectedService/src/Templates/ODataT4CodeGeneratorFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.OData.ConnectedService.Templates
5 | {
6 | class ODataT4CodeGeneratorFactory: IODataT4CodeGeneratorFactory
7 | {
8 | public ODataT4CodeGenerator Create()
9 | {
10 | return new ODataT4CodeGenerator();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ODataConnectedService/src/Views/AdvancedSettings.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using Microsoft.OData.ConnectedService.ViewModels;
7 |
8 | namespace Microsoft.OData.ConnectedService.Views
9 | {
10 | ///
11 | /// Interaction logic for AdvancedSettings.xaml
12 | ///
13 | public partial class AdvancedSettings : UserControl
14 | {
15 | public AdvancedSettings()
16 | {
17 | InitializeComponent();
18 | this.AdvancedSettingsPanel.Visibility = Visibility.Hidden;
19 | }
20 |
21 | internal ODataConnectedServiceWizard ODataConnectedServiceWizard
22 | {
23 | get { return ((AdvancedSettingsViewModel)this.DataContext).Wizard as ODataConnectedServiceWizard; }
24 | }
25 |
26 | private void settings_Click(object sender, RoutedEventArgs e)
27 | {
28 | this.SettingsPanel.Visibility = Visibility.Hidden;
29 |
30 | this.AdvancedSettingsPanel.Margin = new Thickness(10, -125, 0, 0);
31 | this.AdvancedSettingsPanel.Visibility = Visibility.Visible;
32 |
33 | this.AdvancedSettingsForv4.Visibility = this.ODataConnectedServiceWizard.EdmxVersion == Common.Constants.EdmxVersion4
34 | ? Visibility.Visible : Visibility.Hidden;
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/ODataConnectedService/src/Views/ConfigODataEndpoint.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
17 |
18 |
20 |
22 |
23 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/ODataConnectedService/src/Views/ConfigODataEndpoint.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System.Windows;
5 | using System.Windows.Controls;
6 |
7 | namespace Microsoft.OData.ConnectedService.Views
8 | {
9 | ///
10 | /// Interaction logic for ConfigODataEndpoint.xaml
11 | ///
12 | public partial class ConfigODataEndpoint : UserControl
13 | {
14 | public ConfigODataEndpoint()
15 | {
16 | InitializeComponent();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/ODataConnectedService/src/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/ODataConnectedService/src/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Microsoft
6 | OData Connected Service
7 | OData Connected Service for V1-V4
8 | https://github.com/odata/lab
9 | License.txt
10 | Resources\ExtensionIcon.png
11 | OData Connected Service
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ODataConnectedService/test/ODataConnectedService.Tests/35MSSharedLib1024.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/ODataConnectedService/test/ODataConnectedService.Tests/35MSSharedLib1024.snk
--------------------------------------------------------------------------------
/ODataConnectedService/test/ODataConnectedService.Tests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("ODataConnectedService.Tests")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("")]
9 | [assembly: AssemblyProduct("ODataConnectedService.Tests")]
10 | [assembly: AssemblyCopyright("Copyright © 2020")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 |
14 | [assembly: ComVisible(false)]
15 |
16 | [assembly: Guid("903b31d0-be14-4d9e-ba76-186fa82b3a37")]
17 |
18 | // [assembly: AssemblyVersion("1.0.*")]
19 | [assembly: AssemblyVersion("1.0.0.0")]
20 | [assembly: AssemblyFileVersion("1.0.0.0")]
21 |
--------------------------------------------------------------------------------
/ODataConnectedService/test/ODataConnectedService.Tests/TestHelpers/TestConnectedServiceHandlerHelper.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System.Collections.Generic;
5 | using System.Threading.Tasks;
6 | using Microsoft.VisualStudio.ConnectedServices;
7 |
8 | namespace Microsoft.OData.ConnectedService.Tests.TestHelpers
9 | {
10 | class TestConnectedServiceHandlerHelper : ConnectedServiceHandlerHelper
11 | {
12 | // used to access the temp file that the generated code was written to
13 | public string AddedFileInputFileName { get; private set; }
14 | // used to find out which file the final output would be written to
15 | public string AddedFileTargetFilePath { get; private set; }
16 | public string ServicesRootFolder { get; set; }
17 | public override Task AddFileAsync(string fileName, string targetPath, AddFileOptions addFileOptions = null)
18 | {
19 | AddedFileInputFileName = fileName;
20 | AddedFileTargetFilePath = targetPath;
21 | return Task.FromResult(string.Empty);
22 | }
23 | public override IDictionary TokenReplacementValues { get; }
24 | public override void AddAssemblyReference(string assemblyPath) =>
25 | throw new System.NotImplementedException();
26 | public override string GetServiceArtifactsRootFolder() => ServicesRootFolder;
27 | public override string PerformTokenReplacement(string input, IDictionary additionalReplacementValues = null) =>
28 | throw new System.NotImplementedException();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ODataConnectedService/tools/35MSSharedLib1024.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/ODataConnectedService/tools/35MSSharedLib1024.snk
--------------------------------------------------------------------------------
/ODataConnectedService/tools/SkipStrongNames.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ODataConnectedService/tools/src/Microsoft.Web.FxCop/DoNotConstructTaskInstancesRule.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using Microsoft.FxCop.Sdk;
5 |
6 | namespace Microsoft.Web.FxCop
7 | {
8 | public class DoNotConstructTaskInstancesRule : IntrospectionRule
9 | {
10 | public DoNotConstructTaskInstancesRule()
11 | : base("DoNotConstructTaskInstances")
12 | {
13 | }
14 |
15 | public override ProblemCollection Check(Member member)
16 | {
17 | var method = member as Method;
18 | if (method != null)
19 | {
20 | VisitStatements(method.Body.Statements);
21 | }
22 |
23 | return Problems;
24 | }
25 |
26 | public override void VisitConstruct(Construct construct)
27 | {
28 | var memberBinding = construct.Constructor as MemberBinding;
29 |
30 | if (memberBinding != null
31 | && memberBinding.BoundMember.Name.Name == ".ctor"
32 | && memberBinding.BoundMember.DeclaringType.IsTask())
33 | {
34 | Problems.Add(new Problem(GetResolution(), construct.UniqueKey.ToString()));
35 | }
36 |
37 | base.VisitConstruct(construct);
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/ODataConnectedService/tools/src/Microsoft.Web.FxCop/DoNotUseFinalizersRule.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using Microsoft.FxCop.Sdk;
5 |
6 | namespace Microsoft.Web.FxCop
7 | {
8 | public class DoNotUseFinalizersRule : IntrospectionRule
9 | {
10 | public DoNotUseFinalizersRule()
11 | : base("DoNotUseFinalizers")
12 | {
13 | }
14 |
15 | public override ProblemCollection Check(Member member)
16 | {
17 | if (member.NodeType == NodeType.Method && member.Name.Name == "Finalize")
18 | {
19 | Problems.Add(new Problem(GetResolution(member.DeclaringType.FullName), member));
20 | }
21 |
22 | return Problems;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ODataConnectedService/tools/src/Microsoft.Web.FxCop/IntrospectionRule.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using Microsoft.FxCop.Sdk;
5 |
6 | namespace Microsoft.Web.FxCop
7 | {
8 | public abstract class IntrospectionRule : BaseIntrospectionRule
9 | {
10 | protected IntrospectionRule(string name)
11 | : base(name, "Microsoft.Web.FxCop.Rules", typeof(IntrospectionRule).Assembly)
12 | {
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ODataConnectedService/tools/src/Microsoft.Web.FxCop/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System.Reflection;
5 |
6 | [assembly: AssemblyProduct("Microsoft.Web.FxCop")]
7 | [assembly: AssemblyDescription("FxCop rules used by the RESTier projects")]
8 | [assembly: AssemblyCompany("Microsoft")]
9 | [assembly: AssemblyCopyright("Copyright © Microsoft Corporation 2014")]
--------------------------------------------------------------------------------
/OpenApi/OData2OpenApi/OData2OpenApi.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2042
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OData2OpenApi", "OData2OpenApi\OData2OpenApi.csproj", "{66AB1E32-735B-44D4-9944-93D3D1ED1A2F}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {66AB1E32-735B-44D4-9944-93D3D1ED1A2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {66AB1E32-735B-44D4-9944-93D3D1ED1A2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {66AB1E32-735B-44D4-9944-93D3D1ED1A2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {66AB1E32-735B-44D4-9944-93D3D1ED1A2F}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {726EFC65-7FD4-41B6-AB9B-E95BA6F834A2}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/OpenApi/OData2OpenApi/OData2OpenApi/Abstracts/ICommandOptionManager.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System.Collections.Generic;
5 | using System.Reflection;
6 |
7 | namespace Microsoft.OData2OpenApi.ConsoleApp.Abstracts
8 | {
9 | ///
10 | /// Interfaced for the command option.
11 | ///
12 | public interface ICommandOptionManager
13 | {
14 | ///
15 | /// List all the options.
16 | ///
17 | /// The options.
18 | IEnumerable ListOptions();
19 |
20 | ///
21 | /// Get the options property.
22 | ///
23 | /// The option key.
24 | /// The option property info.
25 | PropertyInfo GetOption(string key);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/OpenApi/OData2OpenApi/OData2OpenApi/Abstracts/IConvertSettingProvider.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using Microsoft.OpenApi.OData;
5 |
6 | namespace Microsoft.OData2OpenApi.ConsoleApp.Abstracts
7 | {
8 | ///
9 | /// Interface to .
10 | ///
11 | public interface IConvertSettingsProvider
12 | {
13 | ///
14 | /// Gets the .
15 | ///
16 | /// The settings.
17 | OpenApiConvertSettings GetConvertSettings();
18 | }
19 | }
--------------------------------------------------------------------------------
/OpenApi/OData2OpenApi/OData2OpenApi/Abstracts/IEdmModelProvider.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using Microsoft.OData.Edm;
5 |
6 | namespace Microsoft.OData2OpenApi.ConsoleApp.Abstracts
7 | {
8 | ///
9 | /// Interface to provide the
10 | ///
11 | public interface IEdmModelProvider
12 | {
13 | ///
14 | /// Gets the .
15 | ///
16 | /// The Edm model.
17 | IEdmModel GetEdmModel();
18 | }
19 | }
--------------------------------------------------------------------------------
/OpenApi/OData2OpenApi/OData2OpenApi/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/OpenApi/OData2OpenApi/OData2OpenApi/CommandOptionAttribute.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System;
5 |
6 | namespace Microsoft.OData2OpenApi.ConsoleApp
7 | {
8 | ///
9 | /// Command option attribute.
10 | ///
11 | [AttributeUsage(AttributeTargets.Property)]
12 | public class CommandOptionAttribute : Attribute
13 | {
14 | ///
15 | /// Initializes a new instance of the class.
16 | ///
17 | /// The command option.
18 | public CommandOptionAttribute(string command)
19 | {
20 | if (String.IsNullOrWhiteSpace(command))
21 | {
22 | throw new ArgumentNullException(nameof(command));
23 | }
24 |
25 | if (!command.StartsWith("--"))
26 | {
27 | throw new ArgumentException($"Invalid input argument {command}, argument should start '--'.");
28 | }
29 |
30 | string[] pieces = command.Split('=');
31 | if (pieces.Length != 2)
32 | {
33 | throw new ArgumentException($"Invalid input argument {command}, argument should like '--key=value'.");
34 | }
35 |
36 | Raw = command;
37 | Key = pieces[0].ToLower();
38 | Description = pieces[1];
39 | }
40 |
41 | ///
42 | /// Gets the option key name.
43 | ///
44 | public string Key { get; }
45 |
46 | ///
47 | /// Gets the option description name.
48 | ///
49 | public string Description { get; }
50 |
51 | ///
52 | /// Gets the raw command option string.
53 | ///
54 | public string Raw { get; }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/OpenApi/OData2OpenApi/OData2OpenApi/ConvertSettingProvider.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using Microsoft.OData2OpenApi.ConsoleApp.Abstracts;
5 | using Microsoft.OpenApi.OData;
6 |
7 | namespace Microsoft.OData2OpenApi.ConsoleApp
8 | {
9 | internal class ConvertSettingsProvider : IConvertSettingsProvider
10 | {
11 | private Configuration Config { get; }
12 |
13 | public ConvertSettingsProvider(Configuration config)
14 | {
15 | Config = config;
16 | }
17 |
18 | public virtual OpenApiConvertSettings GetConvertSettings()
19 | {
20 | var settings = new OpenApiConvertSettings();
21 |
22 | settings.EnableKeyAsSegment = Config.KeyAsSegment;
23 | settings.EnableNavigationPropertyPath = Config.NavigationPropertyPath;
24 | settings.EnableOperationPath = Config.OperationPath;
25 | settings.EnableOperationId = Config.OperationId;
26 | settings.PrefixEntityTypeNameBeforeKey = Config.PrefixTypeBeforeKey;
27 | settings.EnableOperationImportPath = Config.OperationImportPath;
28 | settings.EnableUnqualifiedCall = Config.UnqualifiedCall;
29 |
30 | return settings;
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/OpenApi/OData2OpenApi/OData2OpenApi/EdmModelProvider.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System;
5 | using System.IO;
6 | using System.Net;
7 | using System.Text;
8 | using System.Xml.Linq;
9 | using Microsoft.OData.Edm;
10 | using Microsoft.OData.Edm.Csdl;
11 | using Microsoft.OData2OpenApi.ConsoleApp.Abstracts;
12 |
13 | namespace Microsoft.OData2OpenApi.ConsoleApp
14 | {
15 | internal class EdmModelProvider : IEdmModelProvider
16 | {
17 | private bool _isLocalFile;
18 | private string _inputCsdl;
19 |
20 | public EdmModelProvider(string inputCsdl, bool isLocalFile)
21 | {
22 | _isLocalFile = isLocalFile;
23 | _inputCsdl = inputCsdl;
24 | }
25 |
26 | public virtual IEdmModel GetEdmModel()
27 | {
28 | string csdl = GetCsdl();
29 | return CsdlReader.Parse(XElement.Parse(csdl).CreateReader());
30 | }
31 |
32 | private string GetCsdl()
33 | {
34 | if (_isLocalFile)
35 | {
36 | return File.ReadAllText(_inputCsdl);
37 | }
38 |
39 | Uri input = new Uri(_inputCsdl);
40 | Uri requestUri = new Uri(input.OriginalString + "/$metadata");
41 |
42 | WebRequest request = WebRequest.Create(requestUri);
43 |
44 | WebResponse response = request.GetResponse();
45 |
46 | Stream receivedStream = response.GetResponseStream();
47 |
48 | StreamReader reader = new StreamReader(receivedStream, Encoding.UTF8);
49 |
50 | return reader.ReadToEnd();
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/OpenApi/OData2OpenApi/OData2OpenApi/OpenApiGenerator.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System.IO;
5 | using Microsoft.OData.Edm;
6 | using Microsoft.OData2OpenApi.ConsoleApp.Abstracts;
7 | using Microsoft.OpenApi.Extensions;
8 | using Microsoft.OpenApi.Models;
9 | using Microsoft.OpenApi.OData;
10 |
11 | namespace Microsoft.OData2OpenApi.ConsoleApp
12 | {
13 | ///
14 | /// Open Api generator.
15 | ///
16 | internal static class OpenApiGenerator
17 | {
18 | ///
19 | /// Generate the Open Api.
20 | ///
21 | public static bool Run(Configuration config)
22 | {
23 | IEdmModelProvider modelProvider = new EdmModelProvider(config.InputCsdl, config.IsLocalFile);
24 | IEdmModel edmModel = modelProvider.GetEdmModel();
25 |
26 | IConvertSettingsProvider settingsProvider = new ConvertSettingsProvider(config);
27 | OpenApiConvertSettings settings = settingsProvider.GetConvertSettings();
28 |
29 | using (FileStream fs = File.Create(config.OutputFileName))
30 | {
31 | OpenApiDocument document = edmModel.ConvertToOpenApi(settings);
32 | document.Serialize(fs, OpenApi.OpenApiSpecVersion.OpenApi3_0, config.Format);
33 | fs.Flush();
34 | }
35 |
36 | return true;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/OpenApi/OData2OpenApi/OData2OpenApi/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("OData2OpenApi")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("OData2OpenApi")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
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("66ab1e32-735b-44d4-9944-93d3d1ed1a2f")]
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 |
--------------------------------------------------------------------------------
/OpenApi/OData2OpenApi/OData2OpenApi/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/RestierScaffolding/Scaffolding.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.40629.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Restier.Scaffolding", "src\Microsoft.Restier.Scaffolding\Microsoft.Restier.Scaffolding.csproj", "{C5F95FF6-87AD-44E6-A182-486E3254255A}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {C5F95FF6-87AD-44E6-A182-486E3254255A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {C5F95FF6-87AD-44E6-A182-486E3254255A}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {C5F95FF6-87AD-44E6-A182-486E3254255A}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {C5F95FF6-87AD-44E6-A182-486E3254255A}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/RestierScaffolding/ScaffoldingVSix.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.31101.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Restier.Scaffolding.Extension", "src\Microsoft.Restier.Scaffolding.Extension\Microsoft.Restier.Scaffolding.Extension.csproj", "{D22F0C3E-8D60-408A-98AC-A582A7D8D533}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Restier.Scaffolding", "src\Microsoft.Restier.Scaffolding\Microsoft.Restier.Scaffolding.csproj", "{C5F95FF6-87AD-44E6-A182-486E3254255A}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {D22F0C3E-8D60-408A-98AC-A582A7D8D533}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {D22F0C3E-8D60-408A-98AC-A582A7D8D533}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {D22F0C3E-8D60-408A-98AC-A582A7D8D533}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {D22F0C3E-8D60-408A-98AC-A582A7D8D533}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {C5F95FF6-87AD-44E6-A182-486E3254255A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {C5F95FF6-87AD-44E6-A182-486E3254255A}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {C5F95FF6-87AD-44E6-A182-486E3254255A}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {C5F95FF6-87AD-44E6-A182-486E3254255A}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/RestierScaffolding/build.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | pushd %~dp0
3 | setlocal
4 |
5 | if exist bin goto Build
6 | mkdir bin
7 |
8 | :Build
9 |
10 | REM Find the most recent 32bit MSBuild.exe on the system. Require v12.0 (installed with VS2013) or later since .NET 4.0
11 | REM is not supported. Also handle x86 operating systems, where %ProgramFiles(x86)% is not defined. Always quote the
12 | REM %MSBuild% value when setting the variable and never quote %MSBuild% references.
13 | set MSBuild="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
14 | if not exist %MSBuild% @set MSBuild="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe"
15 |
16 | if "%1" == "" goto BuildDefaults
17 |
18 | %MSBuild% Scaffolding.msbuild /m /nr:false /t:%* /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
19 | if %ERRORLEVEL% neq 0 goto BuildFail
20 | goto BuildSuccess
21 |
22 | :BuildDefaults
23 | %MSBuild% Scaffolding.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
24 | if %ERRORLEVEL% neq 0 goto BuildFail
25 | goto BuildSuccess
26 |
27 | :BuildFail
28 | echo.
29 | echo *** BUILD FAILED ***
30 | goto End
31 |
32 | :BuildSuccess
33 | echo.
34 | echo **** BUILD SUCCESSFUL ***
35 | goto End
36 |
37 | :End
38 | popd
39 | endlocal
40 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding.Extension/License.txt:
--------------------------------------------------------------------------------
1 | WebAPI OData V4 Scaffolding ver. 0.1.3
2 |
3 | Copyright (c) Microsoft Corporation
4 |
5 | All rights reserved.
6 |
7 | MIT License
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding.Extension/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System.Reflection;
5 | using System.Runtime.CompilerServices;
6 | using System.Runtime.InteropServices;
7 |
8 | // General Information about an assembly is controlled through the following
9 | // set of attributes. Change these attribute values to modify the information
10 | // associated with an assembly.
11 | [assembly: AssemblyTitle("RestierScaffoldingExtension")]
12 | [assembly: AssemblyDescription("")]
13 | [assembly: AssemblyConfiguration("")]
14 | [assembly: AssemblyCompany("")]
15 | [assembly: AssemblyProduct("RestierScaffoldingExtension")]
16 | [assembly: AssemblyCopyright("")]
17 | [assembly: AssemblyTrademark("")]
18 | [assembly: AssemblyCulture("")]
19 |
20 | // Setting ComVisible to false makes the types in this assembly not visible
21 | // to COM components. If you need to access a type in this assembly from
22 | // COM, set the ComVisible attribute to true on that type.
23 | [assembly: ComVisible(false)]
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 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding.Extension/source.extension.vsixmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Restier Scaffolding
6 | The scaffolding that simplifies the process of building the OData service with EF by RestierTAn assistent Scaffolding
7 | License.txt
8 | Scaffolding, OData
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/CodeTypeExtension.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | using System;
7 | using System.Globalization;
8 | using EnvDTE;
9 | using EnvDTE80;
10 |
11 | internal static class CodeTypeExtension
12 | {
13 | public static bool IsValidConfigType(this CodeType codeType)
14 | {
15 | if (codeType == null)
16 | {
17 | throw new ArgumentException(String.Format(CultureInfo.InvariantCulture, Resources.ArgumentNullOrEmpty, "codeType"));
18 | }
19 |
20 | var cc = codeType as CodeClass2;
21 | if (cc != null && cc.IsShared && cc.Name.EndsWith("Config", StringComparison.Ordinal))
22 | {
23 | foreach (CodeElement ce in cc.Children)
24 | {
25 | if (ce.Name.EndsWith("Register", StringComparison.Ordinal) && ce is CodeFunction)
26 | {
27 | return true;
28 | }
29 | }
30 | }
31 |
32 | return false;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Interop/IProjectItemSelector.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.Interop
5 | {
6 | using System.Runtime.InteropServices;
7 | using Microsoft.VisualStudio.Shell.Interop;
8 |
9 | [ComImport]
10 | [Guid("EDDE1B36-C493-4cbe-B75C-762947CFE068")]
11 | [InterfaceType(ComInterfaceType.InterfaceIsDual)]
12 | internal interface IProjectItemSelector
13 | {
14 | [PreserveSig]
15 | [DispId(1)]
16 | int SelectItem(
17 | [In] [MarshalAs(UnmanagedType.Interface)] IVsHierarchy hierarchy, // The project hierarchy
18 | [In] [MarshalAs(UnmanagedType.U4)] uint itemID, // Itemid of the document making the call. Only used if the file is in a misc files project.
19 | [In] [MarshalAs(UnmanagedType.LPWStr)] string filters, // can be NULL. Format: "All Files (*.*)|*.*|Next Filter (*.ext1,*.ext2)|*.ext1,*.ext2";
20 | [In] [MarshalAs(UnmanagedType.LPWStr)] string dlgTitle, // Can be NULL. Dialog title
21 | [In] [MarshalAs(UnmanagedType.U4)] ProjectItemSelectorFlags flags, // Controls operation
22 | [In] [MarshalAs(UnmanagedType.LPWStr)] string relUrlToAnchor, // can be NULL. Relative URL to start enumeration (relative to project root)
23 | [In] [MarshalAs(UnmanagedType.LPWStr)] string relUrlToSelect, // Can be NULL. Relative URL of the item to select on launch.
24 | [In] [MarshalAs(UnmanagedType.LPWStr)] string baseUrl, // Must be set if PSIF_ReturnDocRelativeUrls is Set. Otherwise it is ignored.
25 | [Out] [MarshalAs(UnmanagedType.BStr)] out string relUrlOfSelectedItem, // return value is the rel url (in "~/a/b" form) the user selected
26 | [Out] [MarshalAs(UnmanagedType.Bool)] out bool canceled);
27 |
28 | // TRUE if user cancel
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Interop/IProjectItemSelector_Class.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.Interop
5 | {
6 | using System.Runtime.InteropServices;
7 |
8 | [ComImport]
9 | [Guid("12B0F5C6-9514-49ef-A27F-6BAE455079B4")]
10 | [InterfaceType(ComInterfaceType.InterfaceIsDual)]
11 | internal interface IProjectItemSelector_Class : IProjectItemSelector
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Interop/ProjectItemSelectorFlags.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.Interop
5 | {
6 | using System;
7 |
8 | [Flags]
9 | internal enum ProjectItemSelectorFlags : int
10 | {
11 | PISF_ReturnAppRelativeUrls = 0, // Default. Dialog returns application (~/) urls
12 | PSIF_ReturnDocRelativeUrls = 1, // Dialog returns document relative URLS. Requires pszBaseUrl to be set
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | using System;
7 |
8 | internal static class NativeMethods
9 | {
10 | public const int E_FAIL = unchecked((int)0x80004005);
11 |
12 | ///
13 | /// This is the HResult returned by IVsBuildPropertyStorage when attempting to read a property that's
14 | /// not in the file.
15 | ///
16 | ///
17 | /// See: http://connect.microsoft.com/VisualStudio/feedback/details/466725/visual-studio-interoperability-request-for-documentation
18 | ///
19 | public const int E_XML_ATTRIBUTE_NOT_FOUND = unchecked((int)0x8004C738);
20 |
21 | public const int S_OK = unchecked((int)0x00000000);
22 |
23 | public static readonly Guid IID_IUnknown = new Guid("{00000000-0000-0000-C000-000000000046}");
24 |
25 | public const int CLSCTX_INPROC_SERVER = 0x1;
26 |
27 | public static bool Succeeded(int hr)
28 | {
29 | return hr >= 0;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ProjectItemExtensions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | using System;
7 | using EnvDTE;
8 | using Microsoft.AspNet.Scaffolding;
9 |
10 | internal static class ProjectItemExtensions
11 | {
12 | // TODO: This is a good candidate to get into Core, since this seems like a common thing to do
13 | public static string GetProjectRelativePath(this ProjectItem projectItem)
14 | {
15 | Project project = projectItem.ContainingProject;
16 | string projRelativePath = null;
17 |
18 | string rootProjectDir = project.GetFullPath();
19 | rootProjectDir = MvcProjectUtil.EnsureTrailingBackSlash(rootProjectDir);
20 | string fullPath = projectItem.GetFullPath();
21 |
22 | if (!String.IsNullOrEmpty(rootProjectDir) && !String.IsNullOrEmpty(fullPath))
23 | {
24 | projRelativePath = CoreScaffoldingUtil.MakeRelativePath(fullPath, rootProjectDir);
25 | }
26 |
27 | return projRelativePath;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | using System;
5 | using System.Reflection;
6 | using System.Resources;
7 | using System.Runtime.CompilerServices;
8 | using System.Runtime.InteropServices;
9 |
10 | // General Information about an assembly is controlled through the following
11 | // set of attributes. Change these attribute values to modify the information
12 | // associated with an assembly.
13 | [assembly: CLSCompliant(false)]
14 | [assembly: AssemblyTitle("RestierScaffolding")]
15 | [assembly: AssemblyDescription("")]
16 | [assembly: AssemblyConfiguration("")]
17 | [assembly: AssemblyCompany("")]
18 | [assembly: AssemblyProduct("RestierScaffolding")]
19 | [assembly: AssemblyCopyright("Copyright © 2014")]
20 | [assembly: AssemblyTrademark("")]
21 | [assembly: AssemblyCulture("")]
22 |
23 | // Setting ComVisible to false makes the types in this assembly not visible
24 | // to COM components. If you need to access a type in this assembly from
25 | // COM, set the ComVisible attribute to true on that type.
26 | [assembly: ComVisible(false)]
27 |
28 | // The following GUID is for the ID of the typelib if this project is exposed to COM
29 | [assembly: Guid("359e8f50-44a0-4e59-8c81-6c5a993219b3")]
30 |
31 | // Version information for an assembly consists of the following four values:
32 | //
33 | // Major Version
34 | // Minor Version
35 | // Build Number
36 | // Revision
37 | //
38 | // You can specify all the values or you can default the Build and Revision Numbers
39 | // by using the '*' as shown below:
40 | // [assembly: AssemblyVersion("1.0.*")]
41 | [assembly: AssemblyVersion("0.1.0.0")]
42 | [assembly: AssemblyFileVersion("0.1.0.0")]
43 | [assembly: NeutralResourcesLanguageAttribute("en")]
44 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReadMe/ODataReadMe.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.ReadMe
5 | {
6 | using System;
7 |
8 | internal class ODataReadMe
9 | {
10 | internal static string CreateReadMeText()
11 | {
12 | return Environment.NewLine + Resources.ScaffoldODataReadMeText + Environment.NewLine + Environment.NewLine;
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/entityframework.6.1.1.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/entityframework.6.1.1.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.aspnet.odata.5.7.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.aspnet.odata.5.7.0.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.aspnet.webapi.5.2.2.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.aspnet.webapi.5.2.2.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.aspnet.webapi.client.5.2.2.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.aspnet.webapi.client.5.2.2.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.aspnet.webapi.core.5.2.2.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.aspnet.webapi.core.5.2.2.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.aspnet.webapi.webhost.5.2.2.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.aspnet.webapi.webhost.5.2.2.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.odata.core.6.13.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.odata.core.6.13.0.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.odata.edm.6.13.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.odata.edm.6.13.0.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.restier.0.4.0-rc.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.restier.0.4.0-rc.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.restier.core.0.4.0-rc.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.restier.core.0.4.0-rc.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.restier.entityframework.0.4.0-rc.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.restier.entityframework.0.4.0-rc.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.restier.webapi.0.4.0-rc.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.restier.webapi.0.4.0-rc.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.spatial.6.13.0.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/microsoft.spatial.6.13.0.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/newtonsoft.json.6.0.4.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ReferencePackages/newtonsoft.json.6.0.4.nupkg
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Resources/_TemplateIconSample.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OData/lab/eece92fae2fc7a19b2f20cdd30d3925d751be094/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Resources/_TemplateIconSample.ico
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/SavedSettingsKeys.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | internal static class SavedSettingsKeys
7 | {
8 | private const string Prefix = "WebStackScaffolding_";
9 |
10 | public const string DbContextTypeFullNameKey = Prefix + "DbContextTypeFullName";
11 | public const string ConfigTypeFullNameKey = Prefix + "ConfigTypeFullName";
12 | public const string ConfigDialogWidthKey = Prefix + "ControllerDialogWidth";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Scaffolders/CommonFilenames.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | internal static class CommonFilenames
7 | {
8 | public const string WebConfig = "web.config";
9 |
10 | public const string GlobalAsax = "Global";
11 | public const string GlobalAsaxCodeBehind = "Global.asax";
12 | public const string WebApiConfig = "WebApiConfig";
13 | public const string BundleConfig = "BundleConfig";
14 | public const string FilterConfig = "FilterConfig";
15 | public const string RouteConfig = "RouteConfig";
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Scaffolders/CommonFolderNames.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | ///
7 | /// Constants for common folder names used in scaffolding.
8 | ///
9 | internal static class CommonFolderNames
10 | {
11 | public const string AppStart = "App_Start";
12 | public const string Areas = "Areas";
13 | public const string Controllers = "Controllers";
14 | public const string Views = "Views";
15 | public const string Models = "Models";
16 | public const string Shared = "Shared";
17 | public const string Content = "Content";
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Scaffolders/ContextKeys.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | public static class ContextKeys
7 | {
8 | public const string IsODataLibAssemblyReferencedKey = "RestierScaffolding_IsODataLibAssemblyReferenced";
9 | public const string IsODataWebApiAssemblyReferencedKey = "RestierScaffolding_IsODataWebApiAssemblyReferenced";
10 | public const string IsODataRestierAssemblyReferencedKey = "RestierScaffolding_IsODataRestierAssemblyReferenced";
11 | public const string IsEntityFrameworkAssemblyReferencedKey = "RestierScaffolding_IsEntityFrameworkAssemblyReferencedKey";
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Scaffolders/FrameworkDependencyStatus.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | using System;
7 | using System.Diagnostics.CodeAnalysis;
8 |
9 | public class FrameworkDependencyStatus
10 | {
11 | [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "This type is immutable")]
12 | public static readonly FrameworkDependencyStatus InstallSuccessful = new FrameworkDependencyStatus()
13 | {
14 | IsNewDependencyInstall = true,
15 | };
16 |
17 | [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "This type is immutable")]
18 | public static readonly FrameworkDependencyStatus InstallNotNeeded = new FrameworkDependencyStatus()
19 | {
20 | };
21 |
22 | public static FrameworkDependencyStatus FromReadme(string text)
23 | {
24 | if (text == null)
25 | {
26 | throw new ArgumentNullException("text");
27 | }
28 |
29 | return new FrameworkDependencyStatus()
30 | {
31 | IsNewDependencyInstall = true,
32 | IsReadmeRequired = true,
33 | ReadmeText = text,
34 | };
35 | }
36 |
37 | private FrameworkDependencyStatus()
38 | {
39 | }
40 |
41 | public bool IsNewDependencyInstall { get; private set; }
42 |
43 | public bool IsReadmeRequired { get; private set; }
44 |
45 | public string ReadmeText { get; private set; }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Scaffolders/IScaffoldingSettings.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | using Microsoft.Restier.Scaffolding.VisualStudio;
7 |
8 | public interface IScaffoldingSettings
9 | {
10 | void LoadSettings(IProjectSettings settings);
11 |
12 | void SaveSettings(IProjectSettings settings);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Scaffolders/Restier/ODataDependencyInstaller.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | using System;
7 | using System.IO;
8 | using System.Runtime.Remoting.Contexts;
9 | using Microsoft.AspNet.Scaffolding;
10 | using Microsoft.Restier.Scaffolding.ReadMe;
11 | using Microsoft.Restier.Scaffolding.VisualStudio;
12 |
13 | public class ODataDependencyInstaller : DependencyInstaller
14 | {
15 | public ODataDependencyInstaller(CodeGenerationContext context, IVisualStudioIntegration visualStudioIntegration)
16 | : base(context, visualStudioIntegration)
17 | {
18 | }
19 |
20 | protected override string[] SearchFolders
21 | {
22 | get
23 | {
24 | // TODO: this is temporarily here until we reorganize these dependency folders
25 | return new string[] { Path.Combine(TemplateSearchDirectories.InstalledTemplateRoot, "ODataDependencyCodeGenerator") };
26 | }
27 | }
28 |
29 | protected override FrameworkDependencyStatus GenerateConfiguration()
30 | {
31 | return FrameworkDependencyStatus.FromReadme(ODataReadMe.CreateReadMeText());
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Scaffolders/Restier/RestierConfigScaffolderFactory.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | using System.ComponentModel.Composition;
7 | using Microsoft.AspNet.Scaffolding;
8 |
9 | [Export(typeof(CodeGeneratorFactory))]
10 | internal class RestierConfigScaffolderFactory : ScaffolderFactory
11 | {
12 | private static CodeGeneratorInformation _info = new CodeGeneratorInformation(
13 | displayName: Resources.RestierScaffolderName,
14 | description: Resources.RestierScaffolderDescription,
15 | author: Resources.Scaffold_Auther,
16 | version: ScaffolderVersions.RestierScaffolderVersion,
17 | id: Resources.RestierScaffolderId,
18 | icon: ToImageSource(Resources._TemplateIconSample),
19 | gestures: new[] { ScaffoldingGestures.Config },
20 | categories: new[] { Categories.WebApi });
21 |
22 | public RestierConfigScaffolderFactory()
23 | : base(_info)
24 | {
25 | }
26 |
27 | protected override ICodeGenerator CreateInstanceInternal(CodeGenerationContext context)
28 | {
29 | return new RestierConfigScaffolder(context, Information);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Scaffolders/ScaffolderVersions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | using System;
7 |
8 | internal static class ScaffolderVersions
9 | {
10 | public static readonly Version RestierScaffolderVersion = new Version(0, 1, 0, 0);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Scaffolders/ScaffoldingGestures.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | internal static class ScaffoldingGestures
7 | {
8 | public const string Config = "App_Start";
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Scaffolders/TemplateSearchDirectories.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | using System;
7 | using System.IO;
8 | using EnvDTE;
9 | using Microsoft.AspNet.Scaffolding;
10 |
11 | internal static class TemplateSearchDirectories
12 | {
13 | public static string InstalledTemplateRoot
14 | {
15 | get
16 | {
17 | return Path.Combine(Path.GetDirectoryName(typeof(TemplateSearchDirectories).Assembly.Location), "Templates");
18 | }
19 | }
20 |
21 | public static string GetProjectTemplateRoot(Project project)
22 | {
23 | if (project == null)
24 | {
25 | throw new ArgumentNullException("project");
26 | }
27 |
28 | return Path.Combine(project.GetFullPath(), "CodeTemplates");
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/SemanticVersionParser.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | using System;
7 | using System.Text.RegularExpressions;
8 |
9 | internal static class SemanticVersionParser
10 | {
11 | private const RegexOptions Flags = RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture;
12 | private static readonly Regex _semanticVersionRegex = new Regex(@"^(?\d+(\s*\.\s*\d+){0,3})(?-[a-z][0-9a-z-]*)?$", Flags);
13 |
14 | ///
15 | /// Helper method to parse a Version from a semantic version string.
16 | /// This ignores any special version in the semantic version string and
17 | /// just returns the version component in the out variable for a successful parse.
18 | /// Otherwise returns false.
19 | ///
20 | ///
21 | ///
22 | ///
23 | internal static bool TryParse(string versionString, out Version version)
24 | {
25 | version = null;
26 | if (String.IsNullOrWhiteSpace(versionString))
27 | {
28 | return false;
29 | }
30 |
31 | var match = _semanticVersionRegex.Match(versionString.Trim());
32 | if (!match.Success || !Version.TryParse(match.Groups["Version"].Value, out version))
33 | {
34 | return false;
35 | }
36 |
37 | return true;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/ServiceProviderExtensions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding
5 | {
6 | using System;
7 |
8 | internal static class ServiceProviderExtensions
9 | {
10 | public static T GetService(this IServiceProvider serviceProvider)
11 | {
12 | if (serviceProvider == null)
13 | {
14 | throw new ArgumentNullException("serviceProvider");
15 | }
16 |
17 | return (T)serviceProvider.GetService(typeof(T));
18 | }
19 |
20 | public static TInterface GetService(this IServiceProvider serviceProvider)
21 | where TInterface : class
22 | where TService : class
23 | {
24 | if (serviceProvider == null)
25 | {
26 | throw new ArgumentNullException("serviceProvider");
27 | }
28 |
29 | return (TInterface)serviceProvider.GetService(typeof(TService));
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Telemetry/CodeGenerationContextExtensions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.Telemetry
5 | {
6 | using System;
7 | using System.Collections.Generic;
8 | using Microsoft.AspNet.Scaffolding;
9 |
10 | internal static class CodeGenerationContextExtensions
11 | {
12 | public static void AddTelemetryData(this CodeGenerationContext context, string key, object value)
13 | {
14 | if (context == null)
15 | {
16 | throw new ArgumentNullException("context");
17 | }
18 |
19 | if (key == null)
20 | {
21 | throw new ArgumentNullException("key");
22 | }
23 |
24 | if (value == null)
25 | {
26 | throw new ArgumentNullException("value");
27 | }
28 |
29 | Dictionary mvcTelemetryItems;
30 | if (!context.Items.TryGetProperty>(TelemetrySharedKeys.MvcTelemetryItems, out mvcTelemetryItems))
31 | {
32 | mvcTelemetryItems = new Dictionary();
33 | context.Items.AddProperty(TelemetrySharedKeys.MvcTelemetryItems, mvcTelemetryItems);
34 | }
35 |
36 | mvcTelemetryItems[key] = value;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Telemetry/DependencyScaffolderOptions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.Telemetry
5 | {
6 | internal enum DependencyScaffolderOptions : uint
7 | {
8 | None = 0u,
9 | AlreadyInstalled = 1u,
10 | MvcMinimal = 2u,
11 | MvcFull = 3u,
12 | WebApi = 4u
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Telemetry/TelemetrySharedKeys.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.Telemetry
5 | {
6 | ///
7 | /// Shared keys for storing SQM data points in the CodeGenerationContext. These values are shared with
8 | /// the Core scaffolding implementation, do not change them.
9 | ///
10 | internal static class TelemetrySharedKeys
11 | {
12 | ///
13 | /// This is the key used to store the dictionary of MVC/Web API specific sqm data in the context.
14 | ///
15 | public const string MvcTelemetryItems = "MSInternal_MvcInfo";
16 | public const string DependencyScaffolderOptions = "DependencyScaffolderOptions";
17 | public const string WebApiControllerScaffolderOptions = "WebApiControllerScaffolderOptions";
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Templates/PackageVersions5.2.2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/Templates/PackageVersions5.2.3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/ApplicationResources.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
13 |
14 |
16 |
17 |
19 |
20 |
22 |
23 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/ChangeCancelButtonControl.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
13 |
14 |
15 |
16 |
18 |
24 |
27 |
28 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/ChangeCancelButtonControl.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.UI
5 | {
6 | using System.Windows;
7 | using System.Windows.Controls;
8 |
9 | // Interaction logic for ChangeCancelButtonControl.xaml
10 | internal partial class ChangeCancelButtonControl : UserControl
11 | {
12 | public event RoutedEventHandler ChangeButtonClick;
13 |
14 | public ChangeCancelButtonControl()
15 | {
16 | InitializeComponent();
17 | }
18 |
19 | public void ChangeButton_Click(object sender, RoutedEventArgs e)
20 | {
21 | if (ChangeButtonClick != null)
22 | {
23 | ChangeButtonClick(sender, e);
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/ConfigScaffolderDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.UI
5 | {
6 | using System.Diagnostics.CodeAnalysis;
7 | using System.Windows;
8 |
9 | // Interaction logic for ConfigScaffolderDialog.xaml
10 | internal partial class ConfigScaffolderDialog : ValidatingDialogWindow
11 | {
12 | public ConfigScaffolderDialog()
13 | {
14 | InitializeComponent();
15 | }
16 |
17 | [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "This is called in xaml.")]
18 | private void ChangeButton_Click(object sender, RoutedEventArgs e)
19 | {
20 | TryClose();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/ContextControl.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.UI
5 | {
6 | using System.Windows.Controls;
7 |
8 | // Interaction logic for ContextControl.xaml
9 | internal partial class ContextControl : UserControl
10 | {
11 | public ContextControl()
12 | {
13 | InitializeComponent();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/DataContextModelTypeComparer.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.UI
5 | {
6 | using System;
7 | using System.Collections.Generic;
8 |
9 | ///
10 | /// A comparer implementation for the DataContext menu, that puts the "Add New DataContext"
11 | /// item at the top, and then sorts by type name.
12 | ///
13 | internal class DataContextModelTypeComparer : Comparer
14 | {
15 | public override int Compare(ModelType x, ModelType y)
16 | {
17 | if (x == null && y == null)
18 | {
19 | return 0;
20 | }
21 | else if (x == null)
22 | {
23 | return -1;
24 | }
25 | else if (y == null)
26 | {
27 | return 1;
28 | }
29 | else
30 | {
31 | return StringComparer.CurrentCulture.Compare(x.ShortTypeName, y.ShortTypeName);
32 | }
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/DefaultDialogSize.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.UI
5 | {
6 | internal static class DefaultDialogSize
7 | {
8 | public const double DialogWidth = 600;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/IDialogSettings.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.UI
5 | {
6 | using Microsoft.Restier.Scaffolding.VisualStudio;
7 |
8 | ///
9 | /// An interface for Scaffolder Models that read and write dialog settings.
10 | ///
11 | public interface IDialogSettings
12 | {
13 | void LoadDialogSettings(IProjectSettings settings);
14 |
15 | void SaveDialogSettings(IProjectSettings settings);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/InverseBooleanConverter.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.UI
5 | {
6 | using System;
7 | using System.Globalization;
8 | using System.Windows.Data;
9 |
10 | internal class InverseBooleanConverter : IValueConverter
11 | {
12 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
13 | {
14 | return !((bool)value);
15 | }
16 |
17 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
18 | {
19 | throw new NotImplementedException();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/InverseBooleanToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.UI
5 | {
6 | using System;
7 | using System.Globalization;
8 | using System.Windows;
9 | using System.Windows.Data;
10 |
11 | internal class InverseBooleanToVisibilityConverter : IValueConverter
12 | {
13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
14 | {
15 | return (bool)value ? Visibility.Collapsed : Visibility.Visible;
16 | }
17 |
18 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
19 | {
20 | throw new NotImplementedException();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/ModelType.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.UI
5 | {
6 | using System;
7 | using System.Globalization;
8 | using EnvDTE;
9 |
10 | ///
11 | /// Wrapper for CodeType so we can use it in the UI.
12 | ///
13 | public class ModelType
14 | {
15 | public ModelType(CodeType codeType)
16 | {
17 | if (codeType == null)
18 | {
19 | throw new ArgumentNullException("codeType");
20 | }
21 |
22 | CodeType = codeType;
23 | TypeName = codeType.FullName;
24 | ShortTypeName = codeType.Name;
25 | DisplayName = (codeType.Namespace == null || String.IsNullOrWhiteSpace(codeType.Namespace.FullName))
26 | ? codeType.Name
27 | : String.Format(CultureInfo.InvariantCulture, "{0} ({1})", codeType.Name, codeType.Namespace.FullName);
28 | }
29 |
30 | public ModelType(string typeName)
31 | {
32 | if (typeName == null)
33 | {
34 | throw new ArgumentNullException("typeName");
35 | }
36 |
37 | CodeType = null;
38 | TypeName = typeName;
39 | DisplayName = typeName;
40 | ShortTypeName = typeName;
41 | }
42 |
43 | public CodeType CodeType { get; set; }
44 |
45 | public string DisplayName { get; set; }
46 |
47 | public string TypeName { get; set; }
48 |
49 | public string ShortTypeName { get; set; }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/MultiAndBooleanConverter.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.UI
5 | {
6 | using System;
7 | using System.Globalization;
8 | using System.Windows.Data;
9 |
10 | internal class MultiAndBooleanConverter : IMultiValueConverter
11 | {
12 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
13 | {
14 | bool returnValue = true;
15 |
16 | for (int i = 0; i < values.Length; i++)
17 | {
18 | if (values[i] is bool)
19 | {
20 | returnValue &= (bool)values[i];
21 | }
22 | else
23 | {
24 | throw new ArgumentException(String.Format(CultureInfo.InvariantCulture, "Values must be boolean!. Value {0} had a type of {1}", i, values[i].GetType().ToString()));
25 | }
26 | }
27 |
28 | return returnValue;
29 | }
30 |
31 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
32 | {
33 | throw new NotImplementedException();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/NotifyPropertyChanged.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.UI
5 | {
6 | using System;
7 | using System.ComponentModel;
8 | using System.Diagnostics.CodeAnalysis;
9 | using System.Runtime.CompilerServices;
10 |
11 |
12 | public class NotifyPropertyChanged : INotifyPropertyChanged
13 | {
14 | public event PropertyChangedEventHandler PropertyChanged;
15 |
16 | [SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", Justification = "Using a ref parameter here is intentional")]
17 | [SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Justification = "Using a default value is required for CallerMemberName")]
18 | protected bool OnPropertyChanged(ref T propertyRef, T value, [CallerMemberName]string propertyName = null)
19 | {
20 | if (!Object.Equals(propertyRef, value))
21 | {
22 | propertyRef = value;
23 | OnPropertyChanged(propertyName);
24 | return true;
25 | }
26 |
27 | return false;
28 | }
29 |
30 | protected void OnPropertyChanged(string propertyName)
31 | {
32 | PropertyChangedEventHandler handler = PropertyChanged;
33 | if (handler != null)
34 | {
35 | handler(this, new PropertyChangedEventArgs(propertyName));
36 | }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/RestierScaffolding/src/Microsoft.Restier.Scaffolding/UI/RelayCommand.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft Corporation. All rights reserved.
2 | // Licensed under the MIT License. See License.txt in the project root for license information.
3 |
4 | namespace Microsoft.Restier.Scaffolding.UI
5 | {
6 | using System;
7 | using System.Windows.Input;
8 |
9 | public class RelayCommand : ICommand
10 | {
11 | public event EventHandler CanExecuteChanged;
12 |
13 | public RelayCommand(Action