<ProjectSchemaDefinitions xmlns="http://schemas.microsoft.com/build/2009/properties">
  <FileExtension Name=".proto"
                 ContentType="ProtoFile" />

  <ContentType Name="ProtoFile"
               DisplayName="Protocol buffer definitions file"
               ItemType="Protobuf" />

  <ItemType Name="Protobuf"
            DisplayName="Protobuf compiler" />

  <Rule Name="Protobuf"
        DisplayName="File Properties"
        PageTemplate="generic"
        Description="File Properties"
        OverrideMode="Extend">
    <Rule.DataSource>
      <DataSource Persistence="ProjectFile" Label="Configuration" ItemType="Protobuf"
                  HasConfigurationCondition="false" SourceOfDefaultValue="AfterContext" />
    </Rule.DataSource>

    <Rule.Categories>
      <Category Name="Advanced" DisplayName="Advanced" />
      <Category Name="Protobuf" DisplayName="Protobuf" />
      <Category Name="Misc" DisplayName="Misc" />
    </Rule.Categories>

    <DynamicEnumProperty Name="{}{ItemType}" DisplayName="Build Action"  Category="Advanced"
                   Description="How the file relates to the build and deployment processes."
                   EnumProvider="ItemTypes" />

    <StringProperty Name="Identity" Visible="false" ReadOnly="true">
      <StringProperty.DataSource>
        <DataSource Persistence="Intrinsic" ItemType="Protobuf"
                    PersistedName="Identity" SourceOfDefaultValue="AfterContext" />
      </StringProperty.DataSource>
    </StringProperty>

    <StringProperty Name="FullPath"
                    DisplayName="Full Path"
                    ReadOnly="true"
                    Category="Misc"
                    Description="Location of the file.">
      <StringProperty.DataSource>
        <DataSource Persistence="Intrinsic" ItemType="Protobuf"
                    PersistedName="FullPath" SourceOfDefaultValue="AfterContext" />
      </StringProperty.DataSource>
    </StringProperty>

    <StringProperty Name="FileNameAndExtension"
                    DisplayName="File Name"
                    ReadOnly="true"
                    Category="Misc"
                    Description="Name of the file or folder.">
      <StringProperty.DataSource>
        <DataSource Persistence="Intrinsic" ItemType="Protobuf"
                    PersistedName="FileNameAndExtension" SourceOfDefaultValue="AfterContext" />
      </StringProperty.DataSource>
    </StringProperty>

    <BoolProperty Name="Visible" Visible="false" Default="true" />

    <StringProperty Name="DependentUpon" Visible="false">
      <StringProperty.Metadata>
        <NameValuePair Name="DoNotCopyAcrossProjects" Value="true" />
      </StringProperty.Metadata>
    </StringProperty>

    <StringProperty Name="Link" Visible="false">
      <StringProperty.DataSource>
        <DataSource SourceOfDefaultValue="AfterContext" />
      </StringProperty.DataSource>
      <StringProperty.Metadata>
        <NameValuePair Name="DoNotCopyAcrossProjects" Value="true" />
      </StringProperty.Metadata>
    </StringProperty>

    <EnumProperty Name="Access" DisplayName="Class Access"
                  Category="Protobuf"
                  Description="Public or internal access modifier on generated classes.">
      <EnumValue Name="Public" DisplayName="Public" IsDefault="true" />
      <EnumValue Name="Internal" DisplayName="Internal" />
      <EnumProperty.DataSource>
        <DataSource ItemType="Protobuf" SourceOfDefaultValue="AfterContext"
                    PersistenceStyle="Attribute" HasConfigurationCondition="false" />
      </EnumProperty.DataSource>
    </EnumProperty>

    <BoolProperty Name="ProtoCompile" DisplayName="Compile Protobuf"
                  Category="Protobuf" Default="true"
                  Description="Specifies if this file is compiled or only imported by other files.">
      <BoolProperty.DataSource>
        <DataSource ItemType="Protobuf" SourceOfDefaultValue="AfterContext"
                    PersistenceStyle="Attribute" HasConfigurationCondition="false" />
      </BoolProperty.DataSource>
    </BoolProperty>

  </Rule>
</ProjectSchemaDefinitions>
