Skip to content

Commit 3802648

Browse files
authored
Merge pull request #13 from SyncfusionExamples/WPF-900674
900674 - How to apply localization for a WPF PdfViewer hosted in WinForms Application
2 parents 1e4b013 + 0488879 commit 3802648

23 files changed

+2180
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
5+
</startup>
6+
</configuration>

How-to/Apply-localization-to-WPF-PdfViewer-hosted-in-Winforms/HostedLocalizationSample/Form1.Designer.cs

+40
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Syncfusion.Windows.PdfViewer;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.ComponentModel;
5+
using System.Data;
6+
using System.Drawing;
7+
using System.Linq;
8+
using System.Text;
9+
using System.Threading.Tasks;
10+
using System.Windows.Forms;
11+
using System.Windows.Forms.Integration;
12+
13+
namespace HostedLocalizationSample
14+
{
15+
public partial class Form1 : Form
16+
{
17+
ElementHost elementHost = new ElementHost();
18+
WPFUserControl pdfViewer;
19+
public Form1()
20+
{
21+
InitializeComponent();
22+
pdfViewer = new WPFUserControl();
23+
elementHost.Dock = DockStyle.Fill;
24+
elementHost.Child = pdfViewer;
25+
this.Controls.Add(elementHost);
26+
this.Load += Form1_Load;
27+
}
28+
29+
private void Form1_Load(object sender, EventArgs e)
30+
{
31+
this.WindowState = FormWindowState.Maximized;
32+
}
33+
}
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{EE530E7C-768A-4D2B-9CAB-45D6883C5E88}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>HostedLocalizationSample</RootNamespace>
10+
<AssemblyName>HostedLocalizationSample</AssemblyName>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
<TargetFrameworkProfile />
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<PlatformTarget>AnyCPU</PlatformTarget>
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<PlatformTarget>AnyCPU</PlatformTarget>
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\Release\</OutputPath>
32+
<DefineConstants>TRACE</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Reference Include="PresentationCore" />
38+
<Reference Include="PresentationFramework" />
39+
<packageReference Include="Syncfusion.PdfViewer.WPF" version="*" />
40+
<Reference Include="System" />
41+
<Reference Include="System.Core" />
42+
<Reference Include="System.Xaml" />
43+
<Reference Include="System.Xml.Linq" />
44+
<Reference Include="System.Data.DataSetExtensions" />
45+
<Reference Include="Microsoft.CSharp" />
46+
<Reference Include="System.Data" />
47+
<Reference Include="System.Deployment" />
48+
<Reference Include="System.Drawing" />
49+
<Reference Include="System.Net.Http" />
50+
<Reference Include="System.Windows.Forms" />
51+
<Reference Include="System.Xml" />
52+
<Reference Include="WindowsBase" />
53+
<Reference Include="WindowsFormsIntegration" />
54+
</ItemGroup>
55+
<ItemGroup>
56+
<Compile Include="Form1.cs">
57+
<SubType>Form</SubType>
58+
</Compile>
59+
<Compile Include="Form1.Designer.cs">
60+
<DependentUpon>Form1.cs</DependentUpon>
61+
</Compile>
62+
<Compile Include="Program.cs" />
63+
<Compile Include="Properties\AssemblyInfo.cs" />
64+
<Compile Include="WPFUserControl.xaml.cs">
65+
<DependentUpon>WPFUserControl.xaml</DependentUpon>
66+
</Compile>
67+
<EmbeddedResource Include="Properties\Resources.resx">
68+
<Generator>ResXFileCodeGenerator</Generator>
69+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
70+
<SubType>Designer</SubType>
71+
</EmbeddedResource>
72+
<Compile Include="Properties\Resources.Designer.cs">
73+
<AutoGen>True</AutoGen>
74+
<DependentUpon>Resources.resx</DependentUpon>
75+
<DesignTime>True</DesignTime>
76+
</Compile>
77+
<None Include="packages.config" />
78+
<None Include="Properties\Settings.settings">
79+
<Generator>SettingsSingleFileGenerator</Generator>
80+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
81+
</None>
82+
<Compile Include="Properties\Settings.Designer.cs">
83+
<AutoGen>True</AutoGen>
84+
<DependentUpon>Settings.settings</DependentUpon>
85+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
86+
</Compile>
87+
</ItemGroup>
88+
<ItemGroup>
89+
<None Include="App.config" />
90+
</ItemGroup>
91+
<ItemGroup>
92+
<Page Include="WPFUserControl.xaml">
93+
<SubType>Designer</SubType>
94+
<Generator>MSBuild:Compile</Generator>
95+
</Page>
96+
</ItemGroup>
97+
<ItemGroup>
98+
<ProjectReference Include="..\LocalizationClassLibrary\LocalizationClassLibrary.csproj">
99+
<Project>{3a4f9d5f-fa2b-41d7-aeac-339ff4a540c6}</Project>
100+
<Name>LocalizationClassLibrary</Name>
101+
</ProjectReference>
102+
</ItemGroup>
103+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
104+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35707.178
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalizationClassLibrary", "..\LocalizationClassLibrary\LocalizationClassLibrary.csproj", "{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HostedLocalizationSample", "HostedLocalizationSample.csproj", "{EE530E7C-768A-4D2B-9CAB-45D6883C5E88}"
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+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{EE530E7C-768A-4D2B-9CAB-45D6883C5E88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{EE530E7C-768A-4D2B-9CAB-45D6883C5E88}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{EE530E7C-768A-4D2B-9CAB-45D6883C5E88}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{EE530E7C-768A-4D2B-9CAB-45D6883C5E88}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFramework>net8.0-windows</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
<UseWindowsForms>true</UseWindowsForms>
8+
<UseWPF>true</UseWPF>
9+
<ImplicitUsings>enable</ImplicitUsings>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Syncfusion.PdfViewer.WPF" Version="*" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\LocalizationClassLibrary\LocalizationClassLibrary.csproj" />
18+
</ItemGroup>
19+
20+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup />
4+
<ItemGroup>
5+
<Compile Update="Form1.cs">
6+
<SubType>Form</SubType>
7+
</Compile>
8+
</ItemGroup>
9+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35707.178
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HostedLocalizationSample_NET", "HostedLocalizationSample_NET.csproj", "{3DA71362-018F-4277-B90A-288E1A370CBD}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalizationClassLibrary", "..\LocalizationClassLibrary\LocalizationClassLibrary.csproj", "{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}"
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+
{3DA71362-018F-4277-B90A-288E1A370CBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{3DA71362-018F-4277-B90A-288E1A370CBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{3DA71362-018F-4277-B90A-288E1A370CBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{3DA71362-018F-4277-B90A-288E1A370CBD}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{3A4F9D5F-FA2B-41D7-AEAC-339FF4A540C6}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using System.Windows.Forms;
6+
7+
namespace HostedLocalizationSample
8+
{
9+
internal static class Program
10+
{
11+
/// <summary>
12+
/// The main entry point for the application.
13+
/// </summary>
14+
[STAThread]
15+
static void Main()
16+
{
17+
Application.EnableVisualStyles();
18+
Application.SetCompatibleTextRenderingDefault(false);
19+
Application.Run(new Form1());
20+
}
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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: AssemblyDescription("")]
9+
[assembly: AssemblyCopyright("Copyright © 2025")]
10+
[assembly: AssemblyTrademark("")]
11+
[assembly: AssemblyCulture("")]
12+
13+
// Setting ComVisible to false makes the types in this assembly not visible
14+
// to COM components. If you need to access a type in this assembly from
15+
// COM, set the ComVisible attribute to true on that type.
16+
[assembly: ComVisible(false)]
17+
18+
// The following GUID is for the ID of the typelib if this project is exposed to COM
19+
[assembly: Guid("ee530e7c-768a-4d2b-9cab-45d6883c5e88")]
20+
21+
// Version information for an assembly consists of the following four values:
22+
//
23+
// Major Version
24+
// Minor Version
25+
// Build Number
26+
// Revision
27+
//

How-to/Apply-localization-to-WPF-PdfViewer-hosted-in-Winforms/HostedLocalizationSample/Properties/Resources.Designer.cs

+63
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)