<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information. -->
<!--

  This file contains Visual Studio and designer-related properties and items for Visual Basic projects.

-->

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <Import Project="Microsoft.Managed.DesignTime.targets" />

  <!-- Properties -->
  <PropertyGroup>
    <AppDesignerFolder Condition="'$(AppDesignerFolder)' == ''">My Project</AppDesignerFolder>
    <AppDesignerFolderContentsVisibleOnlyInShowAllFiles Condition="'$(AppDesignerFolderContentsVisibleOnlyInShowAllFiles)' == ''">true</AppDesignerFolderContentsVisibleOnlyInShowAllFiles>
    <LanguageServiceName Condition="'$(LanguageServiceName)' == ''">Visual Basic</LanguageServiceName>
    <LanguageServiceId Condition="'$(LanguageServiceId)'==''">{E34ACDC0-BAAE-11D0-88BF-00A0C9110049}</LanguageServiceId>
    <TemplateLanguage Condition="'$(TemplateLanguage)' == ''">VisualBasic</TemplateLanguage>
    <AddItemTemplatesGuid Condition="'$(AddItemTemplatesGuid)' == ''">{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</AddItemTemplatesGuid>
    <CmdUIContextGuid Condition="'$(CmdUIContextGuid)' == ''">{164B10B9-B200-11d0-8C61-00A0C91E29D5}</CmdUIContextGuid>
    <GeneratorsTypeGuid Condition="'$(GeneratorsTypeGuid)' == ''">{164B10B9-B200-11d0-8C61-00A0C91E29D5}</GeneratorsTypeGuid>
    <DesignerFunctionVisibility Condition="'$(DesignerFunctionVisibility)' == ''">Friend</DesignerFunctionVisibility>
    <DesignerVariableNaming Condition="'$(DesignerVariableNaming)' == ''">VB</DesignerVariableNaming>
    <DesignerHiddenCodeGeneration Condition="'$(DesignerHiddenCodeGeneration)' == ''">Declarations;InitMethods</DesignerHiddenCodeGeneration>

    <!-- Turn off rules and capabilities that are defined in MSBuild so that we can import our own below -->
    <DefineVisualBasicItemSchemas>false</DefineVisualBasicItemSchemas>
  </PropertyGroup>

  <ItemGroup>
    <PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ProjectItemsSchema.VisualBasic.xaml;" />

    <!-- Namespace Import List-->
    <PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)VisualBasic.NamespaceImport.xaml">
      <Context>ProjectSubscriptionService</Context>
    </PropertyPageSchema>

    <ProjectCapability Include="
                          VB;
                          Managed;
                          ClassDesigner;
                          SharedProjectReferences;
                          ProjectPropertiesEditor;" />

    <ProjectCapability Include="EnableMyApplication" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'" />

    <ProjectCapability Include="EnableMyApplication" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(UseWindowsForms)' == 'true' And '$(TargetFrameworkVersion)' != '' And $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)','5.0'))" />
  </ItemGroup>

  <ItemGroup Condition="'$(DefineCommonManagedItemSchemas)' == 'true'">

    <PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)BuildPropertyPage.VisualBasic.xaml">
      <Context>Project</Context>
    </PropertyPageSchema>

    <PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ApplicationPropertyPage.VisualBasic.xaml">
      <Context>Project</Context>
    </PropertyPageSchema>

    <PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)ReferencesPage.VisualBasic.xaml">
      <Context>Project</Context>
    </PropertyPageSchema>

    <PropertyPageSchema Include="$(ManagedXamlNeutralResourcesDirectory)EditorConfigFiles.xaml">
      <Context>File</Context>
    </PropertyPageSchema>

    <PropertyPageSchema Include="$(ManagedXamlResourcesDirectory)EditorConfigFiles.BrowseObject.xaml">
      <Context>BrowseObject</Context>
    </PropertyPageSchema>

  </ItemGroup>

  <!-- Targets -->

  <!-- Returns Vbc command-line arguments for the language service -->
  <Target Name="CompileDesignTime"
          Returns="@(_CompilerCommandLineArgs)"
          DependsOnTargets="_CheckCompileDesignTimePrerequisite;Compile"
          Condition="'$(IsCrossTargetingBuild)' != 'true'">

    <!-- VB Framework projects needs core library references. In the case of Command line scenario, the vbc injects this reference. -->
    <PropertyGroup Condition="'$(FrameworkPathOverride)' != ''">
      <MSCorlibPath Condition=" '$(MSCorlibPath)' == '' ">$(FrameworkPathOverride)\mscorlib.dll</MSCorlibPath>
      <MSVBRuntimeFileOrPath Condition=" '$(MSVBRuntimeFileOrPath)' == '' And '$(VBRuntimePath)' == '$(VBRuntime)'">$(VBRuntimePath)</MSVBRuntimeFileOrPath>
      <MSVBRuntimeFileOrPath Condition=" '$(MSVBRuntimeFileOrPath)' == '' And '$(VBRuntime)' == 'DEFAULT'">$(FrameworkPathOverride)\Microsoft.VisualBasic.dll</MSVBRuntimeFileOrPath>
      <MSVBRuntimeFileOrPath Condition=" '$(MSVBRuntimeFileOrPath)' == '' And '$(VBRuntime)' != '' And'$(VBRuntime)' != 'None' And '$(VBRuntime)' != 'Embed'">$(VBRuntime)</MSVBRuntimeFileOrPath>
    </PropertyGroup>

    <ItemGroup>
      <VbcCommandLineArgs Condition="Exists('$(MSCorlibPath)')" Include="/reference:$(MSCorlibPath)" />

      <!-- MSVBRuntimeFileOrPath could either be the filename relative to sdkpath or the actual path to the runtime-->
      <VbcCommandLineArgs Condition="Exists('$(MSVBRuntimeFileOrPath)')" Include="/reference:$(MSVBRuntimeFileOrPath)" />
      <VbcCommandLineArgs Condition="'$(MSVBRuntimeFileOrPath)' != '' And Exists('$(FrameworkPathOverride)\$(MSVBRuntimeFileOrPath)')" Include="/reference:$(FrameworkPathOverride)\$(MSVBRuntimeFileOrPath)" />
    </ItemGroup>

    <ItemGroup>
      <_CompilerCommandLineArgs Include="@(VbcCommandLineArgs)" />
    </ItemGroup>

  </Target>

</Project>