Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
heku committed Mar 18, 2023
1 parent 5b3f258 commit 259bda8
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 28 deletions.
18 changes: 12 additions & 6 deletions Kool.EditProject.2019/Kool.EditProject.2019.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Kool.EditProject.Linked\VSPackage.Designer.cs" Link="VSPackage.Designer.cs">
<Compile Include="..\Kool.EditProject.Linked\I18n.Designer.cs" Link="I18n.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>VSPackage.tt</DependentUpon>
<DependentUpon>I18n.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="source.extension.vsixmanifest" />
<None Include="..\Kool.EditProject.Linked\Menus.vsct" Link="Menus.vsct" />
<None Include="..\Kool.EditProject.Linked\VSPackage.tt" Link="VSPackage.tt">
<None Include="..\Kool.EditProject.Linked\I18n.tt" Link="I18n.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>VSPackage.Designer.cs</LastGenOutput>
<LastGenOutput>I18n.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
Expand All @@ -79,18 +79,24 @@
<ItemGroup>
<VSCTCompile Include="..\Kool.EditProject.Linked\Menus.en.vsct" Link="Menus.en.vsct">
<ResourceName>Menus.ctmenu</ResourceName>
<DependentUpon>Menus.vsct</DependentUpon>
</VSCTCompile>
<VSCTCompile Include="..\Kool.EditProject.Linked\Menus.zh-Hans.vsct" Link="Menus.zh-Hans.vsct">
<ResourceName>Menus.ctmenu</ResourceName>
<DependentUpon>Menus.vsct</DependentUpon>
</VSCTCompile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\Kool.EditProject.Linked\VSPackage.en.resx" Link="VSPackage.en.resx">
<EmbeddedResource Include="..\Kool.EditProject.Linked\I18n.en.resx" Link="I18n.en.resx">
<MergeWithCTO>true</MergeWithCTO>
<LogicalName>VSPackage.en.resources</LogicalName>
<DependentUpon>I18n.tt</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="..\Kool.EditProject.Linked\VSPackage.zh-Hans.resx" Link="VSPackage.zh-Hans.resx">
<EmbeddedResource Include="..\Kool.EditProject.Linked\I18n.zh-Hans.resx" Link="I18n.zh-Hans.resx">
<MergeWithCTO>true</MergeWithCTO>
<LogicalName>VSPackage.zh-Hans.resources</LogicalName>
<DependentUpon>I18n.tt</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
Expand Down
18 changes: 12 additions & 6 deletions Kool.EditProject.2022/Kool.EditProject.2022.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Kool.EditProject.Linked\VSPackage.Designer.cs" Link="VSPackage.Designer.cs">
<Compile Include="..\Kool.EditProject.Linked\I18n.Designer.cs" Link="I18n.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>VSPackage.tt</DependentUpon>
<DependentUpon>I18n.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="source.extension.vsixmanifest" />
<None Include="..\Kool.EditProject.Linked\Menus.vsct" Link="Menus.vsct" />
<None Include="..\Kool.EditProject.Linked\VSPackage.tt" Link="VSPackage.tt">
<None Include="..\Kool.EditProject.Linked\I18n.tt" Link="I18n.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>VSPackage.Designer.cs</LastGenOutput>
<LastGenOutput>I18n.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
Expand All @@ -79,18 +79,24 @@
<ItemGroup>
<VSCTCompile Include="..\Kool.EditProject.Linked\Menus.en.vsct" Link="Menus.en.vsct">
<ResourceName>Menus.ctmenu</ResourceName>
<DependentUpon>Menus.vsct</DependentUpon>
</VSCTCompile>
<VSCTCompile Include="..\Kool.EditProject.Linked\Menus.zh-Hans.vsct" Link="Menus.zh-Hans.vsct">
<ResourceName>Menus.ctmenu</ResourceName>
<DependentUpon>Menus.vsct</DependentUpon>
</VSCTCompile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\Kool.EditProject.Linked\VSPackage.en.resx" Link="VSPackage.en.resx">
<EmbeddedResource Include="..\Kool.EditProject.Linked\I18n.en.resx" Link="I18n.en.resx">
<MergeWithCTO>true</MergeWithCTO>
<LogicalName>VSPackage.en.resources</LogicalName>
<DependentUpon>I18n.tt</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="..\Kool.EditProject.Linked\VSPackage.zh-Hans.resx" Link="VSPackage.zh-Hans.resx">
<EmbeddedResource Include="..\Kool.EditProject.Linked\I18n.zh-Hans.resx" Link="I18n.zh-Hans.resx">
<MergeWithCTO>true</MergeWithCTO>
<LogicalName>VSPackage.zh-Hans.resources</LogicalName>
<DependentUpon>I18n.tt</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const string BenchmarkLanguage = "en";

var resourceNameWithoutCulture = Path.GetFileNameWithoutExtension(Host.TemplateFile);
var resourceNamespace = Host.ResolveParameterValue("directiveId", "namespaceDirectiveProcessor", "namespaceHint") ?? string.Empty;
var resourceFullNameWithoutCulture = resourceNamespace + "." + resourceNameWithoutCulture;
#>

// ------------------------------------------------------------------------------
Expand All @@ -29,7 +28,7 @@ namespace <#= resourceNamespace#>
/// </summary>
static class <#= resourceNameWithoutCulture#>
{
static readonly ResourceManager Resx = new ResourceManager("<#= resourceFullNameWithoutCulture#>", typeof(<#= resourceNameWithoutCulture#>).Assembly);
static readonly ResourceManager Resx = new ResourceManager("VSPackage", typeof(<#= resourceNameWithoutCulture#>).Assembly);

<#
var resx = Path.ChangeExtension(Host.TemplateFile , BenchmarkLanguage + ".resx");
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Kool.EditProject.Shared/Commands/EditProjectCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected override void OnExecute()
}
catch (Exception ex)
{
MessageBox.Error(VSPackage.ErrorMessageTitle, ex.Message);
MessageBox.Error(I18n.ErrorMessageTitle, ex.Message);
}
}
}
2 changes: 1 addition & 1 deletion Kool.EditProject.Shared/Commands/EditProjectsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected override void OnExecute()
}
catch (Exception ex)
{
MessageBox.Error(VSPackage.ErrorMessageTitle, ex.Message);
MessageBox.Error(I18n.ErrorMessageTitle, ex.Message);
}
}
}
2 changes: 1 addition & 1 deletion Kool.EditProject.Shared/Commands/EditSolutionCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected override void OnExecute()
}
catch (Exception ex)
{
MessageBox.Error(VSPackage.ErrorMessageTitle, ex.Message);
MessageBox.Error(I18n.ErrorMessageTitle, ex.Message);
}
}
}
10 changes: 5 additions & 5 deletions Kool.EditProject.Shared/Pages/OptionsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<StackPanel>
<GroupBox Padding="0,5">
<GroupBox.Header>
<CheckBox IsChecked="{Binding UseCustomEditor}" Content="{x:Static ep:VSPackage.OptionsPage_UseCustomEditor}" />
<CheckBox IsChecked="{Binding UseCustomEditor}" Content="{x:Static ep:I18n.OptionsPage_UseCustomEditor}" />
</GroupBox.Header>
<StackPanel IsEnabled="{Binding UseCustomEditor, Mode=OneWay}">
<TextBlock Text="{x:Static ep:VSPackage.OptionsPage_CustomEditor}" />
<TextBlock Text="{x:Static ep:I18n.OptionsPage_CustomEditor}" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
Expand All @@ -23,17 +23,17 @@
<TextBox Name="EditorExe" VerticalContentAlignment="Center" Text="{Binding EditorExe, UpdateSourceTrigger=PropertyChanged}" />
<Button Grid.Column="1" Width="40" Height="25" Content="..." Click="OnBrowseButtonClicked" />
</Grid>
<TextBlock Margin="0,5,0,0" Text="{x:Static ep:VSPackage.OptionsPage_Arguments}" />
<TextBlock Margin="0,5,0,0" Text="{x:Static ep:I18n.OptionsPage_Arguments}" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="50" />
</Grid.ColumnDefinitions>
<TextBox VerticalContentAlignment="Center" Text="{Binding EditorArg, UpdateSourceTrigger=PropertyChanged}" />
<Button Grid.Column="1" Width="40" Height="25" Content="{x:Static ep:VSPackage.OptionsPage_TestButtonContent}" Click="OnTestButtonClicked" />
<Button Grid.Column="1" Width="40" Height="25" Content="{x:Static ep:I18n.OptionsPage_TestButtonContent}" Click="OnTestButtonClicked" />
</Grid>
</StackPanel>
</GroupBox>
<CheckBox Margin="0,5,0,0" IsChecked="{Binding OpenProjitems}" Content="{x:Static ep:VSPackage.OptionsPage_OpenProjitems}" />
<CheckBox Margin="0,5,0,0" IsChecked="{Binding OpenProjitems}" Content="{x:Static ep:I18n.OptionsPage_OpenProjitems}" />
</StackPanel>
</UserControl>
2 changes: 1 addition & 1 deletion Kool.EditProject.Shared/Pages/OptionsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private void OnTestButtonClicked(object sender, RoutedEventArgs e)
}
catch (Exception ex)
{
Models.MessageBox.Error(VSPackage.ErrorMessageTitle, ex.Message);
Models.MessageBox.Error(I18n.ErrorMessageTitle, ex.Message);
}
}
}

0 comments on commit 259bda8

Please sign in to comment.